fsevents 1.0.8 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of fsevents might be problematic. Click here for more details.
- package/node_modules/ansi-styles/index.js +72 -6
- package/node_modules/ansi-styles/package.json +19 -12
- package/node_modules/ansi-styles/readme.md +36 -8
- package/node_modules/are-we-there-yet/CHANGES.md +19 -0
- package/node_modules/are-we-there-yet/README.md +12 -2
- package/node_modules/are-we-there-yet/index.js +4 -132
- package/node_modules/are-we-there-yet/package.json +18 -13
- package/node_modules/are-we-there-yet/test/lib/test-event.js +29 -0
- package/node_modules/are-we-there-yet/test/tracker.js +44 -43
- package/node_modules/are-we-there-yet/test/trackergroup.js +73 -64
- package/node_modules/are-we-there-yet/test/trackerstream.js +26 -40
- package/node_modules/are-we-there-yet/tracker-base.js +11 -0
- package/node_modules/are-we-there-yet/tracker-group.js +107 -0
- package/node_modules/are-we-there-yet/tracker-stream.js +35 -0
- package/node_modules/are-we-there-yet/tracker.js +30 -0
- package/node_modules/asn1/package.json +1 -2
- package/node_modules/assert-plus/package.json +1 -3
- package/node_modules/async/package.json +1 -1
- package/node_modules/aws4/.npmignore +2 -1
- package/node_modules/aws4/README.md +4 -0
- package/node_modules/aws4/aws4.js +8 -3
- package/node_modules/aws4/node_modules/lru-cache/.npmignore +3 -0
- package/node_modules/aws4/node_modules/lru-cache/.travis.yml +3 -4
- package/node_modules/aws4/node_modules/lru-cache/README.md +29 -24
- package/node_modules/aws4/node_modules/lru-cache/benchmarks/insertion-time.js +32 -0
- package/node_modules/aws4/node_modules/lru-cache/lib/lru-cache.js +333 -199
- package/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/LICENSE +15 -0
- package/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/README.md +60 -0
- package/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/map.js +9 -0
- package/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/package.json +59 -0
- package/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/pseudomap.js +113 -0
- package/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/test/basic.js +86 -0
- package/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.npmignore +4 -0
- package/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.travis.yml +7 -0
- package/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/CONTRIBUTING.md +4 -0
- package/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/LICENSE +15 -0
- package/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/README.md +204 -0
- package/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/package.json +59 -0
- package/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/test/basic.js +188 -0
- package/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/yallist.js +360 -0
- package/node_modules/aws4/node_modules/lru-cache/package.json +16 -12
- package/node_modules/aws4/node_modules/lru-cache/test/basic.js +270 -146
- package/node_modules/aws4/node_modules/lru-cache/test/foreach.js +39 -25
- package/node_modules/aws4/node_modules/lru-cache/test/inspect.js +54 -0
- package/node_modules/aws4/node_modules/lru-cache/test/no-symbol.js +3 -0
- package/node_modules/aws4/node_modules/lru-cache/test/serialize.js +115 -104
- package/node_modules/aws4/package.json +17 -14
- package/node_modules/bl/bl.js +9 -3
- package/node_modules/bl/package.json +12 -12
- package/node_modules/bl/test/test.js +14 -0
- package/node_modules/color-convert/README.md +62 -0
- package/node_modules/color-convert/conversions.js +594 -0
- package/node_modules/color-convert/css-keywords.js +151 -0
- package/node_modules/color-convert/index.js +75 -0
- package/node_modules/color-convert/package.json +92 -0
- package/node_modules/color-convert/route.js +98 -0
- package/node_modules/dashdash/lib/dashdash.js +1 -1
- package/node_modules/dashdash/node_modules/assert-plus/AUTHORS +6 -0
- package/node_modules/dashdash/node_modules/assert-plus/CHANGES.md +14 -0
- package/node_modules/dashdash/node_modules/assert-plus/README.md +162 -0
- package/node_modules/dashdash/node_modules/assert-plus/assert.js +211 -0
- package/node_modules/dashdash/node_modules/assert-plus/package.json +89 -0
- package/node_modules/dashdash/package.json +19 -12
- package/node_modules/ecc-jsbn/package.json +1 -2
- package/node_modules/escape-string-regexp/package.json +15 -11
- package/node_modules/extsprintf/package.json +2 -3
- package/node_modules/form-data/.dockerignore +7 -0
- package/node_modules/form-data/.editorconfig +10 -0
- package/node_modules/form-data/.eslintignore +1 -0
- package/node_modules/form-data/.eslintrc +64 -0
- package/node_modules/form-data/{Readme.md → README.md} +9 -1
- package/node_modules/form-data/lib/browser.js +2 -1
- package/node_modules/form-data/lib/form_data.js +172 -135
- package/node_modules/form-data/lib/populate.js +9 -0
- package/node_modules/form-data/package.json +35 -16
- package/node_modules/form-data/wercker.yml +36 -0
- package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/index.js +1 -1
- package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/package.json +14 -10
- package/node_modules/gauge/README.md +1 -1
- package/node_modules/gauge/package.json +18 -14
- package/node_modules/gauge/progress-bar.js +2 -2
- package/node_modules/http-signature/package.json +1 -2
- package/node_modules/is-my-json-valid/README.md +2 -2
- package/node_modules/is-my-json-valid/index.js +15 -6
- package/node_modules/is-my-json-valid/package.json +11 -7
- package/node_modules/is-my-json-valid/test/json-schema-draft4/multipleOf.json +36 -0
- package/node_modules/is-my-json-valid/test/misc.js +18 -0
- package/node_modules/is-typedarray/package.json +1 -2
- package/node_modules/isarray/.npmignore +1 -0
- package/node_modules/isarray/.travis.yml +4 -0
- package/node_modules/isarray/Makefile +6 -0
- package/node_modules/isarray/README.md +6 -0
- package/node_modules/isarray/index.js +3 -1
- package/node_modules/isarray/package.json +28 -10
- package/node_modules/isarray/test.js +20 -0
- package/node_modules/jodid25519/package.json +1 -2
- package/node_modules/jsbn/package.json +1 -2
- package/node_modules/json-schema/package.json +1 -1
- package/node_modules/jsprim/package.json +1 -2
- package/node_modules/lodash.pad/LICENSE +17 -16
- package/node_modules/lodash.pad/README.md +2 -2
- package/node_modules/lodash.pad/index.js +3 -94
- package/node_modules/lodash.pad/package.json +12 -12
- package/node_modules/lodash.padend/LICENSE +23 -0
- package/node_modules/lodash.padend/README.md +18 -0
- package/node_modules/lodash.padend/index.js +285 -0
- package/node_modules/lodash.padend/package.json +91 -0
- package/node_modules/lodash.padstart/LICENSE +23 -0
- package/node_modules/lodash.padstart/README.md +18 -0
- package/node_modules/lodash.padstart/index.js +285 -0
- package/node_modules/lodash.padstart/package.json +91 -0
- package/node_modules/lodash.repeat/LICENSE +17 -16
- package/node_modules/lodash.repeat/README.md +2 -2
- package/node_modules/lodash.repeat/index.js +3 -94
- package/node_modules/lodash.repeat/package.json +14 -13
- package/node_modules/lodash.tostring/LICENSE +23 -0
- package/node_modules/lodash.tostring/README.md +18 -0
- package/node_modules/lodash.tostring/index.js +164 -0
- package/node_modules/lodash.tostring/package.json +91 -0
- package/node_modules/mime-db/HISTORY.md +14 -0
- package/node_modules/mime-db/db.json +26 -3
- package/node_modules/mime-db/package.json +23 -18
- package/node_modules/mime-types/HISTORY.md +8 -0
- package/node_modules/mime-types/README.md +1 -1
- package/node_modules/mime-types/package.json +21 -16
- package/node_modules/node-pre-gyp/CHANGELOG.md +11 -0
- package/node_modules/node-pre-gyp/lib/util/abi_crosswalk.json +44 -4
- package/node_modules/node-pre-gyp/package.json +16 -16
- package/node_modules/npmlog/.nyc_output/64996.json +1 -0
- package/node_modules/npmlog/.nyc_output/64998.json +1 -0
- package/node_modules/npmlog/.nyc_output/65000.json +1 -0
- package/node_modules/npmlog/log.js +3 -2
- package/node_modules/npmlog/package.json +15 -11
- package/node_modules/npmlog/test/progress.js +25 -8
- package/node_modules/once/package.json +1 -1
- package/node_modules/qs/package.json +1 -2
- package/node_modules/readable-stream/.travis.yml +18 -16
- package/node_modules/readable-stream/README.md +1 -1
- package/node_modules/readable-stream/doc/stream.markdown +435 -405
- package/node_modules/readable-stream/lib/_stream_duplex.js +13 -20
- package/node_modules/readable-stream/lib/_stream_passthrough.js +3 -4
- package/node_modules/readable-stream/lib/_stream_readable.js +110 -205
- package/node_modules/readable-stream/lib/_stream_transform.js +21 -38
- package/node_modules/readable-stream/lib/_stream_writable.js +108 -121
- package/node_modules/readable-stream/package.json +19 -15
- package/node_modules/request/package.json +1 -2
- package/node_modules/rimraf/node_modules/glob/README.md +6 -0
- package/node_modules/rimraf/node_modules/glob/common.js +12 -3
- package/node_modules/rimraf/node_modules/glob/glob.js +20 -3
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js +1 -1
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +14 -10
- package/node_modules/rimraf/node_modules/glob/package.json +15 -11
- package/node_modules/rimraf/node_modules/glob/sync.js +8 -1
- package/node_modules/rimraf/package.json +14 -10
- package/node_modules/semver/package.json +1 -2
- package/node_modules/sshpk/lib/formats/rfc4253.js +2 -1
- package/node_modules/sshpk/package.json +13 -10
- package/node_modules/strip-ansi/package.json +21 -16
- package/node_modules/strip-ansi/readme.md +5 -5
- package/node_modules/tough-cookie/lib/cookie.js +2 -2
- package/node_modules/tough-cookie/package.json +13 -9
- package/node_modules/tweetnacl/CHANGELOG.md +53 -0
- package/node_modules/tweetnacl/COPYING.txt +9 -0
- package/node_modules/tweetnacl/README.md +14 -40
- package/node_modules/tweetnacl/nacl-fast.js +21 -51
- package/node_modules/tweetnacl/nacl-fast.min.js +2 -2
- package/node_modules/tweetnacl/nacl.js +21 -51
- package/node_modules/tweetnacl/nacl.min.js +1 -1
- package/node_modules/tweetnacl/package.json +28 -38
- package/node_modules/verror/package.json +2 -3
- package/package.json +2 -2
- package/node_modules/aws4/example.js +0 -372
- package/node_modules/aws4/node_modules/lru-cache/test/memory-leak.js +0 -51
- package/node_modules/isarray/build/build.js +0 -209
- package/node_modules/lodash._basetostring/LICENSE +0 -22
- package/node_modules/lodash._basetostring/README.md +0 -20
- package/node_modules/lodash._basetostring/index.js +0 -22
- package/node_modules/lodash._basetostring/package.json +0 -99
- package/node_modules/lodash._createpadding/LICENSE +0 -22
- package/node_modules/lodash._createpadding/README.md +0 -20
- package/node_modules/lodash._createpadding/index.js +0 -37
- package/node_modules/lodash._createpadding/package.json +0 -101
- package/node_modules/lodash._root/LICENSE +0 -22
- package/node_modules/lodash._root/README.md +0 -18
- package/node_modules/lodash._root/index.js +0 -53
- package/node_modules/lodash._root/package.json +0 -77
- package/node_modules/lodash.padleft/LICENSE.txt +0 -22
- package/node_modules/lodash.padleft/README.md +0 -20
- package/node_modules/lodash.padleft/index.js +0 -50
- package/node_modules/lodash.padleft/package.json +0 -107
- package/node_modules/lodash.padright/LICENSE.txt +0 -22
- package/node_modules/lodash.padright/README.md +0 -20
- package/node_modules/lodash.padright/index.js +0 -50
- package/node_modules/lodash.padright/package.json +0 -107
@@ -0,0 +1,188 @@
|
|
1
|
+
var t = require('tap')
|
2
|
+
var Yallist = require('../yallist.js')
|
3
|
+
|
4
|
+
var y = new Yallist(1,2,3,4,5)
|
5
|
+
var z = new Yallist([1,2,3,4,5])
|
6
|
+
t.similar(y, z, 'build from single list or args')
|
7
|
+
|
8
|
+
function add10 (i) {
|
9
|
+
return i + 10
|
10
|
+
}
|
11
|
+
t.similar(y.map(add10).toArray(), [11, 12, 13, 14, 15])
|
12
|
+
t.similar(y.mapReverse(add10).toArray(), [15, 14, 13, 12, 11])
|
13
|
+
|
14
|
+
t.similar(y.map(add10).toArrayReverse(), [15, 14, 13, 12, 11])
|
15
|
+
t.isa(Yallist(1,2,3), 'Yallist')
|
16
|
+
t.equal(y.push(6, 7, 8), 8)
|
17
|
+
t.similar(y.toArray(), [1, 2, 3, 4, 5, 6, 7, 8])
|
18
|
+
y.pop()
|
19
|
+
y.shift()
|
20
|
+
y.unshift(100)
|
21
|
+
|
22
|
+
var expect = [100, 2, 3, 4, 5, 6, 7]
|
23
|
+
var expectReverse = [ 7, 6, 5, 4, 3, 2, 100 ]
|
24
|
+
|
25
|
+
t.similar(y.toArray(), expect)
|
26
|
+
t.equal(y.length, y.toArray().length)
|
27
|
+
|
28
|
+
t.test(function forEach (t) {
|
29
|
+
t.plan(y.length * 2)
|
30
|
+
y.forEach(function (item, i, list) {
|
31
|
+
t.equal(item, expect[i])
|
32
|
+
t.equal(list, y)
|
33
|
+
})
|
34
|
+
})
|
35
|
+
|
36
|
+
t.test(function forEach (t) {
|
37
|
+
t.plan(y.length * 5)
|
38
|
+
var n = 0
|
39
|
+
y.forEachReverse(function (item, i, list) {
|
40
|
+
t.equal(item, expectReverse[n])
|
41
|
+
t.equal(item, expect[i])
|
42
|
+
t.equal(item, y.get(i))
|
43
|
+
t.equal(item, y.getReverse(n))
|
44
|
+
n += 1
|
45
|
+
t.equal(list, y)
|
46
|
+
})
|
47
|
+
})
|
48
|
+
|
49
|
+
t.equal(y.getReverse(100), undefined)
|
50
|
+
|
51
|
+
t.equal(y.get(9999), undefined)
|
52
|
+
|
53
|
+
|
54
|
+
function sum (a, b) { return a + b }
|
55
|
+
t.equal(y.reduce(sum), 127)
|
56
|
+
t.equal(y.reduce(sum, 100), 227)
|
57
|
+
t.equal(y.reduceReverse(sum), 127)
|
58
|
+
t.equal(y.reduceReverse(sum, 100), 227)
|
59
|
+
|
60
|
+
t.equal(Yallist().pop(), undefined)
|
61
|
+
t.equal(Yallist().shift(), undefined)
|
62
|
+
|
63
|
+
var x = Yallist()
|
64
|
+
x.unshift(1)
|
65
|
+
t.equal(x.length, 1)
|
66
|
+
t.similar(x.toArray(), [1])
|
67
|
+
|
68
|
+
// verify that y.toArray() returns an array and if we create a
|
69
|
+
// new Yallist from that array, we get a list matching
|
70
|
+
t.similar(Yallist(y.toArray()), y)
|
71
|
+
t.similar(Yallist.apply(null, y.toArray()), y)
|
72
|
+
|
73
|
+
t.throws(function () {
|
74
|
+
new Yallist().reduce(function () {})
|
75
|
+
}, {}, new TypeError('Reduce of empty list with no initial value'))
|
76
|
+
t.throws(function () {
|
77
|
+
new Yallist().reduceReverse(function () {})
|
78
|
+
}, {}, new TypeError('Reduce of empty list with no initial value'))
|
79
|
+
|
80
|
+
var z = y.reverse()
|
81
|
+
t.equal(z, y)
|
82
|
+
t.similar(y.toArray(), expectReverse)
|
83
|
+
y.reverse()
|
84
|
+
t.similar(y.toArray(), expect)
|
85
|
+
|
86
|
+
var a = Yallist(1,2,3,4,5,6)
|
87
|
+
var cases = [
|
88
|
+
[ [2, 4], [3, 4] ],
|
89
|
+
[ [2, -4], [] ],
|
90
|
+
[ [2, -2], [3, 4] ],
|
91
|
+
[ [1, -2], [2, 3, 4] ],
|
92
|
+
[ [-1, -2], [] ],
|
93
|
+
[ [-5, -2], [2, 3, 4] ],
|
94
|
+
[ [-99, 2], [1, 2] ],
|
95
|
+
[ [5, 99], [6] ],
|
96
|
+
[ [], [1,2,3,4,5,6] ]
|
97
|
+
]
|
98
|
+
t.test('slice', function (t) {
|
99
|
+
t.plan(cases.length)
|
100
|
+
cases.forEach(function (c) {
|
101
|
+
t.test(JSON.stringify(c), function (t) {
|
102
|
+
t.similar(a.slice.apply(a, c[0]), Yallist(c[1]))
|
103
|
+
t.similar([].slice.apply(a.toArray(), c[0]), c[1])
|
104
|
+
t.end()
|
105
|
+
})
|
106
|
+
})
|
107
|
+
})
|
108
|
+
|
109
|
+
t.test('sliceReverse', function (t) {
|
110
|
+
t.plan(cases.length)
|
111
|
+
cases.forEach(function (c) {
|
112
|
+
var rev = c[1].slice().reverse()
|
113
|
+
t.test(JSON.stringify([c[0], rev]), function (t) {
|
114
|
+
t.similar(a.sliceReverse.apply(a, c[0]), Yallist(rev))
|
115
|
+
t.similar([].slice.apply(a.toArray(), c[0]).reverse(), rev)
|
116
|
+
t.end()
|
117
|
+
})
|
118
|
+
})
|
119
|
+
})
|
120
|
+
|
121
|
+
var inserter = Yallist(1,2,3,4,5)
|
122
|
+
inserter.unshiftNode(inserter.head.next)
|
123
|
+
t.similar(inserter.toArray(), [2,1,3,4,5])
|
124
|
+
inserter.unshiftNode(inserter.tail)
|
125
|
+
t.similar(inserter.toArray(), [5,2,1,3,4])
|
126
|
+
inserter.unshiftNode(inserter.head)
|
127
|
+
t.similar(inserter.toArray(), [5,2,1,3,4])
|
128
|
+
|
129
|
+
var single = Yallist(1)
|
130
|
+
single.unshiftNode(single.head)
|
131
|
+
t.similar(single.toArray(), [1])
|
132
|
+
|
133
|
+
inserter = Yallist(1,2,3,4,5)
|
134
|
+
inserter.pushNode(inserter.tail.prev)
|
135
|
+
t.similar(inserter.toArray(), [1,2,3,5,4])
|
136
|
+
inserter.pushNode(inserter.head)
|
137
|
+
t.similar(inserter.toArray(), [2,3,5,4,1])
|
138
|
+
inserter.unshiftNode(inserter.head)
|
139
|
+
t.similar(inserter.toArray(), [2,3,5,4,1])
|
140
|
+
|
141
|
+
single = Yallist(1)
|
142
|
+
single.pushNode(single.tail)
|
143
|
+
t.similar(single.toArray(), [1])
|
144
|
+
|
145
|
+
var swiped = Yallist(9,8,7)
|
146
|
+
inserter.unshiftNode(swiped.head.next)
|
147
|
+
t.similar(inserter.toArray(), [8,2,3,5,4,1])
|
148
|
+
t.similar(swiped.toArray(), [9,7])
|
149
|
+
|
150
|
+
swiped = Yallist(9,8,7)
|
151
|
+
inserter.pushNode(swiped.head.next)
|
152
|
+
t.similar(inserter.toArray(), [8,2,3,5,4,1,8])
|
153
|
+
t.similar(swiped.toArray(), [9,7])
|
154
|
+
|
155
|
+
swiped.unshiftNode(Yallist.Node(99))
|
156
|
+
t.similar(swiped.toArray(), [99,9,7])
|
157
|
+
swiped.pushNode(Yallist.Node(66))
|
158
|
+
t.similar(swiped.toArray(), [99,9,7,66])
|
159
|
+
|
160
|
+
var e = Yallist()
|
161
|
+
e.unshiftNode(Yallist.Node(1))
|
162
|
+
t.same(e.toArray(), [1])
|
163
|
+
e = Yallist()
|
164
|
+
e.pushNode(Yallist.Node(1))
|
165
|
+
t.same(e.toArray(), [1])
|
166
|
+
|
167
|
+
// steal them back, don't break the lists
|
168
|
+
swiped.unshiftNode(inserter.head)
|
169
|
+
t.same(swiped, Yallist(8,99,9,7,66))
|
170
|
+
t.same(inserter, Yallist(2,3,5,4,1,8))
|
171
|
+
swiped.unshiftNode(inserter.tail)
|
172
|
+
t.same(inserter, Yallist(2,3,5,4,1))
|
173
|
+
t.same(swiped, Yallist(8,8,99,9,7,66))
|
174
|
+
|
175
|
+
|
176
|
+
t.throws(function remove_foreign_node () {
|
177
|
+
e.removeNode(swiped.head)
|
178
|
+
}, {}, new Error('removing node which does not belong to this list'))
|
179
|
+
t.throws(function remove_unlisted_node () {
|
180
|
+
e.removeNode(Yallist.Node('nope'))
|
181
|
+
}, {}, new Error('removing node which does not belong to this list'))
|
182
|
+
|
183
|
+
e = Yallist(1,2)
|
184
|
+
e.removeNode(e.head)
|
185
|
+
t.same(e, Yallist(2))
|
186
|
+
e = Yallist(1,2)
|
187
|
+
e.removeNode(e.tail)
|
188
|
+
t.same(e, Yallist(1))
|
@@ -0,0 +1,360 @@
|
|
1
|
+
module.exports = Yallist
|
2
|
+
|
3
|
+
Yallist.Node = Node
|
4
|
+
Yallist.create = Yallist
|
5
|
+
|
6
|
+
function Yallist (list) {
|
7
|
+
var self = this
|
8
|
+
if (!(self instanceof Yallist)) {
|
9
|
+
self = new Yallist()
|
10
|
+
}
|
11
|
+
|
12
|
+
self.tail = null
|
13
|
+
self.head = null
|
14
|
+
self.length = 0
|
15
|
+
|
16
|
+
if (list && typeof list.forEach === 'function') {
|
17
|
+
list.forEach(function (item) {
|
18
|
+
self.push(item)
|
19
|
+
})
|
20
|
+
} else if (arguments.length > 0) {
|
21
|
+
for (var i = 0, l = arguments.length; i < l; i++) {
|
22
|
+
self.push(arguments[i])
|
23
|
+
}
|
24
|
+
}
|
25
|
+
|
26
|
+
return self
|
27
|
+
}
|
28
|
+
|
29
|
+
Yallist.prototype.removeNode = function (node) {
|
30
|
+
if (node.list !== this) {
|
31
|
+
throw new Error('removing node which does not belong to this list')
|
32
|
+
}
|
33
|
+
|
34
|
+
var next = node.next
|
35
|
+
var prev = node.prev
|
36
|
+
|
37
|
+
if (next) {
|
38
|
+
next.prev = prev
|
39
|
+
}
|
40
|
+
|
41
|
+
if (prev) {
|
42
|
+
prev.next = next
|
43
|
+
}
|
44
|
+
|
45
|
+
if (node === this.head) {
|
46
|
+
this.head = next
|
47
|
+
}
|
48
|
+
if (node === this.tail) {
|
49
|
+
this.tail = prev
|
50
|
+
}
|
51
|
+
|
52
|
+
node.list.length --
|
53
|
+
node.next = null
|
54
|
+
node.prev = null
|
55
|
+
node.list = null
|
56
|
+
}
|
57
|
+
|
58
|
+
Yallist.prototype.unshiftNode = function (node) {
|
59
|
+
if (node === this.head) {
|
60
|
+
return
|
61
|
+
}
|
62
|
+
|
63
|
+
if (node.list) {
|
64
|
+
node.list.removeNode(node)
|
65
|
+
}
|
66
|
+
|
67
|
+
var head = this.head
|
68
|
+
node.list = this
|
69
|
+
node.next = head
|
70
|
+
if (head) {
|
71
|
+
head.prev = node
|
72
|
+
}
|
73
|
+
|
74
|
+
this.head = node
|
75
|
+
if (!this.tail) {
|
76
|
+
this.tail = node
|
77
|
+
}
|
78
|
+
this.length ++
|
79
|
+
}
|
80
|
+
|
81
|
+
Yallist.prototype.pushNode = function (node) {
|
82
|
+
if (node === this.tail) {
|
83
|
+
return
|
84
|
+
}
|
85
|
+
|
86
|
+
if (node.list) {
|
87
|
+
node.list.removeNode(node)
|
88
|
+
}
|
89
|
+
|
90
|
+
var tail = this.tail
|
91
|
+
node.list = this
|
92
|
+
node.prev = tail
|
93
|
+
if (tail) {
|
94
|
+
tail.next = node
|
95
|
+
}
|
96
|
+
|
97
|
+
this.tail = node
|
98
|
+
if (!this.head) {
|
99
|
+
this.head = node
|
100
|
+
}
|
101
|
+
this.length ++
|
102
|
+
}
|
103
|
+
|
104
|
+
Yallist.prototype.push = function () {
|
105
|
+
for (var i = 0, l = arguments.length; i < l; i++) {
|
106
|
+
push(this, arguments[i])
|
107
|
+
}
|
108
|
+
return this.length
|
109
|
+
}
|
110
|
+
|
111
|
+
Yallist.prototype.unshift = function () {
|
112
|
+
for (var i = 0, l = arguments.length; i < l; i++) {
|
113
|
+
unshift(this, arguments[i])
|
114
|
+
}
|
115
|
+
return this.length
|
116
|
+
}
|
117
|
+
|
118
|
+
Yallist.prototype.pop = function () {
|
119
|
+
if (!this.tail)
|
120
|
+
return undefined
|
121
|
+
|
122
|
+
var res = this.tail.value
|
123
|
+
this.tail = this.tail.prev
|
124
|
+
this.tail.next = null
|
125
|
+
this.length --
|
126
|
+
return res
|
127
|
+
}
|
128
|
+
|
129
|
+
Yallist.prototype.shift = function () {
|
130
|
+
if (!this.head)
|
131
|
+
return undefined
|
132
|
+
|
133
|
+
var res = this.head.value
|
134
|
+
this.head = this.head.next
|
135
|
+
this.head.prev = null
|
136
|
+
this.length --
|
137
|
+
return res
|
138
|
+
}
|
139
|
+
|
140
|
+
Yallist.prototype.forEach = function (fn, thisp) {
|
141
|
+
thisp = thisp || this
|
142
|
+
for (var walker = this.head, i = 0; walker !== null; i++) {
|
143
|
+
fn.call(thisp, walker.value, i, this)
|
144
|
+
walker = walker.next
|
145
|
+
}
|
146
|
+
}
|
147
|
+
|
148
|
+
Yallist.prototype.forEachReverse = function (fn, thisp) {
|
149
|
+
thisp = thisp || this
|
150
|
+
for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {
|
151
|
+
fn.call(thisp, walker.value, i, this)
|
152
|
+
walker = walker.prev
|
153
|
+
}
|
154
|
+
}
|
155
|
+
|
156
|
+
Yallist.prototype.get = function (n) {
|
157
|
+
for (var i = 0, walker = this.head; walker !== null && i < n; i++) {
|
158
|
+
// abort out of the list early if we hit a cycle
|
159
|
+
walker = walker.next
|
160
|
+
}
|
161
|
+
if (i === n && walker !== null) {
|
162
|
+
return walker.value
|
163
|
+
}
|
164
|
+
}
|
165
|
+
|
166
|
+
Yallist.prototype.getReverse = function (n) {
|
167
|
+
for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {
|
168
|
+
// abort out of the list early if we hit a cycle
|
169
|
+
walker = walker.prev
|
170
|
+
}
|
171
|
+
if (i === n && walker !== null) {
|
172
|
+
return walker.value
|
173
|
+
}
|
174
|
+
}
|
175
|
+
|
176
|
+
Yallist.prototype.map = function (fn, thisp) {
|
177
|
+
thisp = thisp || this
|
178
|
+
var res = new Yallist()
|
179
|
+
for (var walker = this.head; walker !== null; ) {
|
180
|
+
res.push(fn.call(thisp, walker.value, this))
|
181
|
+
walker = walker.next
|
182
|
+
}
|
183
|
+
return res
|
184
|
+
}
|
185
|
+
|
186
|
+
Yallist.prototype.mapReverse = function (fn, thisp) {
|
187
|
+
thisp = thisp || this
|
188
|
+
var res = new Yallist()
|
189
|
+
for (var walker = this.tail; walker !== null;) {
|
190
|
+
res.push(fn.call(thisp, walker.value, this))
|
191
|
+
walker = walker.prev
|
192
|
+
}
|
193
|
+
return res
|
194
|
+
}
|
195
|
+
|
196
|
+
Yallist.prototype.reduce = function (fn, initial) {
|
197
|
+
var acc
|
198
|
+
var walker = this.head
|
199
|
+
if (arguments.length > 1) {
|
200
|
+
acc = initial
|
201
|
+
} else if (this.head) {
|
202
|
+
walker = this.head.next
|
203
|
+
acc = this.head.value
|
204
|
+
} else {
|
205
|
+
throw new TypeError('Reduce of empty list with no initial value')
|
206
|
+
}
|
207
|
+
|
208
|
+
for (var i = 0; walker !== null; i++) {
|
209
|
+
acc = fn(acc, walker.value, i)
|
210
|
+
walker = walker.next
|
211
|
+
}
|
212
|
+
|
213
|
+
return acc
|
214
|
+
}
|
215
|
+
|
216
|
+
Yallist.prototype.reduceReverse = function (fn, initial) {
|
217
|
+
var acc
|
218
|
+
var walker = this.tail
|
219
|
+
if (arguments.length > 1) {
|
220
|
+
acc = initial
|
221
|
+
} else if (this.tail) {
|
222
|
+
walker = this.tail.prev
|
223
|
+
acc = this.tail.value
|
224
|
+
} else {
|
225
|
+
throw new TypeError('Reduce of empty list with no initial value')
|
226
|
+
}
|
227
|
+
|
228
|
+
for (var i = this.length - 1; walker !== null; i--) {
|
229
|
+
acc = fn(acc, walker.value, i)
|
230
|
+
walker = walker.prev
|
231
|
+
}
|
232
|
+
|
233
|
+
return acc
|
234
|
+
}
|
235
|
+
|
236
|
+
Yallist.prototype.toArray = function () {
|
237
|
+
var arr = new Array(this.length)
|
238
|
+
for (var i = 0, walker = this.head; walker !== null; i++) {
|
239
|
+
arr[i] = walker.value
|
240
|
+
walker = walker.next
|
241
|
+
}
|
242
|
+
return arr
|
243
|
+
}
|
244
|
+
|
245
|
+
Yallist.prototype.toArrayReverse = function () {
|
246
|
+
var arr = new Array(this.length)
|
247
|
+
for (var i = 0, walker = this.tail; walker !== null; i++) {
|
248
|
+
arr[i] = walker.value
|
249
|
+
walker = walker.prev
|
250
|
+
}
|
251
|
+
return arr
|
252
|
+
}
|
253
|
+
|
254
|
+
Yallist.prototype.slice = function (from, to) {
|
255
|
+
to = to || this.length
|
256
|
+
if (to < 0) {
|
257
|
+
to += this.length
|
258
|
+
}
|
259
|
+
from = from || 0
|
260
|
+
if (from < 0) {
|
261
|
+
from += this.length
|
262
|
+
}
|
263
|
+
var ret = new Yallist()
|
264
|
+
if (to < from || to < 0) {
|
265
|
+
return ret
|
266
|
+
}
|
267
|
+
if (from < 0) {
|
268
|
+
from = 0
|
269
|
+
}
|
270
|
+
if (to > this.length) {
|
271
|
+
to = this.length
|
272
|
+
}
|
273
|
+
for (var i = 0, walker = this.head; walker !== null && i < from; i++) {
|
274
|
+
walker = walker.next
|
275
|
+
}
|
276
|
+
for (; walker !== null && i < to; i++, walker = walker.next) {
|
277
|
+
ret.push(walker.value)
|
278
|
+
}
|
279
|
+
return ret
|
280
|
+
}
|
281
|
+
|
282
|
+
Yallist.prototype.sliceReverse = function (from, to) {
|
283
|
+
to = to || this.length
|
284
|
+
if (to < 0) {
|
285
|
+
to += this.length
|
286
|
+
}
|
287
|
+
from = from || 0
|
288
|
+
if (from < 0) {
|
289
|
+
from += this.length
|
290
|
+
}
|
291
|
+
var ret = new Yallist()
|
292
|
+
if (to < from || to < 0) {
|
293
|
+
return ret
|
294
|
+
}
|
295
|
+
if (from < 0) {
|
296
|
+
from = 0
|
297
|
+
}
|
298
|
+
if (to > this.length) {
|
299
|
+
to = this.length
|
300
|
+
}
|
301
|
+
for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {
|
302
|
+
walker = walker.prev
|
303
|
+
}
|
304
|
+
for (; walker !== null && i > from; i--, walker = walker.prev) {
|
305
|
+
ret.push(walker.value)
|
306
|
+
}
|
307
|
+
return ret
|
308
|
+
}
|
309
|
+
|
310
|
+
Yallist.prototype.reverse = function () {
|
311
|
+
var head = this.head
|
312
|
+
var tail = this.tail
|
313
|
+
for (var walker = head; walker !== null; walker = walker.prev) {
|
314
|
+
var p = walker.prev
|
315
|
+
walker.prev = walker.next
|
316
|
+
walker.next = p
|
317
|
+
}
|
318
|
+
this.head = tail
|
319
|
+
this.tail = head
|
320
|
+
return this
|
321
|
+
}
|
322
|
+
|
323
|
+
function push (self, item) {
|
324
|
+
self.tail = new Node(item, self.tail, null, self)
|
325
|
+
if (!self.head) {
|
326
|
+
self.head = self.tail
|
327
|
+
}
|
328
|
+
self.length ++
|
329
|
+
}
|
330
|
+
|
331
|
+
function unshift (self, item) {
|
332
|
+
self.head = new Node(item, null, self.head, self)
|
333
|
+
if (!self.tail) {
|
334
|
+
self.tail = self.head
|
335
|
+
}
|
336
|
+
self.length ++
|
337
|
+
}
|
338
|
+
|
339
|
+
function Node (value, prev, next, list) {
|
340
|
+
if (!(this instanceof Node)) {
|
341
|
+
return new Node(value, prev, next, list)
|
342
|
+
}
|
343
|
+
|
344
|
+
this.list = list
|
345
|
+
this.value = value
|
346
|
+
|
347
|
+
if (prev) {
|
348
|
+
prev.next = this
|
349
|
+
this.prev = prev
|
350
|
+
} else {
|
351
|
+
this.prev = null
|
352
|
+
}
|
353
|
+
|
354
|
+
if (next) {
|
355
|
+
next.prev = this
|
356
|
+
this.next = next
|
357
|
+
} else {
|
358
|
+
this.next = null
|
359
|
+
}
|
360
|
+
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
|
-
"_from": "lru-cache@^
|
3
|
-
"_id": "lru-cache@
|
2
|
+
"_from": "lru-cache@^4.0.0",
|
3
|
+
"_id": "lru-cache@4.0.0",
|
4
4
|
"_location": "/aws4/lru-cache",
|
5
5
|
"_nodeVersion": "4.0.0",
|
6
6
|
"_npmUser": {
|
@@ -12,8 +12,8 @@
|
|
12
12
|
"_requiredBy": [
|
13
13
|
"/aws4"
|
14
14
|
],
|
15
|
-
"_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-
|
16
|
-
"_shasum": "
|
15
|
+
"_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.0.0.tgz",
|
16
|
+
"_shasum": "b5cbf01556c16966febe54ceec0fb4dc90df6c28",
|
17
17
|
"_shrinkwrap": null,
|
18
18
|
"author": {
|
19
19
|
"email": "i@izs.me",
|
@@ -22,18 +22,21 @@
|
|
22
22
|
"bugs": {
|
23
23
|
"url": "https://github.com/isaacs/node-lru-cache/issues"
|
24
24
|
},
|
25
|
-
"dependencies": {
|
25
|
+
"dependencies": {
|
26
|
+
"pseudomap": "^1.0.1",
|
27
|
+
"yallist": "^2.0.0"
|
28
|
+
},
|
26
29
|
"description": "A cache object that deletes the least-recently-used items.",
|
27
30
|
"devDependencies": {
|
28
|
-
"
|
29
|
-
"
|
31
|
+
"standard": "^5.4.1",
|
32
|
+
"tap": "^2.3.3"
|
30
33
|
},
|
31
34
|
"directories": {},
|
32
35
|
"dist": {
|
33
|
-
"shasum": "
|
34
|
-
"tarball": "http://registry.npmjs.org/lru-cache/-/lru-cache-
|
36
|
+
"shasum": "b5cbf01556c16966febe54ceec0fb4dc90df6c28",
|
37
|
+
"tarball": "http://registry.npmjs.org/lru-cache/-/lru-cache-4.0.0.tgz"
|
35
38
|
},
|
36
|
-
"gitHead": "
|
39
|
+
"gitHead": "da374d4776aaef443765b43cb3617e09c170a5d5",
|
37
40
|
"homepage": "https://github.com/isaacs/node-lru-cache#readme",
|
38
41
|
"keywords": [
|
39
42
|
"cache",
|
@@ -60,7 +63,8 @@
|
|
60
63
|
"url": "git://github.com/isaacs/node-lru-cache.git"
|
61
64
|
},
|
62
65
|
"scripts": {
|
63
|
-
"
|
66
|
+
"posttest": "standard test/*.js lib/*.js",
|
67
|
+
"test": "tap test --cov"
|
64
68
|
},
|
65
|
-
"version": "
|
69
|
+
"version": "4.0.0"
|
66
70
|
}
|