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,151 @@
|
|
1
|
+
module.exports = {
|
2
|
+
aliceblue: [240, 248, 255],
|
3
|
+
antiquewhite: [250, 235, 215],
|
4
|
+
aqua: [0, 255, 255],
|
5
|
+
aquamarine: [127, 255, 212],
|
6
|
+
azure: [240, 255, 255],
|
7
|
+
beige: [245, 245, 220],
|
8
|
+
bisque: [255, 228, 196],
|
9
|
+
black: [0, 0, 0],
|
10
|
+
blanchedalmond: [255, 235, 205],
|
11
|
+
blue: [0, 0, 255],
|
12
|
+
blueviolet: [138, 43, 226],
|
13
|
+
brown: [165, 42, 42],
|
14
|
+
burlywood: [222, 184, 135],
|
15
|
+
cadetblue: [95, 158, 160],
|
16
|
+
chartreuse: [127, 255, 0],
|
17
|
+
chocolate: [210, 105, 30],
|
18
|
+
coral: [255, 127, 80],
|
19
|
+
cornflowerblue: [100, 149, 237],
|
20
|
+
cornsilk: [255, 248, 220],
|
21
|
+
crimson: [220, 20, 60],
|
22
|
+
cyan: [0, 255, 255],
|
23
|
+
darkblue: [0, 0, 139],
|
24
|
+
darkcyan: [0, 139, 139],
|
25
|
+
darkgoldenrod: [184, 134, 11],
|
26
|
+
darkgray: [169, 169, 169],
|
27
|
+
darkgreen: [0, 100, 0],
|
28
|
+
darkgrey: [169, 169, 169],
|
29
|
+
darkkhaki: [189, 183, 107],
|
30
|
+
darkmagenta: [139, 0, 139],
|
31
|
+
darkolivegreen: [85, 107, 47],
|
32
|
+
darkorange: [255, 140, 0],
|
33
|
+
darkorchid: [153, 50, 204],
|
34
|
+
darkred: [139, 0, 0],
|
35
|
+
darksalmon: [233, 150, 122],
|
36
|
+
darkseagreen: [143, 188, 143],
|
37
|
+
darkslateblue: [72, 61, 139],
|
38
|
+
darkslategray: [47, 79, 79],
|
39
|
+
darkslategrey: [47, 79, 79],
|
40
|
+
darkturquoise: [0, 206, 209],
|
41
|
+
darkviolet: [148, 0, 211],
|
42
|
+
deeppink: [255, 20, 147],
|
43
|
+
deepskyblue: [0, 191, 255],
|
44
|
+
dimgray: [105, 105, 105],
|
45
|
+
dimgrey: [105, 105, 105],
|
46
|
+
dodgerblue: [30, 144, 255],
|
47
|
+
firebrick: [178, 34, 34],
|
48
|
+
floralwhite: [255, 250, 240],
|
49
|
+
forestgreen: [34, 139, 34],
|
50
|
+
fuchsia: [255, 0, 255],
|
51
|
+
gainsboro: [220, 220, 220],
|
52
|
+
ghostwhite: [248, 248, 255],
|
53
|
+
gold: [255, 215, 0],
|
54
|
+
goldenrod: [218, 165, 32],
|
55
|
+
gray: [128, 128, 128],
|
56
|
+
green: [0, 128, 0],
|
57
|
+
greenyellow: [173, 255, 47],
|
58
|
+
grey: [128, 128, 128],
|
59
|
+
honeydew: [240, 255, 240],
|
60
|
+
hotpink: [255, 105, 180],
|
61
|
+
indianred: [205, 92, 92],
|
62
|
+
indigo: [75, 0, 130],
|
63
|
+
ivory: [255, 255, 240],
|
64
|
+
khaki: [240, 230, 140],
|
65
|
+
lavender: [230, 230, 250],
|
66
|
+
lavenderblush: [255, 240, 245],
|
67
|
+
lawngreen: [124, 252, 0],
|
68
|
+
lemonchiffon: [255, 250, 205],
|
69
|
+
lightblue: [173, 216, 230],
|
70
|
+
lightcoral: [240, 128, 128],
|
71
|
+
lightcyan: [224, 255, 255],
|
72
|
+
lightgoldenrodyellow: [250, 250, 210],
|
73
|
+
lightgray: [211, 211, 211],
|
74
|
+
lightgreen: [144, 238, 144],
|
75
|
+
lightgrey: [211, 211, 211],
|
76
|
+
lightpink: [255, 182, 193],
|
77
|
+
lightsalmon: [255, 160, 122],
|
78
|
+
lightseagreen: [32, 178, 170],
|
79
|
+
lightskyblue: [135, 206, 250],
|
80
|
+
lightslategray: [119, 136, 153],
|
81
|
+
lightslategrey: [119, 136, 153],
|
82
|
+
lightsteelblue: [176, 196, 222],
|
83
|
+
lightyellow: [255, 255, 224],
|
84
|
+
lime: [0, 255, 0],
|
85
|
+
limegreen: [50, 205, 50],
|
86
|
+
linen: [250, 240, 230],
|
87
|
+
magenta: [255, 0, 255],
|
88
|
+
maroon: [128, 0, 0],
|
89
|
+
mediumaquamarine: [102, 205, 170],
|
90
|
+
mediumblue: [0, 0, 205],
|
91
|
+
mediumorchid: [186, 85, 211],
|
92
|
+
mediumpurple: [147, 112, 219],
|
93
|
+
mediumseagreen: [60, 179, 113],
|
94
|
+
mediumslateblue: [123, 104, 238],
|
95
|
+
mediumspringgreen: [0, 250, 154],
|
96
|
+
mediumturquoise: [72, 209, 204],
|
97
|
+
mediumvioletred: [199, 21, 133],
|
98
|
+
midnightblue: [25, 25, 112],
|
99
|
+
mintcream: [245, 255, 250],
|
100
|
+
mistyrose: [255, 228, 225],
|
101
|
+
moccasin: [255, 228, 181],
|
102
|
+
navajowhite: [255, 222, 173],
|
103
|
+
navy: [0, 0, 128],
|
104
|
+
oldlace: [253, 245, 230],
|
105
|
+
olive: [128, 128, 0],
|
106
|
+
olivedrab: [107, 142, 35],
|
107
|
+
orange: [255, 165, 0],
|
108
|
+
orangered: [255, 69, 0],
|
109
|
+
orchid: [218, 112, 214],
|
110
|
+
palegoldenrod: [238, 232, 170],
|
111
|
+
palegreen: [152, 251, 152],
|
112
|
+
paleturquoise: [175, 238, 238],
|
113
|
+
palevioletred: [219, 112, 147],
|
114
|
+
papayawhip: [255, 239, 213],
|
115
|
+
peachpuff: [255, 218, 185],
|
116
|
+
peru: [205, 133, 63],
|
117
|
+
pink: [255, 192, 203],
|
118
|
+
plum: [221, 160, 221],
|
119
|
+
powderblue: [176, 224, 230],
|
120
|
+
purple: [128, 0, 128],
|
121
|
+
rebeccapurple: [102, 51, 153],
|
122
|
+
red: [255, 0, 0],
|
123
|
+
rosybrown: [188, 143, 143],
|
124
|
+
royalblue: [65, 105, 225],
|
125
|
+
saddlebrown: [139, 69, 19],
|
126
|
+
salmon: [250, 128, 114],
|
127
|
+
sandybrown: [244, 164, 96],
|
128
|
+
seagreen: [46, 139, 87],
|
129
|
+
seashell: [255, 245, 238],
|
130
|
+
sienna: [160, 82, 45],
|
131
|
+
silver: [192, 192, 192],
|
132
|
+
skyblue: [135, 206, 235],
|
133
|
+
slateblue: [106, 90, 205],
|
134
|
+
slategray: [112, 128, 144],
|
135
|
+
slategrey: [112, 128, 144],
|
136
|
+
snow: [255, 250, 250],
|
137
|
+
springgreen: [0, 255, 127],
|
138
|
+
steelblue: [70, 130, 180],
|
139
|
+
tan: [210, 180, 140],
|
140
|
+
teal: [0, 128, 128],
|
141
|
+
thistle: [216, 191, 216],
|
142
|
+
tomato: [255, 99, 71],
|
143
|
+
turquoise: [64, 224, 208],
|
144
|
+
violet: [238, 130, 238],
|
145
|
+
wheat: [245, 222, 179],
|
146
|
+
white: [255, 255, 255],
|
147
|
+
whitesmoke: [245, 245, 245],
|
148
|
+
yellow: [255, 255, 0],
|
149
|
+
yellowgreen: [154, 205, 50]
|
150
|
+
};
|
151
|
+
|
@@ -0,0 +1,75 @@
|
|
1
|
+
var conversions = require('./conversions');
|
2
|
+
var route = require('./route');
|
3
|
+
|
4
|
+
var convert = {};
|
5
|
+
|
6
|
+
var models = Object.keys(conversions);
|
7
|
+
|
8
|
+
function wrapRaw(fn) {
|
9
|
+
var wrappedFn = function (args) {
|
10
|
+
if (args === undefined || args === null) {
|
11
|
+
return args;
|
12
|
+
}
|
13
|
+
|
14
|
+
if (arguments.length > 1) {
|
15
|
+
args = Array.prototype.slice.call(arguments);
|
16
|
+
}
|
17
|
+
|
18
|
+
return fn(args);
|
19
|
+
};
|
20
|
+
|
21
|
+
// preserve .conversion property if there is one
|
22
|
+
if ('conversion' in fn) {
|
23
|
+
wrappedFn.conversion = fn.conversion;
|
24
|
+
}
|
25
|
+
|
26
|
+
return wrappedFn;
|
27
|
+
}
|
28
|
+
|
29
|
+
function wrapRounded(fn) {
|
30
|
+
var wrappedFn = function (args) {
|
31
|
+
if (args === undefined || args === null) {
|
32
|
+
return args;
|
33
|
+
}
|
34
|
+
|
35
|
+
if (arguments.length > 1) {
|
36
|
+
args = Array.prototype.slice.call(arguments);
|
37
|
+
}
|
38
|
+
|
39
|
+
var result = fn(args);
|
40
|
+
|
41
|
+
// we're assuming the result is an array here.
|
42
|
+
// see notice in conversions.js; don't use box types
|
43
|
+
// in conversion functions.
|
44
|
+
if (typeof result === 'object') {
|
45
|
+
for (var len = result.length, i = 0; i < len; i++) {
|
46
|
+
result[i] = Math.round(result[i]);
|
47
|
+
}
|
48
|
+
}
|
49
|
+
|
50
|
+
return result;
|
51
|
+
};
|
52
|
+
|
53
|
+
// preserve .conversion property if there is one
|
54
|
+
if ('conversion' in fn) {
|
55
|
+
wrappedFn.conversion = fn.conversion;
|
56
|
+
}
|
57
|
+
|
58
|
+
return wrappedFn;
|
59
|
+
}
|
60
|
+
|
61
|
+
models.forEach(function (fromModel) {
|
62
|
+
convert[fromModel] = {};
|
63
|
+
|
64
|
+
var routes = route(fromModel);
|
65
|
+
var routeModels = Object.keys(routes);
|
66
|
+
|
67
|
+
routeModels.forEach(function (toModel) {
|
68
|
+
var fn = routes[toModel];
|
69
|
+
|
70
|
+
convert[fromModel][toModel] = wrapRounded(fn);
|
71
|
+
convert[fromModel][toModel].raw = wrapRaw(fn);
|
72
|
+
});
|
73
|
+
});
|
74
|
+
|
75
|
+
module.exports = convert;
|
@@ -0,0 +1,92 @@
|
|
1
|
+
{
|
2
|
+
"_from": "color-convert@^1.0.0",
|
3
|
+
"_id": "color-convert@1.0.0",
|
4
|
+
"_location": "/color-convert",
|
5
|
+
"_nodeVersion": "4.1.1",
|
6
|
+
"_npmUser": {
|
7
|
+
"email": "i.am.qix@gmail.com",
|
8
|
+
"name": "qix"
|
9
|
+
},
|
10
|
+
"_npmVersion": "3.3.6",
|
11
|
+
"_phantomChildren": {},
|
12
|
+
"_requiredBy": [
|
13
|
+
"/ansi-styles"
|
14
|
+
],
|
15
|
+
"_resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.0.0.tgz",
|
16
|
+
"_shasum": "3c26fcd885d272d45beacf6e41baba75c89a8579",
|
17
|
+
"_shrinkwrap": null,
|
18
|
+
"author": {
|
19
|
+
"email": "fayearthur@gmail.com",
|
20
|
+
"name": "Heather Arthur"
|
21
|
+
},
|
22
|
+
"bugs": {
|
23
|
+
"url": "https://github.com/qix-/color-convert/issues"
|
24
|
+
},
|
25
|
+
"dependencies": {},
|
26
|
+
"description": "Plain color conversion functions",
|
27
|
+
"devDependencies": {
|
28
|
+
"chalk": "^1.1.1",
|
29
|
+
"xo": "^0.11.2"
|
30
|
+
},
|
31
|
+
"directories": {},
|
32
|
+
"dist": {
|
33
|
+
"shasum": "3c26fcd885d272d45beacf6e41baba75c89a8579",
|
34
|
+
"tarball": "http://registry.npmjs.org/color-convert/-/color-convert-1.0.0.tgz"
|
35
|
+
},
|
36
|
+
"files": [
|
37
|
+
"conversions.js",
|
38
|
+
"css-keywords.js",
|
39
|
+
"index.js",
|
40
|
+
"route.js"
|
41
|
+
],
|
42
|
+
"gitHead": "31cd56dc3d34ae332cc83d90bd4f925baf5bd982",
|
43
|
+
"homepage": "https://github.com/qix-/color-convert#readme",
|
44
|
+
"keywords": [
|
45
|
+
"ansi",
|
46
|
+
"ansi16",
|
47
|
+
"cmyk",
|
48
|
+
"color",
|
49
|
+
"colour",
|
50
|
+
"conversion",
|
51
|
+
"convert",
|
52
|
+
"converter",
|
53
|
+
"hsl",
|
54
|
+
"hsv",
|
55
|
+
"hwb",
|
56
|
+
"rgb"
|
57
|
+
],
|
58
|
+
"license": "MIT",
|
59
|
+
"maintainers": [
|
60
|
+
{
|
61
|
+
"name": "harth",
|
62
|
+
"email": "fayearthur@gmail.com"
|
63
|
+
},
|
64
|
+
{
|
65
|
+
"name": "moox",
|
66
|
+
"email": "m@moox.io"
|
67
|
+
},
|
68
|
+
{
|
69
|
+
"name": "qix",
|
70
|
+
"email": "i.am.qix@gmail.com"
|
71
|
+
}
|
72
|
+
],
|
73
|
+
"name": "color-convert",
|
74
|
+
"optionalDependencies": {},
|
75
|
+
"readme": "ERROR: No README data found!",
|
76
|
+
"repository": {
|
77
|
+
"type": "git",
|
78
|
+
"url": "git+https://github.com/qix-/color-convert.git"
|
79
|
+
},
|
80
|
+
"scripts": {
|
81
|
+
"pretest": "xo",
|
82
|
+
"test": "node test/basic.js"
|
83
|
+
},
|
84
|
+
"version": "1.0.0",
|
85
|
+
"xo": {
|
86
|
+
"rules": {
|
87
|
+
"default-case": 0,
|
88
|
+
"no-inline-comments": 0,
|
89
|
+
"operator-linebreak": 0
|
90
|
+
}
|
91
|
+
}
|
92
|
+
}
|
@@ -0,0 +1,98 @@
|
|
1
|
+
var conversions = require('./conversions');
|
2
|
+
|
3
|
+
/*
|
4
|
+
this function routes a model to all other models.
|
5
|
+
|
6
|
+
all functions that are routed have a property `.conversion` attached
|
7
|
+
to the returned synthetic function. This property is an array
|
8
|
+
of strings, each with the steps in between the 'from' and 'to'
|
9
|
+
color models (inclusive).
|
10
|
+
|
11
|
+
conversions that are not possible simply are not included.
|
12
|
+
*/
|
13
|
+
|
14
|
+
// https://jsperf.com/object-keys-vs-for-in-with-closure/3
|
15
|
+
var models = Object.keys(conversions);
|
16
|
+
|
17
|
+
function buildGraph() {
|
18
|
+
var graph = {};
|
19
|
+
|
20
|
+
for (var len = models.length, i = 0; i < len; i++) {
|
21
|
+
graph[models[i]] = {
|
22
|
+
// http://jsperf.com/1-vs-infinity
|
23
|
+
// micro-opt, but this is simple.
|
24
|
+
distance: -1,
|
25
|
+
parent: null
|
26
|
+
};
|
27
|
+
}
|
28
|
+
|
29
|
+
return graph;
|
30
|
+
}
|
31
|
+
|
32
|
+
// https://en.wikipedia.org/wiki/Breadth-first_search
|
33
|
+
function deriveBFS(fromModel) {
|
34
|
+
var graph = buildGraph();
|
35
|
+
var queue = [fromModel]; // unshift -> queue -> pop
|
36
|
+
|
37
|
+
graph[fromModel].distance = 0;
|
38
|
+
|
39
|
+
while (queue.length) {
|
40
|
+
var current = queue.pop();
|
41
|
+
var adjacents = Object.keys(conversions[current]);
|
42
|
+
|
43
|
+
for (var len = adjacents.length, i = 0; i < len; i++) {
|
44
|
+
var adjacent = adjacents[i];
|
45
|
+
var node = graph[adjacent];
|
46
|
+
|
47
|
+
if (node.distance === -1) {
|
48
|
+
node.distance = graph[current].distance + 1;
|
49
|
+
node.parent = current;
|
50
|
+
queue.unshift(adjacent);
|
51
|
+
}
|
52
|
+
}
|
53
|
+
}
|
54
|
+
|
55
|
+
return graph;
|
56
|
+
}
|
57
|
+
|
58
|
+
function link(from, to) {
|
59
|
+
return function (args) {
|
60
|
+
return to(from(args));
|
61
|
+
};
|
62
|
+
}
|
63
|
+
|
64
|
+
function wrapConversion(toModel, graph) {
|
65
|
+
var path = [graph[toModel].parent, toModel];
|
66
|
+
var fn = conversions[graph[toModel].parent][toModel];
|
67
|
+
|
68
|
+
var cur = graph[toModel].parent;
|
69
|
+
while (graph[cur].parent) {
|
70
|
+
path.unshift(graph[cur].parent);
|
71
|
+
fn = link(conversions[graph[cur].parent][cur], fn);
|
72
|
+
cur = graph[cur].parent;
|
73
|
+
}
|
74
|
+
|
75
|
+
fn.conversion = path;
|
76
|
+
return fn;
|
77
|
+
}
|
78
|
+
|
79
|
+
module.exports = function (fromModel) {
|
80
|
+
var graph = deriveBFS(fromModel);
|
81
|
+
var conversion = {};
|
82
|
+
|
83
|
+
var models = Object.keys(graph);
|
84
|
+
for (var len = models.length, i = 0; i < len; i++) {
|
85
|
+
var toModel = models[i];
|
86
|
+
var node = graph[toModel];
|
87
|
+
|
88
|
+
if (node.parent === null) {
|
89
|
+
// no possible conversion, or this node is the source model.
|
90
|
+
continue;
|
91
|
+
}
|
92
|
+
|
93
|
+
conversion[toModel] = wrapConversion(toModel, graph);
|
94
|
+
}
|
95
|
+
|
96
|
+
return conversion;
|
97
|
+
};
|
98
|
+
|
@@ -139,7 +139,7 @@ function parseInteger(option, optstr, arg) {
|
|
139
139
|
function parsePositiveInteger(option, optstr, arg) {
|
140
140
|
assert.string(arg, 'arg');
|
141
141
|
var num = Number(arg);
|
142
|
-
if (!/^[0-9]+$/.test(arg) || isNaN(num)) {
|
142
|
+
if (!/^[0-9]+$/.test(arg) || isNaN(num) || num === 0) {
|
143
143
|
throw new Error(format('arg for "%s" is not a positive integer: "%s"',
|
144
144
|
optstr, arg));
|
145
145
|
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# assert-plus Changelog
|
2
|
+
|
3
|
+
## 1.0.0
|
4
|
+
|
5
|
+
- *BREAKING* assert.number (and derivatives) now accept Infinity as valid input
|
6
|
+
- Add assert.finite check. Previous assert.number callers should use this if
|
7
|
+
they expect Infinity inputs to throw.
|
8
|
+
|
9
|
+
## 0.2.0
|
10
|
+
|
11
|
+
- Fix `assert.object(null)` so it throws
|
12
|
+
- Fix optional/arrayOf exports for non-type-of asserts
|
13
|
+
- Add optiona/arrayOf exports for Stream/Date/Regex/uuid
|
14
|
+
- Add basic unit test coverage
|
@@ -0,0 +1,162 @@
|
|
1
|
+
# assert-plus
|
2
|
+
|
3
|
+
This library is a super small wrapper over node's assert module that has two
|
4
|
+
things: (1) the ability to disable assertions with the environment variable
|
5
|
+
NODE\_NDEBUG, and (2) some API wrappers for argument testing. Like
|
6
|
+
`assert.string(myArg, 'myArg')`. As a simple example, most of my code looks
|
7
|
+
like this:
|
8
|
+
|
9
|
+
```javascript
|
10
|
+
var assert = require('assert-plus');
|
11
|
+
|
12
|
+
function fooAccount(options, callback) {
|
13
|
+
assert.object(options, 'options');
|
14
|
+
assert.number(options.id, 'options.id');
|
15
|
+
assert.bool(options.isManager, 'options.isManager');
|
16
|
+
assert.string(options.name, 'options.name');
|
17
|
+
assert.arrayOfString(options.email, 'options.email');
|
18
|
+
assert.func(callback, 'callback');
|
19
|
+
|
20
|
+
// Do stuff
|
21
|
+
callback(null, {});
|
22
|
+
}
|
23
|
+
```
|
24
|
+
|
25
|
+
# API
|
26
|
+
|
27
|
+
All methods that *aren't* part of node's core assert API are simply assumed to
|
28
|
+
take an argument, and then a string 'name' that's not a message; `AssertionError`
|
29
|
+
will be thrown if the assertion fails with a message like:
|
30
|
+
|
31
|
+
AssertionError: foo (string) is required
|
32
|
+
at test (/home/mark/work/foo/foo.js:3:9)
|
33
|
+
at Object.<anonymous> (/home/mark/work/foo/foo.js:15:1)
|
34
|
+
at Module._compile (module.js:446:26)
|
35
|
+
at Object..js (module.js:464:10)
|
36
|
+
at Module.load (module.js:353:31)
|
37
|
+
at Function._load (module.js:311:12)
|
38
|
+
at Array.0 (module.js:484:10)
|
39
|
+
at EventEmitter._tickCallback (node.js:190:38)
|
40
|
+
|
41
|
+
from:
|
42
|
+
|
43
|
+
```javascript
|
44
|
+
function test(foo) {
|
45
|
+
assert.string(foo, 'foo');
|
46
|
+
}
|
47
|
+
```
|
48
|
+
|
49
|
+
There you go. You can check that arrays are of a homogeneous type with `Arrayof$Type`:
|
50
|
+
|
51
|
+
```javascript
|
52
|
+
function test(foo) {
|
53
|
+
assert.arrayOfString(foo, 'foo');
|
54
|
+
}
|
55
|
+
```
|
56
|
+
|
57
|
+
You can assert IFF an argument is not `undefined` (i.e., an optional arg):
|
58
|
+
|
59
|
+
```javascript
|
60
|
+
assert.optionalString(foo, 'foo');
|
61
|
+
```
|
62
|
+
|
63
|
+
Lastly, you can opt-out of assertion checking altogether by setting the
|
64
|
+
environment variable `NODE_NDEBUG=1`. This is pseudo-useful if you have
|
65
|
+
lots of assertions, and don't want to pay `typeof ()` taxes to v8 in
|
66
|
+
production. Be advised: The standard functions re-exported from `assert` are
|
67
|
+
also disabled in assert-plus if NDEBUG is specified. Using them directly from
|
68
|
+
the `assert` module avoids this behavior.
|
69
|
+
|
70
|
+
The complete list of APIs is:
|
71
|
+
|
72
|
+
* assert.array
|
73
|
+
* assert.bool
|
74
|
+
* assert.buffer
|
75
|
+
* assert.func
|
76
|
+
* assert.number
|
77
|
+
* assert.finite
|
78
|
+
* assert.object
|
79
|
+
* assert.string
|
80
|
+
* assert.stream
|
81
|
+
* assert.date
|
82
|
+
* assert.regexp
|
83
|
+
* assert.uuid
|
84
|
+
* assert.arrayOfArray
|
85
|
+
* assert.arrayOfBool
|
86
|
+
* assert.arrayOfBuffer
|
87
|
+
* assert.arrayOfFunc
|
88
|
+
* assert.arrayOfNumber
|
89
|
+
* assert.arrayOfFinite
|
90
|
+
* assert.arrayOfObject
|
91
|
+
* assert.arrayOfString
|
92
|
+
* assert.arrayOfStream
|
93
|
+
* assert.arrayOfDate
|
94
|
+
* assert.arrayOfRegexp
|
95
|
+
* assert.arrayOfUuid
|
96
|
+
* assert.optionalArray
|
97
|
+
* assert.optionalBool
|
98
|
+
* assert.optionalBuffer
|
99
|
+
* assert.optionalFunc
|
100
|
+
* assert.optionalNumber
|
101
|
+
* assert.optionalFinite
|
102
|
+
* assert.optionalObject
|
103
|
+
* assert.optionalString
|
104
|
+
* assert.optionalStream
|
105
|
+
* assert.optionalDate
|
106
|
+
* assert.optionalRegexp
|
107
|
+
* assert.optionalUuid
|
108
|
+
* assert.optionalArrayOfArray
|
109
|
+
* assert.optionalArrayOfBool
|
110
|
+
* assert.optionalArrayOfBuffer
|
111
|
+
* assert.optionalArrayOfFunc
|
112
|
+
* assert.optionalArrayOfNumber
|
113
|
+
* assert.optionalArrayOfFinite
|
114
|
+
* assert.optionalArrayOfObject
|
115
|
+
* assert.optionalArrayOfString
|
116
|
+
* assert.optionalArrayOfStream
|
117
|
+
* assert.optionalArrayOfDate
|
118
|
+
* assert.optionalArrayOfRegexp
|
119
|
+
* assert.optionalArrayOfUuid
|
120
|
+
* assert.AssertionError
|
121
|
+
* assert.fail
|
122
|
+
* assert.ok
|
123
|
+
* assert.equal
|
124
|
+
* assert.notEqual
|
125
|
+
* assert.deepEqual
|
126
|
+
* assert.notDeepEqual
|
127
|
+
* assert.strictEqual
|
128
|
+
* assert.notStrictEqual
|
129
|
+
* assert.throws
|
130
|
+
* assert.doesNotThrow
|
131
|
+
* assert.ifError
|
132
|
+
|
133
|
+
# Installation
|
134
|
+
|
135
|
+
npm install assert-plus
|
136
|
+
|
137
|
+
## License
|
138
|
+
|
139
|
+
The MIT License (MIT)
|
140
|
+
Copyright (c) 2012 Mark Cavage
|
141
|
+
|
142
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
143
|
+
this software and associated documentation files (the "Software"), to deal in
|
144
|
+
the Software without restriction, including without limitation the rights to
|
145
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
146
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
147
|
+
subject to the following conditions:
|
148
|
+
|
149
|
+
The above copyright notice and this permission notice shall be included in all
|
150
|
+
copies or substantial portions of the Software.
|
151
|
+
|
152
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
153
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
154
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
155
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
156
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
157
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
158
|
+
SOFTWARE.
|
159
|
+
|
160
|
+
## Bugs
|
161
|
+
|
162
|
+
See <https://github.com/mcavage/node-assert-plus/issues>.
|