UNPKG

roc

Version:

Build modern web applications easily

1,749 lines (1,748 loc) 479 kB
{ "type": "Program", "start": 0, "end": 4811, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 148, "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": 76, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 37 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 46, "end": 56, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 17 } }, "local": { "type": "Identifier", "start": 46, "end": 56, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 17 } }, "name": "deepExtend" } } ], "importKind": "value", "source": { "type": "Literal", "start": 62, "end": 75, "loc": { "start": { "line": 3, "column": 23 }, "end": { "line": 3, "column": 36 } }, "value": "deep-extend", "rawValue": "deep-extend", "raw": "'deep-extend'" } }, { "type": "ImportDeclaration", "start": 77, "end": 114, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 37 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 86, "end": 97, "loc": { "start": { "line": 4, "column": 9 }, "end": { "line": 4, "column": 20 } }, "imported": { "type": "Identifier", "start": 86, "end": 97, "loc": { "start": { "line": 4, "column": 9 }, "end": { "line": 4, "column": 20 } }, "name": "isUndefined" }, "local": { "type": "Identifier", "start": 86, "end": 97, "loc": { "start": { "line": 4, "column": 9 }, "end": { "line": 4, "column": 20 } }, "name": "isUndefined" } } ], "importKind": "value", "source": { "type": "Literal", "start": 105, "end": 113, "loc": { "start": { "line": 4, "column": 28 }, "end": { "line": 4, "column": 36 } }, "value": "lodash", "rawValue": "lodash", "raw": "'lodash'" } }, { "type": "ImportDeclaration", "start": 115, "end": 150, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 35 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 122, "end": 131, "loc": { "start": { "line": 5, "column": 7 }, "end": { "line": 5, "column": 16 } }, "local": { "type": "Identifier", "start": 122, "end": 131, "loc": { "start": { "line": 5, "column": 7 }, "end": { "line": 5, "column": 16 } }, "name": "stripAnsi" } } ], "importKind": "value", "source": { "type": "Literal", "start": 137, "end": 149, "loc": { "start": { "line": 5, "column": 22 }, "end": { "line": 5, "column": 34 } }, "value": "strip-ansi", "rawValue": "strip-ansi", "raw": "'strip-ansi'" } }, { "type": "ImportDeclaration", "start": 152, "end": 196, "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 7, "column": 44 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 161, "end": 164, "loc": { "start": { "line": 7, "column": 9 }, "end": { "line": 7, "column": 12 } }, "imported": { "type": "Identifier", "start": 161, "end": 164, "loc": { "start": { "line": 7, "column": 9 }, "end": { "line": 7, "column": 12 } }, "name": "pad" }, "local": { "type": "Identifier", "start": 161, "end": 164, "loc": { "start": { "line": 7, "column": 9 }, "end": { "line": 7, "column": 12 } }, "name": "pad" } }, { "type": "ImportSpecifier", "start": 166, "end": 176, "loc": { "start": { "line": 7, "column": 14 }, "end": { "line": 7, "column": 24 } }, "imported": { "type": "Identifier", "start": 166, "end": 176, "loc": { "start": { "line": 7, "column": 14 }, "end": { "line": 7, "column": 24 } }, "name": "addPadding" }, "local": { "type": "Identifier", "start": 166, "end": 176, "loc": { "start": { "line": 7, "column": 14 }, "end": { "line": 7, "column": 24 } }, "name": "addPadding" } } ], "importKind": "value", "source": { "type": "Literal", "start": 184, "end": 195, "loc": { "start": { "line": 7, "column": 32 }, "end": { "line": 7, "column": 43 } }, "value": "./helpers", "rawValue": "./helpers", "raw": "'./helpers'" } }, { "type": "VariableDeclaration", "start": 198, "end": 407, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 16, "column": 2 } }, "declarations": [ { "type": "VariableDeclarator", "start": 204, "end": 406, "loc": { "start": { "line": 9, "column": 6 }, "end": { "line": 16, "column": 1 } }, "id": { "type": "Identifier", "start": 204, "end": 219, "loc": { "start": { "line": 9, "column": 6 }, "end": { "line": 9, "column": 21 } }, "name": "defaultSettings" }, "init": { "type": "ObjectExpression", "start": 222, "end": 406, "loc": { "start": { "line": 9, "column": 24 }, "end": { "line": 16, "column": 1 } }, "properties": [ { "type": "Property", "start": 228, "end": 261, "loc": { "start": { "line": 10, "column": 4 }, "end": { "line": 10, "column": 37 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 228, "end": 245, "loc": { "start": { "line": 10, "column": 4 }, "end": { "line": 10, "column": 21 } }, "name": "groupTitleWrapper" }, "value": { "type": "ArrowFunctionExpression", "start": 247, "end": 261, "loc": { "start": { "line": 10, "column": 23 }, "end": { "line": 10, "column": 37 } }, "id": null, "generator": false, "expression": true, "async": false, "params": [ { "type": "Identifier", "start": 248, "end": 252, "loc": { "start": { "line": 10, "column": 24 }, "end": { "line": 10, "column": 28 } }, "name": "name" } ], "body": { "type": "Identifier", "start": 257, "end": 261, "loc": { "start": { "line": 10, "column": 33 }, "end": { "line": 10, "column": 37 } }, "name": "name" } }, "kind": "init" }, { "type": "Property", "start": 267, "end": 283, "loc": { "start": { "line": 11, "column": 4 }, "end": { "line": 11, "column": 20 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 267, "end": 278, "loc": { "start": { "line": 11, "column": 4 }, "end": { "line": 11, "column": 15 } }, "name": "cellDivider" }, "value": { "type": "Literal", "start": 280, "end": 283, "loc": { "start": { "line": 11, "column": 17 }, "end": { "line": 11, "column": 20 } }, "value": "|", "rawValue": "|", "raw": "'|'" }, "kind": "init" }, { "type": "Property", "start": 289, "end": 324, "loc": { "start": { "line": 12, "column": 4 }, "end": { "line": 12, "column": 39 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 289, "end": 299, "loc": { "start": { "line": 12, "column": 4 }, "end": { "line": 12, "column": 14 } }, "name": "rowWrapper" }, "value": { "type": "ArrowFunctionExpression", "start": 301, "end": 324, "loc": { "start": { "line": 12, "column": 16 }, "end": { "line": 12, "column": 39 } }, "id": null, "generator": false, "expression": true, "async": false, "params": [ { "type": "Identifier", "start": 302, "end": 307, "loc": { "start": { "line": 12, "column": 17 }, "end": { "line": 12, "column": 22 } }, "name": "input" } ], "body": { "type": "TemplateLiteral", "start": 312, "end": 324, "loc": { "start": { "line": 12, "column": 27 }, "end": { "line": 12, "column": 39 } }, "expressions": [ { "type": "Identifier", "start": 316, "end": 321, "loc": { "start": { "line": 12, "column": 31 }, "end": { "line": 12, "column": 36 } }, "name": "input" } ], "quasis": [ { "type": "TemplateElement", "start": 313, "end": 314, "loc": { "start": { "line": 12, "column": 28 }, "end": { "line": 12, "column": 29 } }, "value": { "raw": "|", "cooked": "|" }, "tail": false }, { "type": "TemplateElement", "start": 322, "end": 323, "loc": { "start": { "line": 12, "column": 37 }, "end": { "line": 12, "column": 38 } }, "value": { "raw": "|", "cooked": "|" }, "tail": true } ] } }, "kind": "init" }, { "type": "Property", "start": 330, "end": 366, "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 13, "column": 40 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 330, "end": 341, "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 13, "column": 15 } }, "name": "cellWrapper" }, "value": { "type": "ArrowFunctionExpression", "start": 343, "end": 366, "loc": { "start": { "line": 13, "column": 17 }, "end": { "line": 13, "column": 40 } }, "id": null, "generator": false, "expression": true, "async": false, "params": [ { "type": "Identifier", "start": 344, "end": 349, "loc": { "start": { "line": 13, "column": 18 }, "end": { "line": 13, "column": 23 } }, "name": "input" } ], "body": { "type": "TemplateLiteral", "start": 354, "end": 366, "loc": { "start": { "line": 13, "column": 28 }, "end": { "line": 13, "column": 40 } }, "expressions": [ { "type": "Identifier", "start": 358, "end": 363, "loc": { "start": { "line": 13, "column": 32 }, "end": { "line": 13, "column": 37 } }, "name": "input" } ], "quasis": [ { "type": "TemplateElement", "start": 355, "end": 356, "loc": { "start": { "line": 13, "column": 29 }, "end": { "line": 13, "column": 30 } }, "value": { "raw": " ", "cooked": " " }, "tail": false }, { "type": "TemplateElement", "start": 364, "end": 365, "loc": { "start": { "line": 13, "column": 38 }, "end": { "line": 13, "column": 39 } }, "value": { "raw": " ", "cooked": " " }, "tail": true } ] } }, "kind": "init" }, { "type": "Property", "start": 372, "end": 384, "loc": { "start": { "line": 14, "column": 4 }, "end": { "line": 14, "column": 16 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 372, "end": 378, "loc": { "start": { "line": 14, "column": 4 }, "end": { "line": 14, "column": 10 } }, "name": "header" }, "value": { "type": "Literal", "start": 380, "end": 384, "loc": { "start": { "line": 14, "column": 12 }, "end": { "line": 14, "column": 16 } }, "value": true, "rawValue": true, "raw": "true" }, "kind": "init" }, { "type": "Property", "start": 390, "end": 404, "loc": { "start": { "line": 15, "column": 4 }, "end": { "line": 15, "column": 18 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 390, "end": 397, "loc": { "start": { "line": 15, "column": 4 }, "end": { "line": 15, "column": 11 } }, "name": "compact" }, "value": { "type": "Literal", "start": 399, "end": 404, "loc": { "start": { "line": 15, "column": 13 }, "end": { "line": 15, "column": 18 } }, "value": false, "rawValue": false, "raw": "false" }, "kind": "init" } ] } } ], "kind": "const", "trailingComments": [ { "type": "Block", "value": "*\n * Creates a table based on a {@link rocDocumentationObject}.\n *\n * @param {rocDocumentationObject} initalDocumentationObject - The documentation object to create a table of.\n * @param {rocTableHeader} header - Header object to use.\n * @param {rocTableSettings} settings - The settings to use.\n *\n * @returns {string} - A table.\n ", "start": 409, "end": 745, "loc": { "start": { "line": 18, "column": 0 }, "end": { "line": 26, "column": 3 } }, "range": [ 409, 745 ] } ] }, { "type": "ExportDefaultDeclaration", "start": 746, "end": 3308, "loc": { "start": { "line": 27, "column": 0 }, "end": { "line": 102, "column": 1 } }, "declaration": { "type": "FunctionDeclaration", "start": 761, "end": 3308, "loc": { "start": { "line": 27, "column": 15 }, "end": { "line": 102, "column": 1 } }, "id": { "type": "Identifier", "start": 770, "end": 783, "loc": { "start": { "line": 27, "column": 24 }, "end": { "line": 27, "column": 37 } }, "name": "generateTable", "leadingComments": null }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 784, "end": 809, "loc": { "start": { "line": 27, "column": 38 }, "end": { "line": 27, "column": 63 } }, "name": "initalDocumentationObject" }, { "type": "Identifier", "start": 811, "end": 817, "loc": { "start": { "line": 27, "column": 65 }, "end": { "line": 27, "column": 71 } }, "name": "header" }, { "type": "Identifier", "start": 819, "end": 827, "loc": { "start": { "line": 27, "column": 73 }, "end": { "line": 27, "column": 81 } }, "name": "settings" } ], "body": { "type": "BlockStatement", "start": 829, "end": 3308, "loc": { "start": { "line": 27, "column": 83 }, "end": { "line": 102, "column": 1 } }, "body": [ { "type": "ExpressionStatement", "start": 835, "end": 888, "loc": { "start": { "line": 28, "column": 4 }, "end": { "line": 28, "column": 57 } }, "expression": { "type": "AssignmentExpression", "start": 835, "end": 887, "loc": { "start": { "line": 28, "column": 4 }, "end": { "line": 28, "column": 56 } }, "operator": "=", "left": { "type": "Identifier", "start": 835, "end": 843, "loc": { "start": { "line": 28, "column": 4 }, "end": { "line": 28, "column": 12 } }, "name": "settings" }, "right": { "type": "CallExpression", "start": 846, "end": 887, "loc": { "start": { "line": 28, "column": 15 }, "end": { "line": 28, "column": 56 } }, "callee": { "type": "Identifier", "start": 846, "end": 856, "loc": { "start": { "line": 28, "column": 15 }, "end": { "line": 28, "column": 25 } }, "name": "deepExtend" }, "arguments": [ { "type": "ObjectExpression", "start": 857, "end": 859, "loc": { "start": { "line": 28, "column": 26 }, "end": { "line": 28, "column": 28 } }, "properties": [] }, { "type": "Identifier", "start": 861, "end": 876, "loc": { "start": { "line": 28, "column": 30 }, "end": { "line": 28, "column": 45 } }, "name": "defaultSettings" }, { "type": "Identifier", "start": 878, "end": 886, "loc": { "start": { "line": 28, "column": 47 }, "end": { "line": 28, "column": 55 } }, "name": "settings" } ] } } }, { "type": "VariableDeclaration", "start": 893, "end": 960, "loc": { "start": { "line": 29, "column": 4 }, "end": { "line": 29, "column": 71 } }, "declarations": [ { "type": "VariableDeclarator", "start": 899, "end": 959, "loc": { "start": { "line": 29, "column": 10 }, "end": { "line": 29, "column": 70 } }, "id": { "type": "Identifier", "start": 899, "end": 912, "loc": { "start": { "line": 29, "column": 10 }, "end": { "line": 29, "column": 23 } }, "name": "headerLengths" }, "init": { "type": "CallExpression", "start": 915, "end": 959, "loc": { "start": { "line": 29, "column": 26 }, "end": { "line": 29, "column": 70 } }, "callee": { "type": "Identifier", "start": 915, "end": 933, "loc": { "start": { "line": 29, "column": 26 }, "end": { "line": 29, "column": 44 } }, "name": "createLengthObject" }, "arguments": [ { "type": "Identifier", "start": 934, "end": 940, "loc": { "start": { "line": 29, "column": 45 }, "end": { "line": 29, "column": 51 } }, "name": "header" }, { "type": "Identifier", "start": 942, "end": 948, "loc": { "start": { "line": 29, "column": 53 }, "end": { "line": 29, "column": 59 } }, "name": "header" }, { "type": "ObjectExpression", "start": 950, "end": 952, "loc": { "start": { "line": 29, "column": 61 }, "end": { "line": 29, "column": 63 } }, "properties": [] }, { "type": "Literal", "start": 954, "end": 958, "loc": { "start": { "line": 29, "column": 65 }, "end": { "line": 29, "column": 69 } }, "value": true, "rawValue": true, "raw": "true" } ] } } ], "kind": "const" }, { "type": "VariableDeclaration", "start": 965, "end": 1050, "loc": { "start": { "line": 30, "column": 4 }, "end": { "line": 30, "column": 89 } }, "declarations": [ { "type": "VariableDeclarator", "start": 971, "end": 1049, "loc": { "start": { "line": 30, "column": 10 }, "end": { "line": 30, "column": 88 } }, "id": { "type": "Identifier", "start": 971, "end": 978, "loc": { "start": { "line": 30, "column": 10 }, "end": { "line": 30, "column": 17 } }, "name": "lengths" }, "init": { "type": "CallExpression", "start": 981, "end": 1049, "loc": { "start": { "line": 30, "column": 20 }, "end": { "line": 30, "column": 88 } }, "callee": { "type": "Identifier", "start": 981, "end": 999, "loc": { "start": { "line": 30, "column": 20 }, "end": { "line": 30, "column": 38 } }, "name": "createLengthObject" }, "arguments": [ { "type": "Identifier", "start": 1000, "end": 1025, "loc": { "start": { "line": 30, "column": 39 }, "end": { "line": 30, "column": 64 } }, "name": "initalDocumentationObject" }, { "type": "Identifier", "start": 1027, "end": 1033, "loc": { "start": { "line": 30, "column": 66 }, "end": { "line": 30, "column": 72 } }, "name": "header" }, { "type": "Identifier", "start": 1035, "end": 1048, "loc": { "start": { "line": 30, "column": 74 }, "end": { "line": 30, "column": 87 } }, "name": "headerLengths" } ] } } ], "kind": "const" }, { "type": "VariableDeclaration", "start": 1056, "end": 1500, "loc": { "start": { "line": 32, "column": 4 }, "end": { "line": 42, "column": 6 } }, "declarations": [ { "type": "VariableDeclarator", "start": 1062, "end": 1499, "loc": { "start": { "line": 32, "column": 10 }, "end": { "line": 42, "column": 5 } }, "id": { "type": "Identifier", "start": 1062, "end": 1076, "loc": { "start": { "line": 32, "column": 10 }, "end": { "line": 32, "column": 24 } }, "name": "printTableCell" }, "init": { "type": "ArrowFunctionExpression", "start": 1079, "end": 1499, "loc": { "start": { "line": 32, "column": 27 }, "end": { "line": 42, "column": 5 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 1080, "end": 1083, "loc": { "start": { "line": 32, "column": 28 }, "end": { "line": 32, "column": 31 } }, "name": "key" }, { "type": "Identifier", "start": 1085, "end": 1092, "loc": { "start": { "line": 32, "column": 33 }, "end": { "line": 32, "column": 40 } }, "name": "element" }, { "type": "AssignmentPattern", "start": 1094, "end": 1127, "loc": { "start": { "line": 32, "column": 42 }, "end": { "line": 32, "column": 75 } }, "left": { "type": "Identifier", "start": 1094, "end": 1102, "loc": { "start": { "line": 32, "column": 42 }, "end": { "line": 32, "column": 50 } }, "name": "renderer" }, "right": { "type": "ArrowFunctionExpression", "start": 1105, "end": 1127, "loc": { "start": { "line": 32, "column": 53 }, "end": { "line": 32, "column": 75 } }, "id": null, "generator": false, "expression": true, "async": false, "params": [ { "type": "Identifier", "start": 1106, "end": 1111, "loc": { "start": { "line": 32, "column": 54 }, "end": { "line": 32, "column": 59 } }, "name": "input" } ], "body": { "type": "LogicalExpression", "start": 1116, "end": 1127, "loc": { "start": { "line": 32, "column": 64 }, "end": { "line": 32, "column": 75 } }, "left": { "type": "Identifier", "start": 1116, "end": 1121, "loc": { "start": { "line": 32, "column": 64 }, "end": { "line": 32, "column": 69 } }, "name": "input" }, "operator": "||", "right": { "type": "Literal", "start": 1125, "end": 1127, "loc": { "start": { "line": 32, "column": 73 }, "end": {