@typedefs/parser
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -134,3 +134,3 @@ const { Fn, fn, | ||
const parseType = () => { | ||
const parseType = (specialAllowed = true) => { | ||
/** @type {!_typedefsParser.Type} */ | ||
@@ -142,2 +142,4 @@ const type = {} | ||
if ([nullable, nonNullable].includes(token)) { | ||
// can repeat for all specials but don't | ||
if (!specialAllowed) throw new Error(`${token} not allowed after .`) | ||
type.nullable = token === nullable | ||
@@ -175,2 +177,9 @@ consume() | ||
} | ||
while(peek() == '.') { | ||
type.name += '.' | ||
consume() | ||
const { name } = parseType(false) | ||
if (!name) throw new Error('Expected to see the name after .') | ||
type.name += name | ||
} | ||
return type | ||
@@ -177,0 +186,0 @@ } |
## 26 April 2019 | ||
### [1.0.2](https://github.com/artdecocode/parser/compare/v1.0.1...v1.0.2) | ||
- [feature] Parse namespaces. | ||
### [1.0.1](https://github.com/artdecocode/parser/compare/v1.0.0...v1.0.1) | ||
@@ -4,0 +8,0 @@ |
{ | ||
"name": "@typedefs/parser", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "The Parser For JSDoc Types.", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
@@ -134,3 +134,3 @@ import { Fn, fn, | ||
const parseType = () => { | ||
const parseType = (specialAllowed = true) => { | ||
/** @type {!_typedefsParser.Type} */ | ||
@@ -142,2 +142,4 @@ const type = {} | ||
if ([nullable, nonNullable].includes(token)) { | ||
// can repeat for all specials but don't | ||
if (!specialAllowed) throw new Error(`${token} not allowed after .`) | ||
type.nullable = token === nullable | ||
@@ -175,2 +177,9 @@ consume() | ||
} | ||
while(peek() == '.') { | ||
type.name += '.' | ||
consume() | ||
const { name } = parseType(false) | ||
if (!name) throw new Error('Expected to see the name after .') | ||
type.name += name | ||
} | ||
return type | ||
@@ -177,0 +186,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27594
489