abbrev
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -7,4 +7,11 @@ | ||
function monkeyPatch () { | ||
Array.prototype.abbrev = function () { return abbrev(this) } | ||
Object.prototype.abbrev = function () { return abbrev(Object.keys(this)) } | ||
Object.defineProperty(Array.prototype, 'abbrev', { | ||
value: function () { return abbrev(this) }, | ||
enumerable: false, configurable: true, writable: true | ||
}) | ||
Object.defineProperty(Object.prototype, 'abbrev', { | ||
value: function () { return abbrev(Object.keys(this)) }, | ||
enumerable: false, configurable: true, writable: true | ||
}) | ||
} | ||
@@ -36,4 +43,3 @@ | ||
prevMatches = prevMatches && curChar === prev.charAt(j) | ||
if (nextMatches || prevMatches) continue | ||
else { | ||
if (!nextMatches && !prevMatches) { | ||
j ++ | ||
@@ -65,4 +71,3 @@ break | ||
var assert = require("assert") | ||
, sys | ||
sys = require("util") | ||
var util = require("util") | ||
@@ -73,8 +78,8 @@ console.log("running tests") | ||
assert.deepEqual(actual, expect, | ||
"abbrev("+sys.inspect(list)+") === " + sys.inspect(expect) + "\n"+ | ||
"actual: "+sys.inspect(actual)) | ||
"abbrev("+util.inspect(list)+") === " + util.inspect(expect) + "\n"+ | ||
"actual: "+util.inspect(actual)) | ||
actual = abbrev.apply(exports, list) | ||
assert.deepEqual(abbrev.apply(exports, list), expect, | ||
"abbrev("+list.map(JSON.stringify).join(",")+") === " + sys.inspect(expect) + "\n"+ | ||
"actual: "+sys.inspect(actual)) | ||
"abbrev("+list.map(JSON.stringify).join(",")+") === " + util.inspect(expect) + "\n"+ | ||
"actual: "+util.inspect(actual)) | ||
} | ||
@@ -81,0 +86,0 @@ |
@@ -1,8 +0,15 @@ | ||
{ "name" : "abbrev" | ||
, "version" : "1.0.3" | ||
, "description" : "Like ruby's abbrev module, but in js" | ||
, "author" : "Isaac Z. Schlueter <i@izs.me>" | ||
, "main" : "./lib/abbrev.js" | ||
, "scripts" : { "test" : "node lib/abbrev.js" } | ||
, "repository" : "http://github.com/isaacs/abbrev-js" | ||
{ | ||
"name": "abbrev", | ||
"version": "1.0.4", | ||
"description": "Like ruby's abbrev module, but in js", | ||
"author": "Isaac Z. Schlueter <i@izs.me>", | ||
"main": "./lib/abbrev.js", | ||
"scripts": { | ||
"test": "node lib/abbrev.js" | ||
}, | ||
"repository": "http://github.com/isaacs/abbrev-js", | ||
"license": { | ||
"type": "MIT", | ||
"url": "https://github.com/isaacs/abbrev-js/raw/master/LICENSE" | ||
} | ||
} |
Nonpermissive License
License(Experimental) A package's licensing information has fine-grained problems
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
Found 1 instance in 1 package
No License Found
License(Experimental) License information could not be found
Found 1 instance in 1 package
4750
4
0
96
0
1
1