Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRebecca Turner <me@re-becca.org>2016-06-17 00:41:09 +0300
committerRebecca Turner <me@re-becca.org>2016-06-17 00:58:03 +0300
commitdda3ca70f74879106589ef29e167c8b91ef5aa4c (patch)
tree404a98f16a9bc67c112f3381930c988e376f005d /node_modules/wrappy
parentda743dc2153fed8baca3dada611b188f53ab5931 (diff)
wrappy@1.0.2
No consumer visible changes. Credit: @zkat
Diffstat (limited to 'node_modules/wrappy')
-rw-r--r--node_modules/wrappy/package.json109
-rw-r--r--node_modules/wrappy/test/basic.js51
2 files changed, 87 insertions, 73 deletions
diff --git a/node_modules/wrappy/package.json b/node_modules/wrappy/package.json
index a617a72bb..10c34634a 100644
--- a/node_modules/wrappy/package.json
+++ b/node_modules/wrappy/package.json
@@ -1,36 +1,101 @@
{
- "name": "wrappy",
- "version": "1.0.1",
- "description": "Callback wrapping utility",
- "main": "wrappy.js",
- "directories": {
- "test": "test"
+ "_args": [
+ [
+ {
+ "raw": "wrappy@latest",
+ "scope": null,
+ "escapedName": "wrappy",
+ "name": "wrappy",
+ "rawSpec": "latest",
+ "spec": "latest",
+ "type": "tag"
+ },
+ "/Users/rebecca/code/npm"
+ ]
+ ],
+ "_from": "wrappy@latest",
+ "_id": "wrappy@1.0.2",
+ "_inCache": true,
+ "_installable": true,
+ "_location": "/wrappy",
+ "_nodeVersion": "5.10.1",
+ "_npmOperationalInternal": {
+ "host": "packages-16-east.internal.npmjs.com",
+ "tmp": "tmp/wrappy-1.0.2.tgz_1463527848281_0.037129373755306005"
},
- "dependencies": {},
- "devDependencies": {
- "tap": "^0.4.12"
+ "_npmUser": {
+ "name": "zkat",
+ "email": "kat@sykosomatic.org"
},
- "scripts": {
- "test": "tap test/*.js"
- },
- "repository": {
- "type": "git",
- "url": "git+https://github.com/npm/wrappy.git"
+ "_npmVersion": "3.9.1",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "wrappy@latest",
+ "scope": null,
+ "escapedName": "wrappy",
+ "name": "wrappy",
+ "rawSpec": "latest",
+ "spec": "latest",
+ "type": "tag"
},
+ "_requiredBy": [
+ "#USER",
+ "/",
+ "/dezalgo",
+ "/inflight",
+ "/once"
+ ],
+ "_resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
+ "_shasum": "b5243d8f3ec1aa35f1364605bc0d1036e30ab69f",
+ "_shrinkwrap": null,
+ "_spec": "wrappy@latest",
+ "_where": "/Users/rebecca/code/npm",
"author": {
"name": "Isaac Z. Schlueter",
"email": "i@izs.me",
"url": "http://blog.izs.me/"
},
- "license": "ISC",
"bugs": {
"url": "https://github.com/npm/wrappy/issues"
},
+ "dependencies": {},
+ "description": "Callback wrapping utility",
+ "devDependencies": {
+ "tap": "^2.3.1"
+ },
+ "directories": {
+ "test": "test"
+ },
+ "dist": {
+ "shasum": "b5243d8f3ec1aa35f1364605bc0d1036e30ab69f",
+ "tarball": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz"
+ },
+ "files": [
+ "wrappy.js"
+ ],
+ "gitHead": "71d91b6dc5bdeac37e218c2cf03f9ab55b60d214",
"homepage": "https://github.com/npm/wrappy",
- "readme": "# wrappy\n\nCallback wrapping utility\n\n## USAGE\n\n```javascript\nvar wrappy = require(\"wrappy\")\n\n// var wrapper = wrappy(wrapperFunction)\n\n// make sure a cb is called only once\n// See also: http://npm.im/once for this specific use case\nvar once = wrappy(function (cb) {\n var called = false\n return function () {\n if (called) return\n called = true\n return cb.apply(this, arguments)\n }\n})\n\nfunction printBoo () {\n console.log('boo')\n}\n// has some rando property\nprintBoo.iAmBooPrinter = true\n\nvar onlyPrintOnce = once(printBoo)\n\nonlyPrintOnce() // prints 'boo'\nonlyPrintOnce() // does nothing\n\n// random property is retained!\nassert.equal(onlyPrintOnce.iAmBooPrinter, true)\n```\n",
- "readmeFilename": "README.md",
- "_id": "wrappy@1.0.1",
- "_shasum": "1e65969965ccbc2db4548c6b84a6f2c5aedd4739",
- "_resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz",
- "_from": "wrappy@>=1.0.1 <1.1.0"
+ "license": "ISC",
+ "main": "wrappy.js",
+ "maintainers": [
+ {
+ "name": "isaacs",
+ "email": "i@izs.me"
+ },
+ {
+ "name": "zkat",
+ "email": "kat@sykosomatic.org"
+ }
+ ],
+ "name": "wrappy",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/npm/wrappy.git"
+ },
+ "scripts": {
+ "test": "tap --coverage test/*.js"
+ },
+ "version": "1.0.2"
}
diff --git a/node_modules/wrappy/test/basic.js b/node_modules/wrappy/test/basic.js
deleted file mode 100644
index 5ed0fcdfd..000000000
--- a/node_modules/wrappy/test/basic.js
+++ /dev/null
@@ -1,51 +0,0 @@
-var test = require('tap').test
-var wrappy = require('../wrappy.js')
-
-test('basic', function (t) {
- function onceifier (cb) {
- var called = false
- return function () {
- if (called) return
- called = true
- return cb.apply(this, arguments)
- }
- }
- onceifier.iAmOnce = {}
- var once = wrappy(onceifier)
- t.equal(once.iAmOnce, onceifier.iAmOnce)
-
- var called = 0
- function boo () {
- t.equal(called, 0)
- called++
- }
- // has some rando property
- boo.iAmBoo = true
-
- var onlyPrintOnce = once(boo)
-
- onlyPrintOnce() // prints 'boo'
- onlyPrintOnce() // does nothing
- t.equal(called, 1)
-
- // random property is retained!
- t.equal(onlyPrintOnce.iAmBoo, true)
-
- var logs = []
- var logwrap = wrappy(function (msg, cb) {
- logs.push(msg + ' wrapping cb')
- return function () {
- logs.push(msg + ' before cb')
- var ret = cb.apply(this, arguments)
- logs.push(msg + ' after cb')
- }
- })
-
- var c = logwrap('foo', function () {
- t.same(logs, [ 'foo wrapping cb', 'foo before cb' ])
- })
- c()
- t.same(logs, [ 'foo wrapping cb', 'foo before cb', 'foo after cb' ])
-
- t.end()
-})