aboutsummaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund')
-rw-r--r--deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/LICENSE15
-rw-r--r--deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/README.md53
-rw-r--r--deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/bench.js283
-rw-r--r--deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/package.json85
-rw-r--r--deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/sigmund.js39
-rw-r--r--deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/test/basic.js23
6 files changed, 0 insertions, 498 deletions
diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/LICENSE
deleted file mode 100644
index 19129e315f..0000000000
--- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/LICENSE
+++ /dev/null
@@ -1,15 +0,0 @@
-The ISC License
-
-Copyright (c) Isaac Z. Schlueter and Contributors
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
-IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/README.md b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/README.md
deleted file mode 100644
index 25a38a53fe..0000000000
--- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/README.md
+++ /dev/null
@@ -1,53 +0,0 @@
-# sigmund
-
-Quick and dirty signatures for Objects.
-
-This is like a much faster `deepEquals` comparison, which returns a
-string key suitable for caches and the like.
-
-## Usage
-
-```javascript
-function doSomething (someObj) {
- var key = sigmund(someObj, maxDepth) // max depth defaults to 10
- var cached = cache.get(key)
- if (cached) return cached
-
- var result = expensiveCalculation(someObj)
- cache.set(key, result)
- return result
-}
-```
-
-The resulting key will be as unique and reproducible as calling
-`JSON.stringify` or `util.inspect` on the object, but is much faster.
-In order to achieve this speed, some differences are glossed over.
-For example, the object `{0:'foo'}` will be treated identically to the
-array `['foo']`.
-
-Also, just as there is no way to summon the soul from the scribblings
-of a cocaine-addled psychoanalyst, there is no way to revive the object
-from the signature string that sigmund gives you. In fact, it's
-barely even readable.
-
-As with `util.inspect` and `JSON.stringify`, larger objects will
-produce larger signature strings.
-
-Because sigmund is a bit less strict than the more thorough
-alternatives, the strings will be shorter, and also there is a
-slightly higher chance for collisions. For example, these objects
-have the same signature:
-
- var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]}
- var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']}
-
-Like a good Freudian, sigmund is most effective when you already have
-some understanding of what you're looking for. It can help you help
-yourself, but you must be willing to do some work as well.
-
-Cycles are handled, and cyclical objects are silently omitted (though
-the key is included in the signature output.)
-
-The second argument is the maximum depth, which defaults to 10,
-because that is the maximum object traversal depth covered by most
-insurance carriers.
diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/bench.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/bench.js
deleted file mode 100644
index 5acfd6d90d..0000000000
--- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/bench.js
+++ /dev/null
@@ -1,283 +0,0 @@
-// different ways to id objects
-// use a req/res pair, since it's crazy deep and cyclical
-
-// sparseFE10 and sigmund are usually pretty close, which is to be expected,
-// since they are essentially the same algorithm, except that sigmund handles
-// regular expression objects properly.
-
-
-var http = require('http')
-var util = require('util')
-var sigmund = require('./sigmund.js')
-var sreq, sres, creq, cres, test
-
-http.createServer(function (q, s) {
- sreq = q
- sres = s
- sres.end('ok')
- this.close(function () { setTimeout(function () {
- start()
- }, 200) })
-}).listen(1337, function () {
- creq = http.get({ port: 1337 })
- creq.on('response', function (s) { cres = s })
-})
-
-function start () {
- test = [sreq, sres, creq, cres]
- // test = sreq
- // sreq.sres = sres
- // sreq.creq = creq
- // sreq.cres = cres
-
- for (var i in exports.compare) {
- console.log(i)
- var hash = exports.compare[i]()
- console.log(hash)
- console.log(hash.length)
- console.log('')
- }
-
- require('bench').runMain()
-}
-
-function customWs (obj, md, d) {
- d = d || 0
- var to = typeof obj
- if (to === 'undefined' || to === 'function' || to === null) return ''
- if (d > md || !obj || to !== 'object') return ('' + obj).replace(/[\n ]+/g, '')
-
- if (Array.isArray(obj)) {
- return obj.map(function (i, _, __) {
- return customWs(i, md, d + 1)
- }).reduce(function (a, b) { return a + b }, '')
- }
-
- var keys = Object.keys(obj)
- return keys.map(function (k, _, __) {
- return k + ':' + customWs(obj[k], md, d + 1)
- }).reduce(function (a, b) { return a + b }, '')
-}
-
-function custom (obj, md, d) {
- d = d || 0
- var to = typeof obj
- if (to === 'undefined' || to === 'function' || to === null) return ''
- if (d > md || !obj || to !== 'object') return '' + obj
-
- if (Array.isArray(obj)) {
- return obj.map(function (i, _, __) {
- return custom(i, md, d + 1)
- }).reduce(function (a, b) { return a + b }, '')
- }
-
- var keys = Object.keys(obj)
- return keys.map(function (k, _, __) {
- return k + ':' + custom(obj[k], md, d + 1)
- }).reduce(function (a, b) { return a + b }, '')
-}
-
-function sparseFE2 (obj, maxDepth) {
- var seen = []
- var soFar = ''
- function ch (v, depth) {
- if (depth > maxDepth) return
- if (typeof v === 'function' || typeof v === 'undefined') return
- if (typeof v !== 'object' || !v) {
- soFar += v
- return
- }
- if (seen.indexOf(v) !== -1 || depth === maxDepth) return
- seen.push(v)
- soFar += '{'
- Object.keys(v).forEach(function (k, _, __) {
- // pseudo-private values. skip those.
- if (k.charAt(0) === '_') return
- var to = typeof v[k]
- if (to === 'function' || to === 'undefined') return
- soFar += k + ':'
- ch(v[k], depth + 1)
- })
- soFar += '}'
- }
- ch(obj, 0)
- return soFar
-}
-
-function sparseFE (obj, maxDepth) {
- var seen = []
- var soFar = ''
- function ch (v, depth) {
- if (depth > maxDepth) return
- if (typeof v === 'function' || typeof v === 'undefined') return
- if (typeof v !== 'object' || !v) {
- soFar += v
- return
- }
- if (seen.indexOf(v) !== -1 || depth === maxDepth) return
- seen.push(v)
- soFar += '{'
- Object.keys(v).forEach(function (k, _, __) {
- // pseudo-private values. skip those.
- if (k.charAt(0) === '_') return
- var to = typeof v[k]
- if (to === 'function' || to === 'undefined') return
- soFar += k
- ch(v[k], depth + 1)
- })
- }
- ch(obj, 0)
- return soFar
-}
-
-function sparse (obj, maxDepth) {
- var seen = []
- var soFar = ''
- function ch (v, depth) {
- if (depth > maxDepth) return
- if (typeof v === 'function' || typeof v === 'undefined') return
- if (typeof v !== 'object' || !v) {
- soFar += v
- return
- }
- if (seen.indexOf(v) !== -1 || depth === maxDepth) return
- seen.push(v)
- soFar += '{'
- for (var k in v) {
- // pseudo-private values. skip those.
- if (k.charAt(0) === '_') continue
- var to = typeof v[k]
- if (to === 'function' || to === 'undefined') continue
- soFar += k
- ch(v[k], depth + 1)
- }
- }
- ch(obj, 0)
- return soFar
-}
-
-function noCommas (obj, maxDepth) {
- var seen = []
- var soFar = ''
- function ch (v, depth) {
- if (depth > maxDepth) return
- if (typeof v === 'function' || typeof v === 'undefined') return
- if (typeof v !== 'object' || !v) {
- soFar += v
- return
- }
- if (seen.indexOf(v) !== -1 || depth === maxDepth) return
- seen.push(v)
- soFar += '{'
- for (var k in v) {
- // pseudo-private values. skip those.
- if (k.charAt(0) === '_') continue
- var to = typeof v[k]
- if (to === 'function' || to === 'undefined') continue
- soFar += k + ':'
- ch(v[k], depth + 1)
- }
- soFar += '}'
- }
- ch(obj, 0)
- return soFar
-}
-
-
-function flatten (obj, maxDepth) {
- var seen = []
- var soFar = ''
- function ch (v, depth) {
- if (depth > maxDepth) return
- if (typeof v === 'function' || typeof v === 'undefined') return
- if (typeof v !== 'object' || !v) {
- soFar += v
- return
- }
- if (seen.indexOf(v) !== -1 || depth === maxDepth) return
- seen.push(v)
- soFar += '{'
- for (var k in v) {
- // pseudo-private values. skip those.
- if (k.charAt(0) === '_') continue
- var to = typeof v[k]
- if (to === 'function' || to === 'undefined') continue
- soFar += k + ':'
- ch(v[k], depth + 1)
- soFar += ','
- }
- soFar += '}'
- }
- ch(obj, 0)
- return soFar
-}
-
-exports.compare =
-{
- // 'custom 2': function () {
- // return custom(test, 2, 0)
- // },
- // 'customWs 2': function () {
- // return customWs(test, 2, 0)
- // },
- 'JSON.stringify (guarded)': function () {
- var seen = []
- return JSON.stringify(test, function (k, v) {
- if (typeof v !== 'object' || !v) return v
- if (seen.indexOf(v) !== -1) return undefined
- seen.push(v)
- return v
- })
- },
-
- 'flatten 10': function () {
- return flatten(test, 10)
- },
-
- // 'flattenFE 10': function () {
- // return flattenFE(test, 10)
- // },
-
- 'noCommas 10': function () {
- return noCommas(test, 10)
- },
-
- 'sparse 10': function () {
- return sparse(test, 10)
- },
-
- 'sparseFE 10': function () {
- return sparseFE(test, 10)
- },
-
- 'sparseFE2 10': function () {
- return sparseFE2(test, 10)
- },
-
- sigmund: function() {
- return sigmund(test, 10)
- },
-
-
- // 'util.inspect 1': function () {
- // return util.inspect(test, false, 1, false)
- // },
- // 'util.inspect undefined': function () {
- // util.inspect(test)
- // },
- // 'util.inspect 2': function () {
- // util.inspect(test, false, 2, false)
- // },
- // 'util.inspect 3': function () {
- // util.inspect(test, false, 3, false)
- // },
- // 'util.inspect 4': function () {
- // util.inspect(test, false, 4, false)
- // },
- // 'util.inspect Infinity': function () {
- // util.inspect(test, false, Infinity, false)
- // }
-}
-
-/** results
-**/
diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/package.json b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/package.json
deleted file mode 100644
index b1dbae0a80..0000000000
--- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/package.json
+++ /dev/null
@@ -1,85 +0,0 @@
-{
- "_args": [
- [
- "sigmund@~1.0.0",
- "/Users/rebecca/code/release/npm-3/node_modules/node-gyp/node_modules/minimatch"
- ]
- ],
- "_from": "sigmund@>=1.0.0 <1.1.0",
- "_id": "sigmund@1.0.1",
- "_inCache": true,
- "_installable": true,
- "_location": "/node-gyp/minimatch/sigmund",
- "_nodeVersion": "2.0.1",
- "_npmUser": {
- "email": "isaacs@npmjs.com",
- "name": "isaacs"
- },
- "_npmVersion": "2.10.0",
- "_phantomChildren": {},
- "_requested": {
- "name": "sigmund",
- "raw": "sigmund@~1.0.0",
- "rawSpec": "~1.0.0",
- "scope": null,
- "spec": ">=1.0.0 <1.1.0",
- "type": "range"
- },
- "_requiredBy": [
- "/node-gyp/minimatch"
- ],
- "_resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz",
- "_shasum": "3ff21f198cad2175f9f3b781853fd94d0d19b590",
- "_shrinkwrap": null,
- "_spec": "sigmund@~1.0.0",
- "_where": "/Users/rebecca/code/release/npm-3/node_modules/node-gyp/node_modules/minimatch",
- "author": {
- "email": "i@izs.me",
- "name": "Isaac Z. Schlueter",
- "url": "http://blog.izs.me/"
- },
- "bugs": {
- "url": "https://github.com/isaacs/sigmund/issues"
- },
- "dependencies": {},
- "description": "Quick and dirty signatures for Objects.",
- "devDependencies": {
- "tap": "~0.3.0"
- },
- "directories": {
- "test": "test"
- },
- "dist": {
- "shasum": "3ff21f198cad2175f9f3b781853fd94d0d19b590",
- "tarball": "http://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz"
- },
- "gitHead": "527f97aa5bb253d927348698c0cd3bb267d098c6",
- "homepage": "https://github.com/isaacs/sigmund#readme",
- "keywords": [
- "data",
- "key",
- "object",
- "psychoanalysis",
- "signature"
- ],
- "license": "ISC",
- "main": "sigmund.js",
- "maintainers": [
- {
- "name": "isaacs",
- "email": "i@izs.me"
- }
- ],
- "name": "sigmund",
- "optionalDependencies": {},
- "readme": "ERROR: No README data found!",
- "repository": {
- "type": "git",
- "url": "git://github.com/isaacs/sigmund.git"
- },
- "scripts": {
- "bench": "node bench.js",
- "test": "tap test/*.js"
- },
- "version": "1.0.1"
-}
diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/sigmund.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/sigmund.js
deleted file mode 100644
index 82c7ab8ce9..0000000000
--- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/sigmund.js
+++ /dev/null
@@ -1,39 +0,0 @@
-module.exports = sigmund
-function sigmund (subject, maxSessions) {
- maxSessions = maxSessions || 10;
- var notes = [];
- var analysis = '';
- var RE = RegExp;
-
- function psychoAnalyze (subject, session) {
- if (session > maxSessions) return;
-
- if (typeof subject === 'function' ||
- typeof subject === 'undefined') {
- return;
- }
-
- if (typeof subject !== 'object' || !subject ||
- (subject instanceof RE)) {
- analysis += subject;
- return;
- }
-
- if (notes.indexOf(subject) !== -1 || session === maxSessions) return;
-
- notes.push(subject);
- analysis += '{';
- Object.keys(subject).forEach(function (issue, _, __) {
- // pseudo-private values. skip those.
- if (issue.charAt(0) === '_') return;
- var to = typeof subject[issue];
- if (to === 'function' || to === 'undefined') return;
- analysis += issue;
- psychoAnalyze(subject[issue], session + 1);
- });
- }
- psychoAnalyze(subject, 0);
- return analysis;
-}
-
-// vim: set softtabstop=4 shiftwidth=4:
diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/test/basic.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/test/basic.js
deleted file mode 100644
index 6149a80239..0000000000
--- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/test/basic.js
+++ /dev/null
@@ -1,23 +0,0 @@
-var test = require('tap').test
-var sigmund = require('../sigmund.js')
-
-
-// occasionally there are duplicates
-// that's an acceptable edge-case. JSON.stringify and util.inspect
-// have some collision potential as well, though less, and collision
-// detection is expensive.
-var hash = '{abc/def/g{0h1i2{jkl'
-var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]}
-var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']}
-
-var obj3 = JSON.parse(JSON.stringify(obj1))
-obj3.c = /def/
-obj3.g[2].cycle = obj3
-var cycleHash = '{abc/def/g{0h1i2{jklcycle'
-
-test('basic', function (t) {
- t.equal(sigmund(obj1), hash)
- t.equal(sigmund(obj2), hash)
- t.equal(sigmund(obj3), cycleHash)
- t.end()
-})