protobufjs 6.11.2 → 7.1.0

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.
Files changed (259) hide show
  1. package/README.md +7 -174
  2. package/dist/light/protobuf.js +77 -29
  3. package/dist/light/protobuf.js.map +1 -1
  4. package/dist/light/protobuf.min.js +3 -3
  5. package/dist/light/protobuf.min.js.map +1 -1
  6. package/dist/minimal/protobuf.js +27 -10
  7. package/dist/minimal/protobuf.js.map +1 -1
  8. package/dist/minimal/protobuf.min.js +3 -3
  9. package/dist/minimal/protobuf.min.js.map +1 -1
  10. package/dist/protobuf.js +163 -61
  11. package/dist/protobuf.js.map +1 -1
  12. package/dist/protobuf.min.js +3 -3
  13. package/dist/protobuf.min.js.map +1 -1
  14. package/index.d.ts +9 -7
  15. package/package.json +14 -33
  16. package/scripts/postinstall.js +0 -3
  17. package/src/converter.js +10 -4
  18. package/src/decoder.js +4 -3
  19. package/src/enum.js +24 -7
  20. package/src/field.js +6 -3
  21. package/src/namespace.js +3 -3
  22. package/src/parse.js +55 -16
  23. package/src/roots.js +1 -1
  24. package/src/tokenize.js +31 -16
  25. package/src/util/minimal.js +24 -7
  26. package/src/util.js +3 -0
  27. package/src/wrappers.js +2 -2
  28. package/tsconfig.json +2 -1
  29. package/CHANGELOG.md +0 -1019
  30. package/bin/pbjs +0 -6
  31. package/bin/pbts +0 -6
  32. package/cli/LICENSE +0 -33
  33. package/cli/README.md +0 -174
  34. package/cli/bin/pbjs +0 -6
  35. package/cli/bin/pbts +0 -6
  36. package/cli/index.d.ts +0 -3
  37. package/cli/index.js +0 -3
  38. package/cli/lib/tsd-jsdoc/LICENSE +0 -21
  39. package/cli/lib/tsd-jsdoc/README.md +0 -23
  40. package/cli/lib/tsd-jsdoc/plugin.js +0 -21
  41. package/cli/lib/tsd-jsdoc/publish.js +0 -705
  42. package/cli/lib/tsd-jsdoc.json +0 -18
  43. package/cli/node_modules/.package-lock.json +0 -256
  44. package/cli/node_modules/acorn/CHANGELOG.md +0 -620
  45. package/cli/node_modules/acorn/LICENSE +0 -21
  46. package/cli/node_modules/acorn/README.md +0 -269
  47. package/cli/node_modules/acorn/bin/acorn +0 -4
  48. package/cli/node_modules/acorn/dist/acorn.d.ts +0 -209
  49. package/cli/node_modules/acorn/dist/acorn.js +0 -5186
  50. package/cli/node_modules/acorn/dist/acorn.js.map +0 -1
  51. package/cli/node_modules/acorn/dist/acorn.mjs +0 -5155
  52. package/cli/node_modules/acorn/dist/acorn.mjs.d.ts +0 -2
  53. package/cli/node_modules/acorn/dist/acorn.mjs.map +0 -1
  54. package/cli/node_modules/acorn/dist/bin.js +0 -64
  55. package/cli/node_modules/acorn/package.json +0 -35
  56. package/cli/node_modules/acorn-jsx/LICENSE +0 -19
  57. package/cli/node_modules/acorn-jsx/README.md +0 -40
  58. package/cli/node_modules/acorn-jsx/index.js +0 -488
  59. package/cli/node_modules/acorn-jsx/package.json +0 -27
  60. package/cli/node_modules/acorn-jsx/xhtml.js +0 -255
  61. package/cli/node_modules/balanced-match/.npmignore +0 -5
  62. package/cli/node_modules/balanced-match/LICENSE.md +0 -21
  63. package/cli/node_modules/balanced-match/README.md +0 -91
  64. package/cli/node_modules/balanced-match/index.js +0 -59
  65. package/cli/node_modules/balanced-match/package.json +0 -49
  66. package/cli/node_modules/brace-expansion/LICENSE +0 -21
  67. package/cli/node_modules/brace-expansion/README.md +0 -129
  68. package/cli/node_modules/brace-expansion/index.js +0 -201
  69. package/cli/node_modules/brace-expansion/package.json +0 -47
  70. package/cli/node_modules/concat-map/.travis.yml +0 -4
  71. package/cli/node_modules/concat-map/LICENSE +0 -18
  72. package/cli/node_modules/concat-map/README.markdown +0 -62
  73. package/cli/node_modules/concat-map/example/map.js +0 -6
  74. package/cli/node_modules/concat-map/index.js +0 -13
  75. package/cli/node_modules/concat-map/package.json +0 -43
  76. package/cli/node_modules/concat-map/test/map.js +0 -39
  77. package/cli/node_modules/deep-is/.npmignore +0 -1
  78. package/cli/node_modules/deep-is/.travis.yml +0 -6
  79. package/cli/node_modules/deep-is/LICENSE +0 -22
  80. package/cli/node_modules/deep-is/README.markdown +0 -70
  81. package/cli/node_modules/deep-is/example/cmp.js +0 -11
  82. package/cli/node_modules/deep-is/index.js +0 -102
  83. package/cli/node_modules/deep-is/package.json +0 -61
  84. package/cli/node_modules/deep-is/test/NaN.js +0 -16
  85. package/cli/node_modules/deep-is/test/cmp.js +0 -23
  86. package/cli/node_modules/deep-is/test/neg-vs-pos-0.js +0 -15
  87. package/cli/node_modules/escodegen/LICENSE.BSD +0 -21
  88. package/cli/node_modules/escodegen/README.md +0 -84
  89. package/cli/node_modules/escodegen/bin/escodegen.js +0 -77
  90. package/cli/node_modules/escodegen/bin/esgenerate.js +0 -64
  91. package/cli/node_modules/escodegen/escodegen.js +0 -2647
  92. package/cli/node_modules/escodegen/package.json +0 -62
  93. package/cli/node_modules/eslint-visitor-keys/CHANGELOG.md +0 -25
  94. package/cli/node_modules/eslint-visitor-keys/LICENSE +0 -201
  95. package/cli/node_modules/eslint-visitor-keys/README.md +0 -98
  96. package/cli/node_modules/eslint-visitor-keys/lib/index.js +0 -81
  97. package/cli/node_modules/eslint-visitor-keys/lib/visitor-keys.json +0 -284
  98. package/cli/node_modules/eslint-visitor-keys/package.json +0 -40
  99. package/cli/node_modules/espree/CHANGELOG.md +0 -509
  100. package/cli/node_modules/espree/LICENSE +0 -25
  101. package/cli/node_modules/espree/README.md +0 -233
  102. package/cli/node_modules/espree/espree.js +0 -177
  103. package/cli/node_modules/espree/lib/ast-node-types.js +0 -96
  104. package/cli/node_modules/espree/lib/espree.js +0 -286
  105. package/cli/node_modules/espree/lib/features.js +0 -29
  106. package/cli/node_modules/espree/lib/options.js +0 -106
  107. package/cli/node_modules/espree/lib/token-translator.js +0 -263
  108. package/cli/node_modules/espree/lib/visitor-keys.js +0 -123
  109. package/cli/node_modules/espree/package.json +0 -64
  110. package/cli/node_modules/esprima/ChangeLog +0 -235
  111. package/cli/node_modules/esprima/LICENSE.BSD +0 -21
  112. package/cli/node_modules/esprima/README.md +0 -46
  113. package/cli/node_modules/esprima/bin/esparse.js +0 -139
  114. package/cli/node_modules/esprima/bin/esvalidate.js +0 -236
  115. package/cli/node_modules/esprima/dist/esprima.js +0 -6709
  116. package/cli/node_modules/esprima/package.json +0 -112
  117. package/cli/node_modules/estraverse/.jshintrc +0 -16
  118. package/cli/node_modules/estraverse/LICENSE.BSD +0 -19
  119. package/cli/node_modules/estraverse/README.md +0 -153
  120. package/cli/node_modules/estraverse/estraverse.js +0 -801
  121. package/cli/node_modules/estraverse/gulpfile.js +0 -70
  122. package/cli/node_modules/estraverse/package.json +0 -40
  123. package/cli/node_modules/esutils/LICENSE.BSD +0 -19
  124. package/cli/node_modules/esutils/README.md +0 -174
  125. package/cli/node_modules/esutils/lib/ast.js +0 -144
  126. package/cli/node_modules/esutils/lib/code.js +0 -135
  127. package/cli/node_modules/esutils/lib/keyword.js +0 -165
  128. package/cli/node_modules/esutils/lib/utils.js +0 -33
  129. package/cli/node_modules/esutils/package.json +0 -44
  130. package/cli/node_modules/fast-levenshtein/LICENSE.md +0 -25
  131. package/cli/node_modules/fast-levenshtein/README.md +0 -104
  132. package/cli/node_modules/fast-levenshtein/levenshtein.js +0 -136
  133. package/cli/node_modules/fast-levenshtein/package.json +0 -39
  134. package/cli/node_modules/fs.realpath/LICENSE +0 -43
  135. package/cli/node_modules/fs.realpath/README.md +0 -33
  136. package/cli/node_modules/fs.realpath/index.js +0 -66
  137. package/cli/node_modules/fs.realpath/old.js +0 -303
  138. package/cli/node_modules/fs.realpath/package.json +0 -26
  139. package/cli/node_modules/glob/LICENSE +0 -21
  140. package/cli/node_modules/glob/README.md +0 -375
  141. package/cli/node_modules/glob/changelog.md +0 -67
  142. package/cli/node_modules/glob/common.js +0 -240
  143. package/cli/node_modules/glob/glob.js +0 -790
  144. package/cli/node_modules/glob/package.json +0 -46
  145. package/cli/node_modules/glob/sync.js +0 -486
  146. package/cli/node_modules/inflight/LICENSE +0 -15
  147. package/cli/node_modules/inflight/README.md +0 -37
  148. package/cli/node_modules/inflight/inflight.js +0 -54
  149. package/cli/node_modules/inflight/package.json +0 -29
  150. package/cli/node_modules/inherits/LICENSE +0 -16
  151. package/cli/node_modules/inherits/README.md +0 -42
  152. package/cli/node_modules/inherits/inherits.js +0 -9
  153. package/cli/node_modules/inherits/inherits_browser.js +0 -27
  154. package/cli/node_modules/inherits/package.json +0 -29
  155. package/cli/node_modules/levn/LICENSE +0 -22
  156. package/cli/node_modules/levn/README.md +0 -196
  157. package/cli/node_modules/levn/lib/cast.js +0 -298
  158. package/cli/node_modules/levn/lib/coerce.js +0 -285
  159. package/cli/node_modules/levn/lib/index.js +0 -22
  160. package/cli/node_modules/levn/lib/parse-string.js +0 -113
  161. package/cli/node_modules/levn/lib/parse.js +0 -102
  162. package/cli/node_modules/levn/package.json +0 -47
  163. package/cli/node_modules/minimatch/LICENSE +0 -15
  164. package/cli/node_modules/minimatch/README.md +0 -209
  165. package/cli/node_modules/minimatch/minimatch.js +0 -923
  166. package/cli/node_modules/minimatch/package.json +0 -30
  167. package/cli/node_modules/once/LICENSE +0 -15
  168. package/cli/node_modules/once/README.md +0 -79
  169. package/cli/node_modules/once/once.js +0 -42
  170. package/cli/node_modules/once/package.json +0 -33
  171. package/cli/node_modules/optionator/CHANGELOG.md +0 -56
  172. package/cli/node_modules/optionator/LICENSE +0 -22
  173. package/cli/node_modules/optionator/README.md +0 -238
  174. package/cli/node_modules/optionator/lib/help.js +0 -260
  175. package/cli/node_modules/optionator/lib/index.js +0 -465
  176. package/cli/node_modules/optionator/lib/util.js +0 -54
  177. package/cli/node_modules/optionator/package.json +0 -44
  178. package/cli/node_modules/path-is-absolute/index.js +0 -20
  179. package/cli/node_modules/path-is-absolute/license +0 -21
  180. package/cli/node_modules/path-is-absolute/package.json +0 -43
  181. package/cli/node_modules/path-is-absolute/readme.md +0 -59
  182. package/cli/node_modules/prelude-ls/CHANGELOG.md +0 -99
  183. package/cli/node_modules/prelude-ls/LICENSE +0 -22
  184. package/cli/node_modules/prelude-ls/README.md +0 -15
  185. package/cli/node_modules/prelude-ls/lib/Func.js +0 -65
  186. package/cli/node_modules/prelude-ls/lib/List.js +0 -686
  187. package/cli/node_modules/prelude-ls/lib/Num.js +0 -130
  188. package/cli/node_modules/prelude-ls/lib/Obj.js +0 -154
  189. package/cli/node_modules/prelude-ls/lib/Str.js +0 -92
  190. package/cli/node_modules/prelude-ls/lib/index.js +0 -178
  191. package/cli/node_modules/prelude-ls/package.json +0 -52
  192. package/cli/node_modules/rimraf/CHANGELOG.md +0 -65
  193. package/cli/node_modules/rimraf/LICENSE +0 -15
  194. package/cli/node_modules/rimraf/README.md +0 -101
  195. package/cli/node_modules/rimraf/bin.js +0 -68
  196. package/cli/node_modules/rimraf/package.json +0 -32
  197. package/cli/node_modules/rimraf/rimraf.js +0 -360
  198. package/cli/node_modules/source-map/CHANGELOG.md +0 -301
  199. package/cli/node_modules/source-map/LICENSE +0 -28
  200. package/cli/node_modules/source-map/README.md +0 -742
  201. package/cli/node_modules/source-map/dist/source-map.debug.js +0 -3234
  202. package/cli/node_modules/source-map/dist/source-map.js +0 -3233
  203. package/cli/node_modules/source-map/dist/source-map.min.js +0 -2
  204. package/cli/node_modules/source-map/dist/source-map.min.js.map +0 -1
  205. package/cli/node_modules/source-map/lib/array-set.js +0 -121
  206. package/cli/node_modules/source-map/lib/base64-vlq.js +0 -140
  207. package/cli/node_modules/source-map/lib/base64.js +0 -67
  208. package/cli/node_modules/source-map/lib/binary-search.js +0 -111
  209. package/cli/node_modules/source-map/lib/mapping-list.js +0 -79
  210. package/cli/node_modules/source-map/lib/quick-sort.js +0 -114
  211. package/cli/node_modules/source-map/lib/source-map-consumer.js +0 -1145
  212. package/cli/node_modules/source-map/lib/source-map-generator.js +0 -425
  213. package/cli/node_modules/source-map/lib/source-node.js +0 -413
  214. package/cli/node_modules/source-map/lib/util.js +0 -488
  215. package/cli/node_modules/source-map/package.json +0 -73
  216. package/cli/node_modules/source-map/source-map.d.ts +0 -98
  217. package/cli/node_modules/source-map/source-map.js +0 -8
  218. package/cli/node_modules/tmp/CHANGELOG.md +0 -288
  219. package/cli/node_modules/tmp/LICENSE +0 -21
  220. package/cli/node_modules/tmp/README.md +0 -365
  221. package/cli/node_modules/tmp/lib/tmp.js +0 -780
  222. package/cli/node_modules/tmp/package.json +0 -58
  223. package/cli/node_modules/type-check/LICENSE +0 -22
  224. package/cli/node_modules/type-check/README.md +0 -210
  225. package/cli/node_modules/type-check/lib/check.js +0 -126
  226. package/cli/node_modules/type-check/lib/index.js +0 -16
  227. package/cli/node_modules/type-check/lib/parse-type.js +0 -196
  228. package/cli/node_modules/type-check/package.json +0 -40
  229. package/cli/node_modules/word-wrap/LICENSE +0 -21
  230. package/cli/node_modules/word-wrap/README.md +0 -182
  231. package/cli/node_modules/word-wrap/index.d.ts +0 -50
  232. package/cli/node_modules/word-wrap/index.js +0 -46
  233. package/cli/node_modules/word-wrap/package.json +0 -77
  234. package/cli/node_modules/wrappy/LICENSE +0 -15
  235. package/cli/node_modules/wrappy/README.md +0 -36
  236. package/cli/node_modules/wrappy/package.json +0 -29
  237. package/cli/node_modules/wrappy/wrappy.js +0 -33
  238. package/cli/package.json +0 -8
  239. package/cli/package.standalone.json +0 -32
  240. package/cli/pbjs.d.ts +0 -9
  241. package/cli/pbjs.js +0 -330
  242. package/cli/pbts.d.ts +0 -9
  243. package/cli/pbts.js +0 -197
  244. package/cli/targets/json-module.js +0 -38
  245. package/cli/targets/json.js +0 -8
  246. package/cli/targets/proto.js +0 -326
  247. package/cli/targets/proto2.js +0 -10
  248. package/cli/targets/proto3.js +0 -10
  249. package/cli/targets/static-module.js +0 -29
  250. package/cli/targets/static.js +0 -711
  251. package/cli/util.js +0 -183
  252. package/cli/wrappers/amd.js +0 -7
  253. package/cli/wrappers/closure.js +0 -7
  254. package/cli/wrappers/commonjs.js +0 -7
  255. package/cli/wrappers/default.js +0 -15
  256. package/cli/wrappers/es6.js +0 -5
  257. package/dist/README.md +0 -31
  258. package/dist/light/README.md +0 -31
  259. package/dist/minimal/README.md +0 -31
@@ -1,201 +0,0 @@
1
- var concatMap = require('concat-map');
2
- var balanced = require('balanced-match');
3
-
4
- module.exports = expandTop;
5
-
6
- var escSlash = '\0SLASH'+Math.random()+'\0';
7
- var escOpen = '\0OPEN'+Math.random()+'\0';
8
- var escClose = '\0CLOSE'+Math.random()+'\0';
9
- var escComma = '\0COMMA'+Math.random()+'\0';
10
- var escPeriod = '\0PERIOD'+Math.random()+'\0';
11
-
12
- function numeric(str) {
13
- return parseInt(str, 10) == str
14
- ? parseInt(str, 10)
15
- : str.charCodeAt(0);
16
- }
17
-
18
- function escapeBraces(str) {
19
- return str.split('\\\\').join(escSlash)
20
- .split('\\{').join(escOpen)
21
- .split('\\}').join(escClose)
22
- .split('\\,').join(escComma)
23
- .split('\\.').join(escPeriod);
24
- }
25
-
26
- function unescapeBraces(str) {
27
- return str.split(escSlash).join('\\')
28
- .split(escOpen).join('{')
29
- .split(escClose).join('}')
30
- .split(escComma).join(',')
31
- .split(escPeriod).join('.');
32
- }
33
-
34
-
35
- // Basically just str.split(","), but handling cases
36
- // where we have nested braced sections, which should be
37
- // treated as individual members, like {a,{b,c},d}
38
- function parseCommaParts(str) {
39
- if (!str)
40
- return [''];
41
-
42
- var parts = [];
43
- var m = balanced('{', '}', str);
44
-
45
- if (!m)
46
- return str.split(',');
47
-
48
- var pre = m.pre;
49
- var body = m.body;
50
- var post = m.post;
51
- var p = pre.split(',');
52
-
53
- p[p.length-1] += '{' + body + '}';
54
- var postParts = parseCommaParts(post);
55
- if (post.length) {
56
- p[p.length-1] += postParts.shift();
57
- p.push.apply(p, postParts);
58
- }
59
-
60
- parts.push.apply(parts, p);
61
-
62
- return parts;
63
- }
64
-
65
- function expandTop(str) {
66
- if (!str)
67
- return [];
68
-
69
- // I don't know why Bash 4.3 does this, but it does.
70
- // Anything starting with {} will have the first two bytes preserved
71
- // but *only* at the top level, so {},a}b will not expand to anything,
72
- // but a{},b}c will be expanded to [a}c,abc].
73
- // One could argue that this is a bug in Bash, but since the goal of
74
- // this module is to match Bash's rules, we escape a leading {}
75
- if (str.substr(0, 2) === '{}') {
76
- str = '\\{\\}' + str.substr(2);
77
- }
78
-
79
- return expand(escapeBraces(str), true).map(unescapeBraces);
80
- }
81
-
82
- function identity(e) {
83
- return e;
84
- }
85
-
86
- function embrace(str) {
87
- return '{' + str + '}';
88
- }
89
- function isPadded(el) {
90
- return /^-?0\d/.test(el);
91
- }
92
-
93
- function lte(i, y) {
94
- return i <= y;
95
- }
96
- function gte(i, y) {
97
- return i >= y;
98
- }
99
-
100
- function expand(str, isTop) {
101
- var expansions = [];
102
-
103
- var m = balanced('{', '}', str);
104
- if (!m || /\$$/.test(m.pre)) return [str];
105
-
106
- var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
107
- var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
108
- var isSequence = isNumericSequence || isAlphaSequence;
109
- var isOptions = m.body.indexOf(',') >= 0;
110
- if (!isSequence && !isOptions) {
111
- // {a},b}
112
- if (m.post.match(/,.*\}/)) {
113
- str = m.pre + '{' + m.body + escClose + m.post;
114
- return expand(str);
115
- }
116
- return [str];
117
- }
118
-
119
- var n;
120
- if (isSequence) {
121
- n = m.body.split(/\.\./);
122
- } else {
123
- n = parseCommaParts(m.body);
124
- if (n.length === 1) {
125
- // x{{a,b}}y ==> x{a}y x{b}y
126
- n = expand(n[0], false).map(embrace);
127
- if (n.length === 1) {
128
- var post = m.post.length
129
- ? expand(m.post, false)
130
- : [''];
131
- return post.map(function(p) {
132
- return m.pre + n[0] + p;
133
- });
134
- }
135
- }
136
- }
137
-
138
- // at this point, n is the parts, and we know it's not a comma set
139
- // with a single entry.
140
-
141
- // no need to expand pre, since it is guaranteed to be free of brace-sets
142
- var pre = m.pre;
143
- var post = m.post.length
144
- ? expand(m.post, false)
145
- : [''];
146
-
147
- var N;
148
-
149
- if (isSequence) {
150
- var x = numeric(n[0]);
151
- var y = numeric(n[1]);
152
- var width = Math.max(n[0].length, n[1].length)
153
- var incr = n.length == 3
154
- ? Math.abs(numeric(n[2]))
155
- : 1;
156
- var test = lte;
157
- var reverse = y < x;
158
- if (reverse) {
159
- incr *= -1;
160
- test = gte;
161
- }
162
- var pad = n.some(isPadded);
163
-
164
- N = [];
165
-
166
- for (var i = x; test(i, y); i += incr) {
167
- var c;
168
- if (isAlphaSequence) {
169
- c = String.fromCharCode(i);
170
- if (c === '\\')
171
- c = '';
172
- } else {
173
- c = String(i);
174
- if (pad) {
175
- var need = width - c.length;
176
- if (need > 0) {
177
- var z = new Array(need + 1).join('0');
178
- if (i < 0)
179
- c = '-' + z + c.slice(1);
180
- else
181
- c = z + c;
182
- }
183
- }
184
- }
185
- N.push(c);
186
- }
187
- } else {
188
- N = concatMap(n, function(el) { return expand(el, false) });
189
- }
190
-
191
- for (var j = 0; j < N.length; j++) {
192
- for (var k = 0; k < post.length; k++) {
193
- var expansion = pre + N[j] + post[k];
194
- if (!isTop || isSequence || expansion)
195
- expansions.push(expansion);
196
- }
197
- }
198
-
199
- return expansions;
200
- }
201
-
@@ -1,47 +0,0 @@
1
- {
2
- "name": "brace-expansion",
3
- "description": "Brace expansion as known from sh/bash",
4
- "version": "1.1.11",
5
- "repository": {
6
- "type": "git",
7
- "url": "git://github.com/juliangruber/brace-expansion.git"
8
- },
9
- "homepage": "https://github.com/juliangruber/brace-expansion",
10
- "main": "index.js",
11
- "scripts": {
12
- "test": "tape test/*.js",
13
- "gentest": "bash test/generate.sh",
14
- "bench": "matcha test/perf/bench.js"
15
- },
16
- "dependencies": {
17
- "balanced-match": "^1.0.0",
18
- "concat-map": "0.0.1"
19
- },
20
- "devDependencies": {
21
- "matcha": "^0.7.0",
22
- "tape": "^4.6.0"
23
- },
24
- "keywords": [],
25
- "author": {
26
- "name": "Julian Gruber",
27
- "email": "mail@juliangruber.com",
28
- "url": "http://juliangruber.com"
29
- },
30
- "license": "MIT",
31
- "testling": {
32
- "files": "test/*.js",
33
- "browsers": [
34
- "ie/8..latest",
35
- "firefox/20..latest",
36
- "firefox/nightly",
37
- "chrome/25..latest",
38
- "chrome/canary",
39
- "opera/12..latest",
40
- "opera/next",
41
- "safari/5.1..latest",
42
- "ipad/6.0..latest",
43
- "iphone/6.0..latest",
44
- "android-browser/4.2..latest"
45
- ]
46
- }
47
- }
@@ -1,4 +0,0 @@
1
- language: node_js
2
- node_js:
3
- - 0.4
4
- - 0.6
@@ -1,18 +0,0 @@
1
- This software is released under the MIT license:
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy of
4
- this software and associated documentation files (the "Software"), to deal in
5
- the Software without restriction, including without limitation the rights to
6
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
7
- the Software, and to permit persons to whom the Software is furnished to do so,
8
- subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in all
11
- copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
15
- FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
16
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,62 +0,0 @@
1
- concat-map
2
- ==========
3
-
4
- Concatenative mapdashery.
5
-
6
- [![browser support](http://ci.testling.com/substack/node-concat-map.png)](http://ci.testling.com/substack/node-concat-map)
7
-
8
- [![build status](https://secure.travis-ci.org/substack/node-concat-map.png)](http://travis-ci.org/substack/node-concat-map)
9
-
10
- example
11
- =======
12
-
13
- ``` js
14
- var concatMap = require('concat-map');
15
- var xs = [ 1, 2, 3, 4, 5, 6 ];
16
- var ys = concatMap(xs, function (x) {
17
- return x % 2 ? [ x - 0.1, x, x + 0.1 ] : [];
18
- });
19
- console.dir(ys);
20
- ```
21
-
22
- ***
23
-
24
- ```
25
- [ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]
26
- ```
27
-
28
- methods
29
- =======
30
-
31
- ``` js
32
- var concatMap = require('concat-map')
33
- ```
34
-
35
- concatMap(xs, fn)
36
- -----------------
37
-
38
- Return an array of concatenated elements by calling `fn(x, i)` for each element
39
- `x` and each index `i` in the array `xs`.
40
-
41
- When `fn(x, i)` returns an array, its result will be concatenated with the
42
- result array. If `fn(x, i)` returns anything else, that value will be pushed
43
- onto the end of the result array.
44
-
45
- install
46
- =======
47
-
48
- With [npm](http://npmjs.org) do:
49
-
50
- ```
51
- npm install concat-map
52
- ```
53
-
54
- license
55
- =======
56
-
57
- MIT
58
-
59
- notes
60
- =====
61
-
62
- This module was written while sitting high above the ground in a tree.
@@ -1,6 +0,0 @@
1
- var concatMap = require('../');
2
- var xs = [ 1, 2, 3, 4, 5, 6 ];
3
- var ys = concatMap(xs, function (x) {
4
- return x % 2 ? [ x - 0.1, x, x + 0.1 ] : [];
5
- });
6
- console.dir(ys);
@@ -1,13 +0,0 @@
1
- module.exports = function (xs, fn) {
2
- var res = [];
3
- for (var i = 0; i < xs.length; i++) {
4
- var x = fn(xs[i], i);
5
- if (isArray(x)) res.push.apply(res, x);
6
- else res.push(x);
7
- }
8
- return res;
9
- };
10
-
11
- var isArray = Array.isArray || function (xs) {
12
- return Object.prototype.toString.call(xs) === '[object Array]';
13
- };
@@ -1,43 +0,0 @@
1
- {
2
- "name" : "concat-map",
3
- "description" : "concatenative mapdashery",
4
- "version" : "0.0.1",
5
- "repository" : {
6
- "type" : "git",
7
- "url" : "git://github.com/substack/node-concat-map.git"
8
- },
9
- "main" : "index.js",
10
- "keywords" : [
11
- "concat",
12
- "concatMap",
13
- "map",
14
- "functional",
15
- "higher-order"
16
- ],
17
- "directories" : {
18
- "example" : "example",
19
- "test" : "test"
20
- },
21
- "scripts" : {
22
- "test" : "tape test/*.js"
23
- },
24
- "devDependencies" : {
25
- "tape" : "~2.4.0"
26
- },
27
- "license" : "MIT",
28
- "author" : {
29
- "name" : "James Halliday",
30
- "email" : "mail@substack.net",
31
- "url" : "http://substack.net"
32
- },
33
- "testling" : {
34
- "files" : "test/*.js",
35
- "browsers" : {
36
- "ie" : [ 6, 7, 8, 9 ],
37
- "ff" : [ 3.5, 10, 15.0 ],
38
- "chrome" : [ 10, 22 ],
39
- "safari" : [ 5.1 ],
40
- "opera" : [ 12 ]
41
- }
42
- }
43
- }
@@ -1,39 +0,0 @@
1
- var concatMap = require('../');
2
- var test = require('tape');
3
-
4
- test('empty or not', function (t) {
5
- var xs = [ 1, 2, 3, 4, 5, 6 ];
6
- var ixes = [];
7
- var ys = concatMap(xs, function (x, ix) {
8
- ixes.push(ix);
9
- return x % 2 ? [ x - 0.1, x, x + 0.1 ] : [];
10
- });
11
- t.same(ys, [ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]);
12
- t.same(ixes, [ 0, 1, 2, 3, 4, 5 ]);
13
- t.end();
14
- });
15
-
16
- test('always something', function (t) {
17
- var xs = [ 'a', 'b', 'c', 'd' ];
18
- var ys = concatMap(xs, function (x) {
19
- return x === 'b' ? [ 'B', 'B', 'B' ] : [ x ];
20
- });
21
- t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]);
22
- t.end();
23
- });
24
-
25
- test('scalars', function (t) {
26
- var xs = [ 'a', 'b', 'c', 'd' ];
27
- var ys = concatMap(xs, function (x) {
28
- return x === 'b' ? [ 'B', 'B', 'B' ] : x;
29
- });
30
- t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]);
31
- t.end();
32
- });
33
-
34
- test('undefs', function (t) {
35
- var xs = [ 'a', 'b', 'c', 'd' ];
36
- var ys = concatMap(xs, function () {});
37
- t.same(ys, [ undefined, undefined, undefined, undefined ]);
38
- t.end();
39
- });
@@ -1 +0,0 @@
1
- node_modules
@@ -1,6 +0,0 @@
1
- language: node_js
2
- node_js:
3
- - 0.4
4
- - 0.6
5
- - 0.8
6
- - 0.10
@@ -1,22 +0,0 @@
1
- Copyright (c) 2012, 2013 Thorsten Lorenz <thlorenz@gmx.de>
2
- Copyright (c) 2012 James Halliday <mail@substack.net>
3
- Copyright (c) 2009 Thomas Robinson <280north.com>
4
-
5
- This software is released under the MIT license:
6
-
7
- Permission is hereby granted, free of charge, to any person obtaining a copy of
8
- this software and associated documentation files (the "Software"), to deal in
9
- the Software without restriction, including without limitation the rights to
10
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
11
- the Software, and to permit persons to whom the Software is furnished to do so,
12
- subject to the following conditions:
13
-
14
- The above copyright notice and this permission notice shall be included in all
15
- copies or substantial portions of the Software.
16
-
17
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
19
- FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
20
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
21
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,70 +0,0 @@
1
- deep-is
2
- ==========
3
-
4
- Node's `assert.deepEqual() algorithm` as a standalone module. Exactly like
5
- [deep-equal](https://github.com/substack/node-deep-equal) except for the fact that `deepEqual(NaN, NaN) === true`.
6
-
7
- This module is around [5 times faster](https://gist.github.com/2790507)
8
- than wrapping `assert.deepEqual()` in a `try/catch`.
9
-
10
- [![browser support](http://ci.testling.com/thlorenz/deep-is.png)](http://ci.testling.com/thlorenz/deep-is)
11
-
12
- [![build status](https://secure.travis-ci.org/thlorenz/deep-is.png)](http://travis-ci.org/thlorenz/deep-is)
13
-
14
- example
15
- =======
16
-
17
- ``` js
18
- var equal = require('deep-is');
19
- console.dir([
20
- equal(
21
- { a : [ 2, 3 ], b : [ 4 ] },
22
- { a : [ 2, 3 ], b : [ 4 ] }
23
- ),
24
- equal(
25
- { x : 5, y : [6] },
26
- { x : 5, y : 6 }
27
- )
28
- ]);
29
- ```
30
-
31
- methods
32
- =======
33
-
34
- var deepIs = require('deep-is')
35
-
36
- deepIs(a, b)
37
- ---------------
38
-
39
- Compare objects `a` and `b`, returning whether they are equal according to a
40
- recursive equality algorithm.
41
-
42
- install
43
- =======
44
-
45
- With [npm](http://npmjs.org) do:
46
-
47
- ```
48
- npm install deep-is
49
- ```
50
-
51
- test
52
- ====
53
-
54
- With [npm](http://npmjs.org) do:
55
-
56
- ```
57
- npm test
58
- ```
59
-
60
- license
61
- =======
62
-
63
- Copyright (c) 2012, 2013 Thorsten Lorenz <thlorenz@gmx.de>
64
- Copyright (c) 2012 James Halliday <mail@substack.net>
65
-
66
- Derived largely from node's assert module, which has the copyright statement:
67
-
68
- Copyright (c) 2009 Thomas Robinson <280north.com>
69
-
70
- Released under the MIT license, see LICENSE for details.
@@ -1,11 +0,0 @@
1
- var equal = require('../');
2
- console.dir([
3
- equal(
4
- { a : [ 2, 3 ], b : [ 4 ] },
5
- { a : [ 2, 3 ], b : [ 4 ] }
6
- ),
7
- equal(
8
- { x : 5, y : [6] },
9
- { x : 5, y : 6 }
10
- )
11
- ]);
@@ -1,102 +0,0 @@
1
- var pSlice = Array.prototype.slice;
2
- var Object_keys = typeof Object.keys === 'function'
3
- ? Object.keys
4
- : function (obj) {
5
- var keys = [];
6
- for (var key in obj) keys.push(key);
7
- return keys;
8
- }
9
- ;
10
-
11
- var deepEqual = module.exports = function (actual, expected) {
12
- // enforce Object.is +0 !== -0
13
- if (actual === 0 && expected === 0) {
14
- return areZerosEqual(actual, expected);
15
-
16
- // 7.1. All identical values are equivalent, as determined by ===.
17
- } else if (actual === expected) {
18
- return true;
19
-
20
- } else if (actual instanceof Date && expected instanceof Date) {
21
- return actual.getTime() === expected.getTime();
22
-
23
- } else if (isNumberNaN(actual)) {
24
- return isNumberNaN(expected);
25
-
26
- // 7.3. Other pairs that do not both pass typeof value == 'object',
27
- // equivalence is determined by ==.
28
- } else if (typeof actual != 'object' && typeof expected != 'object') {
29
- return actual == expected;
30
-
31
- // 7.4. For all other Object pairs, including Array objects, equivalence is
32
- // determined by having the same number of owned properties (as verified
33
- // with Object.prototype.hasOwnProperty.call), the same set of keys
34
- // (although not necessarily the same order), equivalent values for every
35
- // corresponding key, and an identical 'prototype' property. Note: this
36
- // accounts for both named and indexed properties on Arrays.
37
- } else {
38
- return objEquiv(actual, expected);
39
- }
40
- };
41
-
42
- function isUndefinedOrNull(value) {
43
- return value === null || value === undefined;
44
- }
45
-
46
- function isArguments(object) {
47
- return Object.prototype.toString.call(object) == '[object Arguments]';
48
- }
49
-
50
- function isNumberNaN(value) {
51
- // NaN === NaN -> false
52
- return typeof value == 'number' && value !== value;
53
- }
54
-
55
- function areZerosEqual(zeroA, zeroB) {
56
- // (1 / +0|0) -> Infinity, but (1 / -0) -> -Infinity and (Infinity !== -Infinity)
57
- return (1 / zeroA) === (1 / zeroB);
58
- }
59
-
60
- function objEquiv(a, b) {
61
- if (isUndefinedOrNull(a) || isUndefinedOrNull(b))
62
- return false;
63
-
64
- // an identical 'prototype' property.
65
- if (a.prototype !== b.prototype) return false;
66
- //~~~I've managed to break Object.keys through screwy arguments passing.
67
- // Converting to array solves the problem.
68
- if (isArguments(a)) {
69
- if (!isArguments(b)) {
70
- return false;
71
- }
72
- a = pSlice.call(a);
73
- b = pSlice.call(b);
74
- return deepEqual(a, b);
75
- }
76
- try {
77
- var ka = Object_keys(a),
78
- kb = Object_keys(b),
79
- key, i;
80
- } catch (e) {//happens when one is a string literal and the other isn't
81
- return false;
82
- }
83
- // having the same number of owned properties (keys incorporates
84
- // hasOwnProperty)
85
- if (ka.length != kb.length)
86
- return false;
87
- //the same set of keys (although not necessarily the same order),
88
- ka.sort();
89
- kb.sort();
90
- //~~~cheap key test
91
- for (i = ka.length - 1; i >= 0; i--) {
92
- if (ka[i] != kb[i])
93
- return false;
94
- }
95
- //equivalent values for every corresponding key, and
96
- //~~~possibly expensive deep test
97
- for (i = ka.length - 1; i >= 0; i--) {
98
- key = ka[i];
99
- if (!deepEqual(a[key], b[key])) return false;
100
- }
101
- return true;
102
- }