Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@typedefs/parser

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@typedefs/parser - npm Package Compare versions

Comparing version 1.1.1 to 1.2.0

12

build/lib.js

@@ -114,3 +114,3 @@ const { Fn, fn,

const parseType = (specialAllowed = true) => {
const parseType = (specialAllowed = true, union = []) => {
/** @type {!_typedefsParser.Type} */

@@ -131,3 +131,3 @@ let type = {}

type = {
...parseType(),
...parseType(true, []),
...type, // preserve nullable

@@ -170,9 +170,9 @@ }

const union = [type]
union.push(type)
while(peek() == '|') {
consume()
const nextType = parseType(true)
const nextType = parseType(true, union)
const u = nextType.union ? nextType.union : [nextType]
union.push(...u)
// const u = nextType.union ? nextType.union : [nextType]
if(nextType.union !== union) union.push(nextType)
}

@@ -179,0 +179,0 @@ return { union }

@@ -0,1 +1,7 @@

## 28 April 2019
### [1.2.0](https://github.com/artdecocode/parser/compare/v1.1.1...v1.2.0)
- [feature] Group unions correctly (allow `Type|?(string|number)`).
## 27 April 2019

@@ -2,0 +8,0 @@

{
"name": "@typedefs/parser",
"version": "1.1.1",
"version": "1.2.0",
"description": "The Parser For JSDoc Types.",

@@ -5,0 +5,0 @@ "main": "build/index.js",

@@ -114,3 +114,3 @@ import { Fn, fn,

const parseType = (specialAllowed = true) => {
const parseType = (specialAllowed = true, union = []) => {
/** @type {!_typedefsParser.Type} */

@@ -131,3 +131,3 @@ let type = {}

type = {
...parseType(),
...parseType(true, []),
...type, // preserve nullable

@@ -170,9 +170,9 @@ }

const union = [type]
union.push(type)
while(peek() == '|') {
consume()
const nextType = parseType(true)
const nextType = parseType(true, union)
const u = nextType.union ? nextType.union : [nextType]
union.push(...u)
// const u = nextType.union ? nextType.union : [nextType]
if(nextType.union !== union) union.push(nextType)
}

@@ -179,0 +179,0 @@ return { union }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc