UNPKG

4.05 kBJavaScriptView Raw
1'use strict';
2
3/** The text displayed for the `--help` option. */
4exports.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/** The source for a horizontal rule comment. */
65exports.hr = ' /*----------------------------------------------------------------------------*/';
66
67/** The regexes to match comments and string literals. */
68exports.reComment = /^ *(?:\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/|\/\/.*)\n/gm;
69exports.reString = /(["'])(?:(?!\1)[^\n\\]|\\.)*?\1/g;
70
71/** The regexes to detect if a string is a function snippet or a variable declaration snippet. */
72exports.reIsFuncSnippet = /\bfunction\b|\b[a-z]+(?:[A-Z][a-z]+)+\(|\broot\.(?:[A-Z][a-z0-9]+)+\b/;
73exports.reIsVarSnippet = /^\s*var\s+/;
74
75/** The regexes to match function and string tokens. */
76exports.reCommentToken = /<#com_token\d+#>\n/g;
77exports.reNamedToken = /,\s+<<[$\w]+>>|<<[$\w]+>>(?:,\s+|\n)?/g;
78exports.reStringToken = /<#str_token\d+#>/g;
79
80/** The regexp to match various calls and references. */
81exports.reGetIteratee = /\bgetIteratee\b(?:\(\))?/g;
82
83/** The regexp to determine if a variable search should be deep. */
84exports.reHasDeepVars = /^ *function +runInContext\b/m;
85
86/** The regexp to detect a function by its JSDoc tags. */
87exports.reHasFuncTags = /^ *\* *(?:@param|@returns|@type +Function)\b/im;
88
89/** The regexp source to detect single and multi-line comment blocks. */
90exports.rsComment = '(?: *(?:/\\*[^*]*\\*+(?:[^/][^*]*\\*+)*/|\/\/.*)\\n)*';