parse-code-context
Advanced tools
Comparing version 0.2.1 to 0.2.2
37
index.js
@@ -45,3 +45,3 @@ 'use strict'; | ||
* name: match[1], | ||
* params: match[2].split(/[, ]/) | ||
* params: matc(h[2] || '').split(/[, ]/) | ||
* }; | ||
@@ -97,3 +97,3 @@ * }) | ||
name: '', | ||
params: (m[2]).split(/[, ]+/), | ||
params: (m[2] || '').split(/[, ]+/), | ||
string: m[1] + '.' + m[2] + '()', | ||
@@ -110,3 +110,3 @@ original: m.input | ||
name: m[2], | ||
params: (m[3]).split(/[, ]+/), | ||
params: (m[3] || '').split(/[, ]+/), | ||
string: m[2] + '()', | ||
@@ -145,3 +145,3 @@ original: m.input | ||
name: m[2] + m[3], | ||
params: m[4].split(/[, ]+/), | ||
params: (m[4] || '').split(/[, ]+/), | ||
string: this.name(m[1] ? '.' : '.prototype.') + m[2] + m[3] + '()' | ||
@@ -157,3 +157,3 @@ }; | ||
name: m[3], | ||
params: m[4].split(/[, ]+/), | ||
params: (m[4] || '').split(/[, ]+/), | ||
string: m[3] + '()' | ||
@@ -168,3 +168,3 @@ }; | ||
name: m[1], // undefined | ||
params: m[4].split(/[, ]+/), | ||
params: (m[4] || '').split(/[, ]+/), | ||
string: m[1] + '()' | ||
@@ -180,3 +180,3 @@ }; | ||
name: m[1], | ||
params: m[4].split(/[, ]+/), | ||
params: (m[4] || '').split(/[, ]+/), | ||
string: m[1] + '()' | ||
@@ -192,3 +192,3 @@ }; | ||
name: m[1], | ||
params: m[2].split(/[, ]+/), | ||
params: (m[2] || '').split(/[, ]+/), | ||
string: (m[1] || '') + '()' | ||
@@ -205,3 +205,3 @@ }; | ||
name: m[2], | ||
params: m[3].split(/[, ]+/), | ||
params: (m[3] || '').split(/[, ]+/), | ||
string: m[1] + '.prototype.' + m[2] + '()' | ||
@@ -217,3 +217,3 @@ }; | ||
name: m[2], | ||
value: m[3].trim(), | ||
value: trim(m[3]), | ||
string: m[1] + '.prototype.' + m[2] | ||
@@ -269,3 +269,3 @@ }; | ||
name: m[1], | ||
value: m[2].trim(), | ||
value: trim(m[2]), | ||
string: this.name('.') + m[1] | ||
@@ -291,3 +291,3 @@ }; | ||
name: m[2], | ||
params: m[3].split(/[, ]+/), | ||
params: (m[3] || '').split(/[, ]+/), | ||
string: m[1] + '.' + m[2] + '()' | ||
@@ -303,3 +303,3 @@ }; | ||
name: m[2], | ||
value: m[3].trim(), | ||
value: trim(m[3]), | ||
string: m[1] + '.' + m[2] | ||
@@ -314,3 +314,3 @@ }; | ||
name: m[1], | ||
value: m[2].trim(), | ||
value: trim(m[2]), | ||
string: m[1] | ||
@@ -321,2 +321,11 @@ }; | ||
function trim(str) { | ||
return toString(str).trim(); | ||
} | ||
function toString(str) { | ||
if (!str) return ''; | ||
return str; | ||
} | ||
/** | ||
@@ -323,0 +332,0 @@ * Expose an instance of `Parser` |
{ | ||
"name": "parse-code-context", | ||
"description": "Parse code context in a single line of javascript, for functions, variable declarations, methods, prototype properties, prototype methods etc.", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"homepage": "https://github.com/jonschlinkert/parse-code-context", | ||
@@ -24,2 +24,3 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
"gulp-eslint": "^1.0.0", | ||
"gulp-format-md": "^0.1.4", | ||
"gulp-istanbul": "^0.10.2", | ||
@@ -26,0 +27,0 @@ "gulp-mocha": "^2.1.3", |
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
15587
294
7