Socket
Socket
Sign inDemoInstall

catharsis

Package Overview
Dependencies
2
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.8.6 to 0.8.7

parse.js

5

lib/describe.js

@@ -119,3 +119,2 @@ 'use strict';

function buildModifierStrings(describer, modifiers, type, useLongFormat) {
var modifierStrings = {};
var result = {};

@@ -284,3 +283,3 @@

Describer.prototype['new'] = function(funcNew) {
Describer.prototype.new = function(funcNew) {
var context = new Context({'functionNew': this.type(funcNew).description});

@@ -372,3 +371,3 @@ var key = funcNew ? 'new' : '';

Describer.prototype['this'] = function(funcThis) {
Describer.prototype.this = function(funcThis) {
var context = new Context({'functionThis': this.type(funcThis).description});

@@ -375,0 +374,0 @@ var key = funcThis ? 'this' : '';

17

lib/stringify.js

@@ -8,5 +8,2 @@ 'use strict';

this._options.linkClass = this._options.linkClass || this._options.cssClass;
// in a list of function signature params, repeatable params are stringified differently
this._inFunctionSignatureParams = false;
}

@@ -58,3 +55,3 @@

Stringifier.prototype['new'] = function(funcNew) {
Stringifier.prototype.new = function(funcNew) {
return funcNew ? 'new:' + this.type(funcNew) : '';

@@ -103,3 +100,3 @@ };

Stringifier.prototype['this'] = function(funcThis) {
Stringifier.prototype.this = function(funcThis) {
return funcThis ? 'this:' + this.type(funcThis) : '';

@@ -194,9 +191,7 @@ };

var open = '';
var close = '';
var optional = '';
var repeatable = '';
if (type.repeatable) {
open = this._inFunctionSignatureParams ? '...[' : '...';
close = this._inFunctionSignatureParams ? ']' : '';
repeatable = '...';
}

@@ -207,3 +202,3 @@

return open + combined + close + optional;
return repeatable + combined + optional;
};

@@ -251,3 +246,2 @@

this._inFunctionSignatureParams = true;
for (var i = 0, l = props.length; i < l; i++) {

@@ -260,3 +254,2 @@ prop = props[i];

}
this._inFunctionSignatureParams = false;

@@ -263,0 +256,0 @@ signature = 'function(' + params.join(', ') + ')';

{
"version": "0.8.6",
"version": "0.8.7",
"name": "catharsis",

@@ -17,3 +17,3 @@ "description": "A JavaScript parser for Google Closure Compiler and JSDoc type expressions.",

"mocha": "~2.0.1",
"pegjs": "https://github.com/dmajda/pegjs/tarball/76cc5d55b47ff3d5bbe1d435c6f843e2688cb729",
"pegjs": "https://github.com/dmajda/pegjs/tarball/eaca5f0acf97b66ef141fed84aa95d4e72e33757",
"should": "~4.0.4",

@@ -23,14 +23,9 @@ "tv4": "https://github.com/geraintluff/tv4/tarball/eb7561072d44943306e5fd88b55b4a4c98cb6c75"

"engines": {
"node": ">= 0.8"
"node": ">= 0.10"
},
"scripts": {
"prepublish": "./node_modules/.bin/pegjs ./lib/parser.pegjs",
"prepublish": "./node_modules/pegjs/bin/pegjs ./lib/parser.pegjs",
"test": "mocha"
},
"licenses": [
{
"type": "MIT",
"url": "http://github.com/hegemonic/catharsis/raw/master/LICENSE"
}
]
"license": "MIT"
}

@@ -65,4 +65,2 @@ # Catharsis #

+ The string `function` is treated as a function type with no parameters.
+ In a function type with repeatable parameters, the names of repeatable parameters are not required
to be enclosed in square brackets (for example, `function(...foo)` is allowed).
+ The period may be omitted from type applications. For example, `Array.<string>` and

@@ -230,2 +228,10 @@ `Array<string>` will be parsed in the same way.

+ 0.8.7 (June 2015):
+ Record types that use numeric literals as property names (for example, `{0: string}`) are now
parsed correctly.
+ Record types with a property that contains a function, with no space after the preceding colon
(for example, `{foo:function()}`), are now parsed correctly.
+ Repeatable function parameters are no longer required to be enclosed in brackets, regardless
of whether JSDoc-style type expressions are enabled. In addition, the brackets are omitted when
stringifying a parsed type expression.
+ 0.8.6 (December 2014): Improved the description of the unknown type.

@@ -232,0 +238,0 @@ + 0.8.5 (December 2014): Added support for postfix nullable/non-nullable operators combined with the

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc