1 | 'use strict';
|
2 |
|
3 | var _ = require('lodash'),
|
4 | mapping = require('./mapping'),
|
5 | util = require('./util'),
|
6 | Hash = util.Hash;
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | exports.funcDeps = _.uniq(_.flatMap(mapping.funcDep)).sort();
|
12 |
|
13 |
|
14 | exports.varDeps = _.uniq(_.flatMap(mapping.varDep)).sort();
|
15 |
|
16 |
|
17 | exports.buildExports = new Hash({
|
18 | 'all': [
|
19 | 'amd',
|
20 | 'es',
|
21 | 'global',
|
22 | 'node',
|
23 | 'npm',
|
24 | 'umd'
|
25 | ],
|
26 | 'defaults': {
|
27 | 'modularize': [
|
28 | 'node'
|
29 | ],
|
30 | 'monolithic': [
|
31 | 'amd',
|
32 | 'global',
|
33 | 'node',
|
34 | 'umd'
|
35 | ]
|
36 | },
|
37 | 'modularize': [
|
38 | 'amd',
|
39 | 'es',
|
40 | 'node',
|
41 | 'npm'
|
42 | ],
|
43 | 'monolithic': [
|
44 | 'amd',
|
45 | 'global',
|
46 | 'node',
|
47 | 'umd'
|
48 | ],
|
49 | 'umd': [
|
50 | 'amd',
|
51 | 'global',
|
52 | 'node'
|
53 | ]
|
54 | });
|
55 |
|
56 |
|
57 | exports.buildFlags = [
|
58 | 'core',
|
59 | 'modularize',
|
60 | 'strict',
|
61 | '-c', '--stdout',
|
62 | '-d', '--development',
|
63 | '-h', '--help',
|
64 | '-m', '--source-map',
|
65 | '-o', '--output',
|
66 | '-p', '--production',
|
67 | '-s', '--silent',
|
68 | '-V', '--version'
|
69 | ];
|
70 |
|
71 |
|
72 | exports.builtins = [
|
73 | 'Array',
|
74 | 'Boolean',
|
75 | 'Date',
|
76 | 'Error',
|
77 | 'EvalError',
|
78 | 'Function',
|
79 | 'Math',
|
80 | 'Object',
|
81 | 'RangeError',
|
82 | 'ReferenceError',
|
83 | 'RegExp',
|
84 | 'String',
|
85 | 'SyntaxError',
|
86 | 'TypeError',
|
87 | 'URIEror'
|
88 | ];
|
89 |
|
90 |
|
91 | exports.categories = _.keys(mapping.category).sort();
|
92 |
|
93 |
|
94 | exports.complexVars = [
|
95 | 'cloneableTags',
|
96 | 'maskSrcKey',
|
97 | 'nodeUtil',
|
98 | 'reComplexWord',
|
99 | 'typedArrayTags'
|
100 | ];
|
101 |
|
102 |
|
103 | exports.coreFuncs = [
|
104 | 'assignIn',
|
105 | 'before',
|
106 | 'bind',
|
107 | 'chain',
|
108 | 'clone',
|
109 | 'compact',
|
110 | 'concat',
|
111 | 'create',
|
112 | 'defaults',
|
113 | 'defer',
|
114 | 'delay',
|
115 | 'escape',
|
116 | 'every',
|
117 | 'filter',
|
118 | 'find',
|
119 | 'flatten',
|
120 | 'flattenDeep',
|
121 | 'forEach',
|
122 | 'has',
|
123 | 'head',
|
124 | 'identity',
|
125 | 'indexOf',
|
126 | 'isArguments',
|
127 | 'isArray',
|
128 | 'isBoolean',
|
129 | 'isDate',
|
130 | 'isEmpty',
|
131 | 'isEqual',
|
132 | 'isFinite',
|
133 | 'isFunction',
|
134 | 'isNaN',
|
135 | 'isNull',
|
136 | 'isNumber',
|
137 | 'isObject',
|
138 | 'isRegExp',
|
139 | 'isString',
|
140 | 'isUndefined',
|
141 | 'iteratee',
|
142 | 'keys',
|
143 | 'last',
|
144 | 'map',
|
145 | 'matches',
|
146 | 'max',
|
147 | 'min',
|
148 | 'mixin',
|
149 | 'negate',
|
150 | 'noConflict',
|
151 | 'noop',
|
152 | 'once',
|
153 | 'pick',
|
154 | 'reduce',
|
155 | 'result',
|
156 | 'size',
|
157 | 'slice',
|
158 | 'some',
|
159 | 'sortBy',
|
160 | 'tap',
|
161 | 'thru',
|
162 | 'toArray',
|
163 | 'uniqueId',
|
164 | 'value',
|
165 | 'values'
|
166 | ];
|
167 |
|
168 |
|
169 | exports.funcs = _.filter(_.difference(_.keys(mapping.funcDep), exports.varDeps).sort(), function(key) {
|
170 | var type = typeof _.prototype[key];
|
171 | return type == 'function' || type == 'undefined';
|
172 | });
|
173 |
|
174 |
|
175 | exports.includes = _.intersection(exports.funcs, _.concat(
|
176 | _.functions(_),
|
177 | _.functions(_.prototype),
|
178 | mapping.category.Seq,
|
179 | ['main']
|
180 | ));
|
181 |
|
182 |
|
183 | exports.laxSemVerDeps = [
|
184 | 'eq',
|
185 | 'gt',
|
186 | 'gte',
|
187 | 'isArguments',
|
188 | 'isArray',
|
189 | 'isArrayBuffer',
|
190 | 'isArrayLike',
|
191 | 'isArrayLikeObject',
|
192 | 'isBoolean',
|
193 | 'isBuffer',
|
194 | 'isDate',
|
195 | 'isElement',
|
196 | 'isError',
|
197 | 'isFinite',
|
198 | 'isFunction',
|
199 | 'isInteger',
|
200 | 'isLength',
|
201 | 'isMap',
|
202 | 'isNaN',
|
203 | 'isNative',
|
204 | 'isNil',
|
205 | 'isNull',
|
206 | 'isNumber',
|
207 | 'isObject',
|
208 | 'isObjectLike',
|
209 | 'isRegExp',
|
210 | 'isSafeInteger',
|
211 | 'isSet',
|
212 | 'isString',
|
213 | 'isSymbol',
|
214 | 'isTypedArray',
|
215 | 'isUndefined',
|
216 | 'isWeakMap',
|
217 | 'isWeakSet',
|
218 | 'lt',
|
219 | 'lte',
|
220 | 'root',
|
221 | 'toInteger',
|
222 | 'toLength',
|
223 | 'toNumber',
|
224 | 'toSafeInteger',
|
225 | 'toString'
|
226 | ];
|
227 |
|
228 |
|
229 | exports.minifyEscapes = _.union(
|
230 | _.keys(_),
|
231 | _.keys(_.prototype),
|
232 | _.keys(_.templateSettings), [
|
233 | 'IE_PROTO',
|
234 | 'NEGATIVE_INFINITY',
|
235 | 'POSITIVE_INFINITY',
|
236 | 'Array',
|
237 | 'ArrayBuffer',
|
238 | 'Boolean',
|
239 | 'Buffer',
|
240 | 'Cache',
|
241 | 'Date',
|
242 | 'Error',
|
243 | 'Float32Array',
|
244 | 'Float64Array',
|
245 | 'Function',
|
246 | 'Int8Array',
|
247 | 'Int16Array',
|
248 | 'Int32Array',
|
249 | 'Map',
|
250 | 'Math',
|
251 | 'Number',
|
252 | 'Object',
|
253 | 'Promise',
|
254 | 'Reflect',
|
255 | 'RegExp',
|
256 | 'Set',
|
257 | 'String',
|
258 | 'Symbol',
|
259 | 'TypeError',
|
260 | 'Uint8Array',
|
261 | 'Uint8ClampedArray',
|
262 | 'Uint16Array',
|
263 | 'Uint32Array',
|
264 | 'WeakMap',
|
265 | 'WeakSet',
|
266 | 'WinRTError',
|
267 | '__actions__',
|
268 | '__chain__',
|
269 | '__data__',
|
270 | '__dir__',
|
271 | '__filtered__',
|
272 | '__index__',
|
273 | '__iteratees__',
|
274 | '__takeCount__',
|
275 | '__values__',
|
276 | '__views__',
|
277 | '__wrapped__',
|
278 | 'add',
|
279 | 'amd',
|
280 | 'args',
|
281 | 'buffer',
|
282 | 'byteLength',
|
283 | 'cache',
|
284 | 'cancel',
|
285 | 'clear',
|
286 | 'clearTimeout',
|
287 | 'configurable',
|
288 | 'copy',
|
289 | 'count',
|
290 | 'criteria',
|
291 | 'delete',
|
292 | 'document',
|
293 | 'done',
|
294 | 'end',
|
295 | 'enumerable',
|
296 | 'exports',
|
297 | 'flush',
|
298 | 'func',
|
299 | 'get',
|
300 | 'global',
|
301 | 'has',
|
302 | 'hash',
|
303 | 'index',
|
304 | 'isConcatSpreadable',
|
305 | 'iteratee',
|
306 | 'iterator',
|
307 | 'leading',
|
308 | 'length',
|
309 | 'limit',
|
310 | 'map',
|
311 | 'maxWait',
|
312 | 'message',
|
313 | 'name',
|
314 | 'next',
|
315 | 'nodeType',
|
316 | 'omission',
|
317 | 'parseFloat',
|
318 | 'placeholder',
|
319 | 'self',
|
320 | 'separator',
|
321 | 'set',
|
322 | 'setTimeout',
|
323 | 'size',
|
324 | 'source',
|
325 | 'sourceURL',
|
326 | 'start',
|
327 | 'string',
|
328 | 'thisArg',
|
329 | 'trailing',
|
330 | 'type',
|
331 | 'value',
|
332 | 'window',
|
333 | 'writable'
|
334 | ]);
|
335 |
|
336 |
|
337 | exports.placeholderFuncs = [
|
338 | 'bind',
|
339 | 'bindKey',
|
340 | 'curry',
|
341 | 'curryRight',
|
342 | 'partial',
|
343 | 'partialRight'
|
344 | ];
|
345 |
|
346 |
|
347 | exports.topLevelDeps = [
|
348 | 'main'
|
349 | ];
|
350 |
|
351 |
|
352 | exports.uninlinables = [
|
353 | 'reInterpolate',
|
354 | 'templateSettings'
|
355 | ];
|