UNPKG

roc

Version:

Build modern web applications easily

1,798 lines 72.5 kB
{ "type": "Program", "start": 0, "end": 1730, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 62, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 37, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 37 } }, "specifiers": [], "source": { "type": "Literal", "start": 7, "end": 36, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 36 } }, "value": "source-map-support/register", "rawValue": "source-map-support/register", "raw": "'source-map-support/register'" } }, { "type": "ImportDeclaration", "start": 39, "end": 74, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 35 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 46, "end": 55, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 16 } }, "local": { "type": "Identifier", "start": 46, "end": 55, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 16 } }, "name": "stripAnsi" } } ], "importKind": "value", "source": { "type": "Literal", "start": 61, "end": 73, "loc": { "start": { "line": 3, "column": 22 }, "end": { "line": 3, "column": 34 } }, "value": "strip-ansi", "rawValue": "strip-ansi", "raw": "'strip-ansi'" } }, { "type": "ImportDeclaration", "start": 75, "end": 124, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 49 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 84, "end": 97, "loc": { "start": { "line": 4, "column": 9 }, "end": { "line": 4, "column": 22 } }, "imported": { "type": "Identifier", "start": 84, "end": 97, "loc": { "start": { "line": 4, "column": 9 }, "end": { "line": 4, "column": 22 } }, "name": "isPlainObject" }, "local": { "type": "Identifier", "start": 84, "end": 97, "loc": { "start": { "line": 4, "column": 9 }, "end": { "line": 4, "column": 22 } }, "name": "isPlainObject" } }, { "type": "ImportSpecifier", "start": 99, "end": 107, "loc": { "start": { "line": 4, "column": 24 }, "end": { "line": 4, "column": 32 } }, "imported": { "type": "Identifier", "start": 99, "end": 107, "loc": { "start": { "line": 4, "column": 24 }, "end": { "line": 4, "column": 32 } }, "name": "isString" }, "local": { "type": "Identifier", "start": 99, "end": 107, "loc": { "start": { "line": 4, "column": 24 }, "end": { "line": 4, "column": 32 } }, "name": "isString" } } ], "importKind": "value", "source": { "type": "Literal", "start": 115, "end": 123, "loc": { "start": { "line": 4, "column": 40 }, "end": { "line": 4, "column": 48 } }, "value": "lodash", "rawValue": "lodash", "raw": "'lodash'" }, "trailingComments": [ { "type": "Block", "value": "*\n * Returns a string to pad with.\n *\n * @param {number} length - The desired length of the generated string.\n * @param {string} [character=\" \"] - The character to repat.\n *\n * @returns {string} - A string matching the input.\n ", "start": 126, "end": 357, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 13, "column": 3 } }, "range": [ 126, 357 ] } ] }, { "type": "ExportNamedDeclaration", "start": 358, "end": 452, "loc": { "start": { "line": 14, "column": 0 }, "end": { "line": 16, "column": 1 } }, "declaration": { "type": "FunctionDeclaration", "start": 365, "end": 452, "loc": { "start": { "line": 14, "column": 7 }, "end": { "line": 16, "column": 1 } }, "id": { "type": "Identifier", "start": 374, "end": 377, "loc": { "start": { "line": 14, "column": 16 }, "end": { "line": 14, "column": 19 } }, "name": "pad", "leadingComments": null }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 378, "end": 384, "loc": { "start": { "line": 14, "column": 20 }, "end": { "line": 14, "column": 26 } }, "name": "length" }, { "type": "AssignmentPattern", "start": 386, "end": 401, "loc": { "start": { "line": 14, "column": 28 }, "end": { "line": 14, "column": 43 } }, "operator": "=", "left": { "type": "Identifier", "start": 386, "end": 395, "loc": { "start": { "line": 14, "column": 28 }, "end": { "line": 14, "column": 37 } }, "name": "character" }, "right": { "type": "Literal", "start": 398, "end": 401, "loc": { "start": { "line": 14, "column": 40 }, "end": { "line": 14, "column": 43 } }, "value": " ", "rawValue": " ", "raw": "' '" } } ], "body": { "type": "BlockStatement", "start": 403, "end": 452, "loc": { "start": { "line": 14, "column": 45 }, "end": { "line": 16, "column": 1 } }, "body": [ { "type": "ReturnStatement", "start": 409, "end": 450, "loc": { "start": { "line": 15, "column": 4 }, "end": { "line": 15, "column": 45 } }, "argument": { "type": "CallExpression", "start": 416, "end": 449, "loc": { "start": { "line": 15, "column": 11 }, "end": { "line": 15, "column": 44 } }, "callee": { "type": "MemberExpression", "start": 416, "end": 438, "loc": { "start": { "line": 15, "column": 11 }, "end": { "line": 15, "column": 33 } }, "object": { "type": "CallExpression", "start": 416, "end": 433, "loc": { "start": { "line": 15, "column": 11 }, "end": { "line": 15, "column": 28 } }, "callee": { "type": "Identifier", "start": 416, "end": 421, "loc": { "start": { "line": 15, "column": 11 }, "end": { "line": 15, "column": 16 } }, "name": "Array" }, "arguments": [ { "type": "BinaryExpression", "start": 422, "end": 432, "loc": { "start": { "line": 15, "column": 17 }, "end": { "line": 15, "column": 27 } }, "left": { "type": "Identifier", "start": 422, "end": 428, "loc": { "start": { "line": 15, "column": 17 }, "end": { "line": 15, "column": 23 } }, "name": "length" }, "operator": "+", "right": { "type": "Literal", "start": 431, "end": 432, "loc": { "start": { "line": 15, "column": 26 }, "end": { "line": 15, "column": 27 } }, "value": 1, "rawValue": 1, "raw": "1" } } ] }, "property": { "type": "Identifier", "start": 434, "end": 438, "loc": { "start": { "line": 15, "column": 29 }, "end": { "line": 15, "column": 33 } }, "name": "join" }, "computed": false }, "arguments": [ { "type": "Identifier", "start": 439, "end": 448, "loc": { "start": { "line": 15, "column": 34 }, "end": { "line": 15, "column": 43 } }, "name": "character" } ] } } ], "trailingComments": null }, "leadingComments": [ { "type": "Block", "value": "*\n * Returns a string to pad with.\n *\n * @param {number} length - The desired length of the generated string.\n * @param {string} [character=\" \"] - The character to repat.\n *\n * @returns {string} - A string matching the input.\n ", "start": 126, "end": 357, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 13, "column": 3 } }, "range": [ 126, 357 ] } ], "trailingComments": [ { "type": "Block", "value": "*\n * Pads a string to a given length with spaces.\n *\n * @param {string} string - The string to be padded.\n * @param {number} length - The desired length of the new string.\n *\n * @returns {string} - A string matching the input.\n ", "start": 454, "end": 686, "loc": { "start": { "line": 18, "column": 0 }, "end": { "line": 25, "column": 3 } }, "range": [ 454, 686 ] } ] }, "specifiers": [], "source": null, "leadingComments": [ { "type": "Block", "value": "*\n * Returns a string to pad with.\n *\n * @param {number} length - The desired length of the generated string.\n * @param {string} [character=\" \"] - The character to repat.\n *\n * @returns {string} - A string matching the input.\n ", "start": 126, "end": 357, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 13, "column": 3 } }, "range": [ 126, 357 ] } ], "trailingComments": [ { "type": "Block", "value": "*\n * Pads a string to a given length with spaces.\n *\n * @param {string} string - The string to be padded.\n * @param {number} length - The desired length of the new string.\n *\n * @returns {string} - A string matching the input.\n ", "start": 454, "end": 686, "loc": { "start": { "line": 18, "column": 0 }, "end": { "line": 25, "column": 3 } }, "range": [ 454, 686 ] } ] }, { "type": "ExportNamedDeclaration", "start": 687, "end": 820, "loc": { "start": { "line": 26, "column": 0 }, "end": { "line": 29, "column": 1 } }, "declaration": { "type": "FunctionDeclaration", "start": 694, "end": 820, "loc": { "start": { "line": 26, "column": 7 }, "end": { "line": 29, "column": 1 } }, "id": { "type": "Identifier", "start": 703, "end": 713, "loc": { "start": { "line": 26, "column": 16 }, "end": { "line": 26, "column": 26 } }, "name": "addPadding", "leadingComments": null }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 714, "end": 720, "loc": { "start": { "line": 26, "column": 27 }, "end": { "line": 26, "column": 33 } }, "name": "string" }, { "type": "Identifier", "start": 722, "end": 728, "loc": { "start": { "line": 26, "column": 35 }, "end": { "line": 26, "column": 41 } }, "name": "length" } ], "body": { "type": "BlockStatement", "start": 730, "end": 820, "loc": { "start": { "line": 26, "column": 43 }, "end": { "line": 29, "column": 1 } }, "body": [ { "type": "ExpressionStatement", "start": 736, "end": 758, "loc": { "start": { "line": 27, "column": 4 }, "end": { "line": 27, "column": 26 } }, "expression": { "type": "AssignmentExpression", "start": 736, "end": 757, "loc": { "start": { "line": 27, "column": 4 }, "end": { "line": 27, "column": 25 } }, "operator": "=", "left": { "type": "Identifier", "start": 736, "end": 742, "loc": { "start": { "line": 27, "column": 4 }, "end": { "line": 27, "column": 10 } }, "name": "string" }, "right": { "type": "LogicalExpression", "start": 745, "end": 757, "loc": { "start": { "line": 27, "column": 13 }, "end": { "line": 27, "column": 25 } }, "left": { "type": "Identifier", "start": 745, "end": 751, "loc": { "start": { "line": 27, "column": 13 }, "end": { "line": 27, "column": 19 } }, "name": "string" }, "operator": "||", "right": { "type": "Literal", "start": 755, "end": 757, "loc": { "start": { "line": 27, "column": 23 }, "end": { "line": 27, "column": 25 } }, "value": "", "rawValue": "", "raw": "''" } } } }, { "type": "ReturnStatement", "start": 763, "end": 818, "loc": { "start": { "line": 28, "column": 4 }, "end": { "line": 28, "column": 59 } }, "argument": { "type": "BinaryExpression", "start": 770, "end": 817, "loc": { "start": { "line": 28, "column": 11 }, "end": { "line": 28, "column": 58 } }, "left": { "type": "Identifier", "start": 770, "end": 776, "loc": { "start": { "line": 28, "column": 11 }, "end": { "line": 28, "column": 17 } }, "name": "string" }, "operator": "+", "right": { "type": "CallExpression", "start": 779, "end": 817, "loc": { "start": { "line": 28, "column": 20 }, "end": { "line": 28, "column": 58 } }, "callee": { "type": "Identifier", "start": 779, "end": 782, "loc": { "start": { "line": 28, "column": 20 }, "end": { "line": 28, "column": 23 } }, "name": "pad" }, "arguments": [ { "type": "BinaryExpression", "start": 783, "end": 816, "loc": { "start": { "line": 28, "column": 24 }, "end": { "line": 28, "column": 57 } }, "left": { "type": "Identifier", "start": 783, "end": 789, "loc": { "start": { "line": 28, "column": 24 }, "end": { "line": 28, "column": 30 } }, "name": "length" }, "operator": "-", "right": { "type": "MemberExpression", "start": 792, "end": 816, "loc": { "start": { "line": 28, "column": 33 }, "end": { "line": 28, "column": 57 } }, "object": { "type": "CallExpression", "start": 792, "end": 809, "loc": { "start": { "line": 28, "column": 33 }, "end": { "line": 28, "column": 50 } }, "callee": { "type": "Identifier", "start": 792, "end": 801, "loc": { "start": { "line": 28, "column": 33 }, "end": { "line": 28, "column": 42 } }, "name": "stripAnsi" }, "arguments": [ { "type": "Identifier", "start": 802, "end": 808, "loc": { "start": { "line": 28, "column": 43 }, "end": { "line": 28, "column": 49 } }, "name": "string" } ] }, "property": { "type": "Identifier", "start": 810, "end": 816, "loc": { "start": { "line": 28, "column": 51 }, "end": { "line": 28, "column": 57 } }, "name": "length" }, "computed": false } } ] } } } ], "trailingComments": null }, "leadingComments": [ { "type": "Block", "value": "*\n * Pads a string to a given length with spaces.\n *\n * @param {string} string - The string to be padded.\n * @param {number} length - The desired length of the new string.\n *\n * @returns {string} - A string matching the input.\n ", "start": 454, "end": 686, "loc": { "start": { "line": 18, "column": 0 }, "end": { "line": 25, "column": 3 } }, "range": [ 454, 686 ] } ], "trailingComments": [ { "type": "Block", "value": "*\n * Takes a configuration path array and convertes it to a cli flag.\n *\n * @param {string[]} configPaths - The configuration path, a array consiting of properties.\n *\n * @returns {string} - The cli flag to set the given configuration option.\n ", "start": 822, "end": 1070, "loc": { "start": { "line": 31, "column": 0 }, "end": { "line": 37, "column": 3 } }, "range": [ 822, 1070 ] } ] }, "specifiers": [], "source": null, "leadingComments": [ { "type": "Block", "value": "*\n * Pads a string to a given length with spaces.\n *\n * @param {string} string - The string to be padded.\n * @param {number} length - The desired length of the new string.\n *\n * @returns {string} - A string matching the input.\n ", "start": 454, "end": 686, "loc": { "start": { "line": 18, "column": 0 }, "end": { "line": 25, "column": 3 } }, "range": [ 454, 686 ] } ], "trailingComments": [ { "type": "Block", "value": "*\n * Takes a configuration path array and convertes it to a cli flag.\n *\n * @param {string[]} configPaths - The configuration path, a array consiting of properties.\n *\n * @returns {string} - The cli flag to set the given configuration option.\n ", "start": 822, "end": 1070, "loc": { "start": { "line": 31, "column": 0 }, "end": { "line": 37, "column": 3 } }, "range": [ 822, 1070 ] } ] }, { "type": "ExportNamedDeclaration", "start": 1071, "end": 1269, "loc": { "start": { "line": 38, "column": 0 }, "end": { "line": 44, "column": 1 } }, "declaration": { "type": "FunctionDeclaration", "start": 1078, "end": 1269, "loc": { "start": { "line": 38, "column": 7 }, "end": { "line": 44, "column": 1 } }, "id": { "type": "Identifier", "start": 1087, "end": 1096, "loc": { "start": { "line": 38, "column": 16 }, "end": { "line": 38, "column": 25 } }, "name": "toCliFlag", "leadingComments": null }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 1097, "end": 1108, "loc": { "start": { "line": 38, "column": 26 }, "end": { "line": 38, "column": 37 } }, "name": "configPaths" } ], "body": { "type": "BlockStatement", "start": 1110, "end": 1269, "loc": { "start": { "line": 38, "column": 39 }, "end": { "line": 44, "column": 1 } }, "body": [ { "type": "IfStatement", "start": 1156, "end": 1226, "loc": { "start": { "line": 40, "column": 4 }, "end": { "line": 42, "column": 5 } }, "test": { "type": "BinaryExpression", "start": 1160, "end": 1188, "loc": { "start": { "line": 40, "column": 8 }, "end": { "line": 40, "column": 36 } }, "left": { "type": "MemberExpression", "start": 1160, "end": 1174, "loc": { "start": { "line": 40, "column": 8 }, "end": { "line": 40, "column": 22 } }, "object": { "type": "Identifier", "start": 1160, "end": 1171, "loc": { "start": { "line": 40, "column": 8 }, "end": { "line": 40, "column": 19 } }, "name": "configPaths", "leadingComments": null }, "property": { "type": "Literal", "start": 1172, "end": 1173, "loc": { "start": { "line": 40, "column": 20 }, "end": { "line": 40, "column": 21 } }, "value": 0, "rawValue": 0, "raw": "0" }, "computed": true, "leadingComments": null }, "operator": "===", "right": { "type": "Literal", "start": 1179, "end": 1188, "loc": { "start": { "line": 40, "column": 27 }, "end": { "line": 40, "column": 36 } }, "value": "runtime", "rawValue": "runtime", "raw": "'runtime'" }, "leadingComments": null }, "consequent": { "type": "BlockStatement", "start": 1190, "end": 1226, "loc": { "start": { "line": 40, "column": 38 }, "end": { "line": 42, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 1200, "end": 1220, "loc": { "start": { "line": 41, "column": 8 }, "end": { "line": 41, "column": 28 } }, "expression": { "type": "CallExpression", "start": 1200, "end": 1219, "loc": { "start": { "line": 41, "column": 8 }, "end": { "line": 41, "column": 27 } }, "callee": { "type": "MemberExpression", "start": 1200, "end": 1217, "loc": { "start": { "line": 41, "column": 8 }, "end": { "line": 41, "column": 25 } }, "object": { "type": "Identifier", "start": 1200, "end": 1211, "loc": { "start": { "line": 41, "column": 8 }, "end": { "line": 41, "column": 19 } }, "name": "configPaths" }, "property": { "type": "Identifier", "start": 1212, "end": 1217, "loc": { "start": { "line": 41, "column": 20 }, "end": { "line": 41, "column": 25 } }, "name": "shift" }, "computed": false }, "arguments": [] } } ] }, "alternate": null, "leadingComments": [ { "type": "CommentLine", "value": " Runtime should be added directly", "start": 1116, "end": 1151, "loc": { "start": { "line": 39, "column": 4 }, "end": { "line": 39, "column": 39 } }, "range": [ 1116, 1151 ] } ] }, { "type": "ReturnStatement", "start": 1231, "end": 1267, "loc": { "start": { "line": 43, "column": 4 }, "end": { "line": 43, "column": 40 } }, "argument": { "type": "BinaryExpression", "start": 1238, "end": 1266, "loc": { "start": { "line": 43, "column": 11 }, "end": { "line": 43, "column": 39 } }, "left": { "type": "Literal", "start": 1238, "end": 1242, "loc": { "start": { "line": 43, "column": 11 }, "end": { "line": 43, "column": 15 } }, "value": "--", "rawValue": "--", "raw": "'--'" }, "operator": "+", "right": { "type": "CallExpression", "start": 1245, "end": 1266, "loc": { "start": { "line": 43, "column": 18 }, "end": { "line": 43, "column": 39 } }, "callee": { "type": "MemberExpression", "start": 1245, "end": 1261, "loc": { "start": { "line": 43, "column": 18 }, "end": { "line": 43, "column": 34 } }, "object": { "type": "Identifier", "start": 1245, "end": 1256, "loc": { "start": { "line": 43, "column": 18 }, "end": { "line": 43, "column": 29 } }, "name": "configPaths" }, "property": { "type": "Identifier", "start": 1257, "end": 1261, "loc": { "start": { "line": 43, "column": 30 }, "end": { "line": 43, "column": 34 } }, "name": "join" }, "computed": false }, "arguments": [ { "type": "Literal", "start": 1262, "end": 1265, "loc": { "start": { "line": 43, "column": 35 }, "end": { "line": 43, "column": 38 } }, "value": "-", "rawValue": "-", "raw": "'-'" } ] } } } ], "trailingComments": null }, "leadingComments": [ { "type": "Block", "value": "*\n * Takes a configuration path array and convertes it to a cli flag.\n *\n * @param {string[]} configPaths - The configuration path, a array consiting of properties.\n *\n * @returns {string} - The cli flag to set the given configuration option.\n ", "start": 822, "end": 1070, "loc": { "start": { "line": 31, "column": 0 }, "end": { "line": 37, "column": 3 } }, "range": [ 822, 1070 ] } ], "trailingComments": [ { "type": "Block", "value": "*\n * Converts an object to a string.\n *\n * @param {Object} object - The object to convert to a string.\n *\n * @returns {string|null} - The converted object or null if the object is empty.\n ", "start": 1271, "end": 1463, "loc": { "start": { "line": 46, "column": 0 }, "end": { "line": 52, "column": 3 } }, "range": [ 1271, 1463 ] } ] }, "specifiers": [], "source": null, "leadingComments": [ { "type": "Block", "value": "*\n * Takes a configuration path array and convertes it to a cli flag.\n *\n * @param {string[]} configPaths - The configuration path, a array consiting of properties.\n *\n * @returns {string} - The cli flag to set the given configuration option.\n ", "start": 822, "end": 1070, "loc": { "start": { "line": 31, "column": 0 }, "end": { "line": 37, "column": 3 } }, "range": [ 822, 1070 ] } ], "trailingComments": [ { "type": "Block", "value": "*\n * Converts an object to a string.\n *\n * @param {Object} object - The object to convert to a string.\n *\n * @returns {string|null} - The converted object or null if the object is empty.\n ", "start": 1271, "end": 1463, "loc": { "start": { "line": 46, "column": 0 }, "end": { "line": 52, "column": 3 } }, "range": [ 1271, 1463 ] } ] }, { "type": "ExportNamedDeclaration", "start": 1464, "end": 1729, "loc": { "start": { "line": 53, "column": 0 }, "end": { "line": 61, "column": 1 } }, "declaration": { "type": "FunctionDeclaration", "start": 1471, "end": 1729, "loc": { "start": { "line": 53, "column": 7 }, "end": { "line": 61, "column": 1 } }, "id": { "type": "Identifier", "start": 1480, "end": 1495, "loc": { "start": { "line": 53, "column": 16 }, "end": { "line": 53, "column": 31 } }, "name": "getDefaultValue", "leadingComments": null }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 1496, "end": 1502, "loc": { "start": { "line": 53, "column": 32 }, "end": { "line": 53, "column": 38 } }, "name": "object" } ], "body": { "type": "BlockStatement", "start": 1504, "end": 1729, "loc": { "start": { "line": 53, "column": 40 }, "end": { "line": 61, "column": 1 } }, "body": [ { "type": "IfStatement", "start": 1510, "end": 1691, "loc": { "start": { "line": 54, "column": 4 }, "end": { "line": 58, "column": 5 } }, "test": { "type": "LogicalExpression", "start": 1514, "end": 1661, "loc": { "start": { "line": 54, "column": 8 }, "end": { "line": 56, "column": 65 } }, "left": { "type": "LogicalExpression", "start": 1514, "end": 1592, "loc": { "start": { "line": 54, "column": 8 }, "end": { "line": 55, "column": 35 } }, "left": { "type": "LogicalExpression", "start": 1514, "end": 1553, "loc": { "start": {