1 | 'use strict';
|
2 |
|
3 |
|
4 | exports.helpText = [
|
5 | 'Usage:',
|
6 | ' lodash [commands] [options]',
|
7 | '',
|
8 | 'Commands:',
|
9 | '',
|
10 | ' core Create a 4 kB build',
|
11 | ' modularize Create a build with lodash split into modules',
|
12 | ' strict Create an ES strict mode enabled build',
|
13 | '',
|
14 | ' include=.. Comma separated function/category names to include in the build',
|
15 | '',
|
16 | ' minus=.. Comma separated function/category names to remove from the build',
|
17 | '',
|
18 | ' plus=.. Comma separated function/category names to add to the build',
|
19 | '',
|
20 | ' category=.. Comma separated categories of functions to include in the build',
|
21 | ' (i.e. “array”, “collection”, “date”, “function”, “lang”,',
|
22 | ' “object”, “number”, “seq”, “string”, & “util”)',
|
23 | '',
|
24 | ' exports=.. Comma separated values of ways to export lodash.',
|
25 | ' (i.e. “amd”, “es”, “global”, “node”, “none”, “npm”, & “umd”)',
|
26 | '',
|
27 | ' iife=.. Code to replace the IIFE that wraps lodash',
|
28 | ' (e.g. `lodash iife="\\!function(){%output%}()"`)',
|
29 | '',
|
30 | ' template=.. File path pattern used to match template files to precompile',
|
31 | ' (e.g. `lodash template=./*.jst`)',
|
32 | '',
|
33 | ' settings=.. Template settings used when precompiling templates',
|
34 | ' (e.g. `lodash settings="{interpolate:/{{([\\s\\S]+?)}}/g}"`)',
|
35 | '',
|
36 | ' moduleId=.. The AMD module ID used to export lodash in lodash builds or',
|
37 | ' the module ID used to include lodash in compiled templates.',
|
38 | '',
|
39 | ' Use “none” as the module ID to create compiled templates without',
|
40 | ' a dependency on lodash.',
|
41 | '',
|
42 | ' The `exports` values “es” & “npm” may only be used in conjunction with',
|
43 | ' the `modularize` command.',
|
44 | '',
|
45 | ' The `modularize` command uses the first `exports` values as its module format,',
|
46 | ' ignoring subsequent values.',
|
47 | '',
|
48 | ' Unless specified by `-o` or `--output` all files created are saved to the',
|
49 | ' current working directory.',
|
50 | '',
|
51 | 'Options:',
|
52 | '',
|
53 | ' -c, --stdout Write output to standard output',
|
54 | ' -d, --development Write only the non-minified development output',
|
55 | ' -h, --help Display help information',
|
56 | ' -m, --source-map Generate a source map using an optional source map URL',
|
57 | ' -o, --output Write output to a given path/filename',
|
58 | ' -p, --production Write only the minified production output',
|
59 | ' -s, --silent Skip status updates normally logged to the console',
|
60 | ' -V, --version Output current version of lodash',
|
61 | ''
|
62 | ].join('\n');
|
63 |
|
64 |
|
65 | exports.hr = ' /*----------------------------------------------------------------------------*/';
|
66 |
|
67 |
|
68 | exports.reComment = /^ *(?:\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/|\/\/.*)\n/gm;
|
69 | exports.reString = /(["'])(?:(?!\1)[^\n\\]|\\.)*?\1/g;
|
70 |
|
71 |
|
72 | exports.reIsFuncSnippet = /\bfunction\b|\b[a-z]+(?:[A-Z][a-z]+)+\(|\broot\.(?:[A-Z][a-z0-9]+)+\b/;
|
73 | exports.reIsVarSnippet = /^\s*var\s+/;
|
74 |
|
75 |
|
76 | exports.reCommentToken = /<#com_token\d+#>\n/g;
|
77 | exports.reNamedToken = /,\s+<<[$\w]+>>|<<[$\w]+>>(?:,\s+|\n)?/g;
|
78 | exports.reStringToken = /<#str_token\d+#>/g;
|
79 |
|
80 |
|
81 | exports.reGetIteratee = /\bgetIteratee\b(?:\(\))?/g;
|
82 |
|
83 |
|
84 | exports.reHasDeepVars = /^ *function +runInContext\b/m;
|
85 |
|
86 |
|
87 | exports.reHasFuncTags = /^ *\* *(?:@param|@returns|@type +Function)\b/im;
|
88 |
|
89 |
|
90 | exports.rsComment = '(?: *(?:/\\*[^*]*\\*+(?:[^/][^*]*\\*+)*/|\/\/.*)\\n)*';
|