UNPKG

@xailabs/altx

Version:

Flux flavor based on alt.js

1,610 lines (1,609 loc) 74 kB
{ "type": "File", "start": 0, "end": 731, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 20, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 731, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 20, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 45, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 45 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 8, "end": 22, "loc": { "start": { "line": 1, "column": 8 }, "end": { "line": 1, "column": 22 } }, "imported": { "type": "Identifier", "start": 8, "end": 22, "loc": { "start": { "line": 1, "column": 8 }, "end": { "line": 1, "column": 22 }, "identifierName": "getAltInstance" }, "name": "getAltInstance" }, "local": { "type": "Identifier", "start": 8, "end": 22, "loc": { "start": { "line": 1, "column": 8 }, "end": { "line": 1, "column": 22 }, "identifierName": "getAltInstance" }, "name": "getAltInstance" } } ], "source": { "type": "StringLiteral", "start": 29, "end": 44, "loc": { "start": { "line": 1, "column": 29 }, "end": { "line": 1, "column": 44 } }, "extra": { "rawValue": "./altInstance", "raw": "'./altInstance'" }, "value": "./altInstance" }, "trailingComments": [ { "type": "CommentBlock", "value": "*\r\n * Creates simple (data-pass-through) actions with a namespace.\r\n * Basically just like `alt.generateActions`, but within a given namespace instead of 'global'.\r\n *\r\n * @param {string} namespace - The namespace to use for the actions\r\n * @param {array<string>} actions - An array of action names\r\n * @return {object} An object containing the generated actions and constants\r\n ", "start": 49, "end": 432, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 10, "column": 3 } } } ] }, { "type": "ExportDefaultDeclaration", "start": 434, "end": 729, "loc": { "start": { "line": 11, "column": 0 }, "end": { "line": 19, "column": 1 } }, "declaration": { "type": "FunctionDeclaration", "start": 449, "end": 729, "loc": { "start": { "line": 11, "column": 15 }, "end": { "line": 19, "column": 1 } }, "id": { "type": "Identifier", "start": 458, "end": 471, "loc": { "start": { "line": 11, "column": 24 }, "end": { "line": 11, "column": 37 }, "identifierName": "createActions" }, "name": "createActions", "leadingComments": null }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 472, "end": 481, "loc": { "start": { "line": 11, "column": 38 }, "end": { "line": 11, "column": 47 }, "identifierName": "namespace" }, "name": "namespace" }, { "type": "Identifier", "start": 483, "end": 490, "loc": { "start": { "line": 11, "column": 49 }, "end": { "line": 11, "column": 56 }, "identifierName": "actions" }, "name": "actions" } ], "body": { "type": "BlockStatement", "start": 492, "end": 729, "loc": { "start": { "line": 11, "column": 58 }, "end": { "line": 19, "column": 1 } }, "body": [ { "type": "ReturnStatement", "start": 499, "end": 726, "loc": { "start": { "line": 12, "column": 4 }, "end": { "line": 18, "column": 7 } }, "argument": { "type": "CallExpression", "start": 506, "end": 725, "loc": { "start": { "line": 12, "column": 11 }, "end": { "line": 18, "column": 6 } }, "callee": { "type": "MemberExpression", "start": 506, "end": 536, "loc": { "start": { "line": 12, "column": 11 }, "end": { "line": 12, "column": 41 } }, "object": { "type": "CallExpression", "start": 506, "end": 522, "loc": { "start": { "line": 12, "column": 11 }, "end": { "line": 12, "column": 27 } }, "callee": { "type": "Identifier", "start": 506, "end": 520, "loc": { "start": { "line": 12, "column": 11 }, "end": { "line": 12, "column": 25 }, "identifierName": "getAltInstance" }, "name": "getAltInstance" }, "arguments": [] }, "property": { "type": "Identifier", "start": 523, "end": 536, "loc": { "start": { "line": 12, "column": 28 }, "end": { "line": 12, "column": 41 }, "identifierName": "createActions" }, "name": "createActions" }, "computed": false }, "arguments": [ { "type": "ObjectExpression", "start": 537, "end": 724, "loc": { "start": { "line": 12, "column": 42 }, "end": { "line": 18, "column": 5 } }, "properties": [ { "type": "ObjectProperty", "start": 548, "end": 563, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 23 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 548, "end": 552, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 12 }, "identifierName": "name" }, "name": "name" }, "value": { "type": "Identifier", "start": 554, "end": 563, "loc": { "start": { "line": 13, "column": 14 }, "end": { "line": 13, "column": 23 }, "identifierName": "namespace" }, "name": "namespace" } }, { "type": "SpreadProperty", "start": 574, "end": 717, "loc": { "start": { "line": 14, "column": 8 }, "end": { "line": 17, "column": 14 } }, "argument": { "type": "CallExpression", "start": 577, "end": 717, "loc": { "start": { "line": 14, "column": 11 }, "end": { "line": 17, "column": 14 } }, "callee": { "type": "MemberExpression", "start": 577, "end": 602, "loc": { "start": { "line": 14, "column": 11 }, "end": { "line": 14, "column": 36 } }, "object": { "type": "CallExpression", "start": 577, "end": 595, "loc": { "start": { "line": 14, "column": 11 }, "end": { "line": 14, "column": 29 } }, "callee": { "type": "MemberExpression", "start": 577, "end": 586, "loc": { "start": { "line": 14, "column": 11 }, "end": { "line": 14, "column": 20 } }, "object": { "type": "ArrayExpression", "start": 577, "end": 579, "loc": { "start": { "line": 14, "column": 11 }, "end": { "line": 14, "column": 13 } }, "elements": [] }, "property": { "type": "Identifier", "start": 580, "end": 586, "loc": { "start": { "line": 14, "column": 14 }, "end": { "line": 14, "column": 20 }, "identifierName": "concat" }, "name": "concat" }, "computed": false }, "arguments": [ { "type": "Identifier", "start": 587, "end": 594, "loc": { "start": { "line": 14, "column": 21 }, "end": { "line": 14, "column": 28 }, "identifierName": "actions" }, "name": "actions" } ] }, "property": { "type": "Identifier", "start": 596, "end": 602, "loc": { "start": { "line": 14, "column": 30 }, "end": { "line": 14, "column": 36 }, "identifierName": "reduce" }, "name": "reduce" }, "computed": false }, "arguments": [ { "type": "ArrowFunctionExpression", "start": 603, "end": 712, "loc": { "start": { "line": 14, "column": 37 }, "end": { "line": 17, "column": 9 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 604, "end": 610, "loc": { "start": { "line": 14, "column": 38 }, "end": { "line": 14, "column": 44 }, "identifierName": "result" }, "name": "result" }, { "type": "Identifier", "start": 612, "end": 618, "loc": { "start": { "line": 14, "column": 46 }, "end": { "line": 14, "column": 52 }, "identifierName": "action" }, "name": "action" } ], "body": { "type": "BlockStatement", "start": 623, "end": 712, "loc": { "start": { "line": 14, "column": 57 }, "end": { "line": 17, "column": 9 } }, "body": [ { "type": "ExpressionStatement", "start": 638, "end": 673, "loc": { "start": { "line": 15, "column": 12 }, "end": { "line": 15, "column": 47 } }, "expression": { "type": "AssignmentExpression", "start": 638, "end": 672, "loc": { "start": { "line": 15, "column": 12 }, "end": { "line": 15, "column": 46 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 638, "end": 652, "loc": { "start": { "line": 15, "column": 12 }, "end": { "line": 15, "column": 26 } }, "object": { "type": "Identifier", "start": 638, "end": 644, "loc": { "start": { "line": 15, "column": 12 }, "end": { "line": 15, "column": 18 }, "identifierName": "result" }, "name": "result" }, "property": { "type": "Identifier", "start": 645, "end": 651, "loc": { "start": { "line": 15, "column": 19 }, "end": { "line": 15, "column": 25 }, "identifierName": "action" }, "name": "action" }, "computed": true }, "right": { "type": "ArrowFunctionExpression", "start": 655, "end": 672, "loc": { "start": { "line": 15, "column": 29 }, "end": { "line": 15, "column": 46 } }, "id": null, "generator": false, "expression": true, "async": false, "params": [ { "type": "AssignmentPattern", "start": 656, "end": 663, "loc": { "start": { "line": 15, "column": 30 }, "end": { "line": 15, "column": 37 } }, "left": { "type": "Identifier", "start": 656, "end": 660, "loc": { "start": { "line": 15, "column": 30 }, "end": { "line": 15, "column": 34 }, "identifierName": "data" }, "name": "data" }, "right": { "type": "ObjectExpression", "start": 661, "end": 663, "loc": { "start": { "line": 15, "column": 35 }, "end": { "line": 15, "column": 37 } }, "properties": [] } } ], "body": { "type": "Identifier", "start": 668, "end": 672, "loc": { "start": { "line": 15, "column": 42 }, "end": { "line": 15, "column": 46 }, "identifierName": "data" }, "name": "data" } } } }, { "type": "ReturnStatement", "start": 687, "end": 701, "loc": { "start": { "line": 16, "column": 12 }, "end": { "line": 16, "column": 26 } }, "argument": { "type": "Identifier", "start": 694, "end": 700, "loc": { "start": { "line": 16, "column": 19 }, "end": { "line": 16, "column": 25 }, "identifierName": "result" }, "name": "result" } } ], "directives": [] } }, { "type": "ObjectExpression", "start": 714, "end": 716, "loc": { "start": { "line": 17, "column": 11 }, "end": { "line": 17, "column": 13 } }, "properties": [] } ] } } ] } ] } } ], "directives": [] }, "leadingComments": [ { "type": "CommentBlock", "value": "*\r\n * Creates simple (data-pass-through) actions with a namespace.\r\n * Basically just like `alt.generateActions`, but within a given namespace instead of 'global'.\r\n *\r\n * @param {string} namespace - The namespace to use for the actions\r\n * @param {array<string>} actions - An array of action names\r\n * @return {object} An object containing the generated actions and constants\r\n ", "start": 49, "end": 432, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 10, "column": 3 } } } ], "trailingComments": [] }, "leadingComments": [ { "type": "CommentBlock", "value": "*\r\n * Creates simple (data-pass-through) actions with a namespace.\r\n * Basically just like `alt.generateActions`, but within a given namespace instead of 'global'.\r\n *\r\n * @param {string} namespace - The namespace to use for the actions\r\n * @param {array<string>} actions - An array of action names\r\n * @return {object} An object containing the generated actions and constants\r\n ", "start": 49, "end": 432, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 10, "column": 3 } } } ] } ], "directives": [] }, "comments": [ { "type": "CommentBlock", "value": "*\r\n * Creates simple (data-pass-through) actions with a namespace.\r\n * Basically just like `alt.generateActions`, but within a given namespace instead of 'global'.\r\n *\r\n * @param {string} namespace - The namespace to use for the actions\r\n * @param {array<string>} actions - An array of action names\r\n * @return {object} An object containing the generated actions and constants\r\n ", "start": 49, "end": 432, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 10, "column": 3 } } } ], "tokens": [ { "type": { "label": "import", "keyword": "import", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "import", "start": 0, "end": 6, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 6 } } }, { "type": { "label": "{", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 7, "end": 8, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 8 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "getAltInstance", "start": 8, "end": 22, "loc": { "start": { "line": 1, "column": 8 }, "end": { "line": 1, "column": 22 } } }, { "type": { "label": "}", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 22, "end": 23, "loc": { "start": { "line": 1, "column": 22 }, "end": { "line": 1, "column": 23 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "from", "start": 24, "end": 28, "loc": { "start": { "line": 1, "column": 24 }, "end": { "line": 1, "column": 28 } } }, { "type": { "label": "string", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "./altInstance", "start": 29, "end": 44, "loc": { "start": { "line": 1, "column": 29 }, "end": { "line": 1, "column": 44 } } }, { "type": { "label": ";", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 44, "end": 45, "loc": { "start": { "line": 1, "column": 44 }, "end": { "line": 1, "column": 45 } } }, { "type": "CommentBlock", "value": "*\r\n * Creates simple (data-pass-through) actions with a namespace.\r\n * Basically just like `alt.generateActions`, but within a given namespace instead of 'global'.\r\n *\r\n * @param {string} namespace - The namespace to use for the actions\r\n * @param {array<string>} actions - An array of action names\r\n * @return {object} An object containing the generated actions and constants\r\n ", "start": 49, "end": 432, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 10, "column": 3 } } }, { "type": { "label": "export", "keyword": "export", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "export", "start": 434, "end": 440, "loc": { "start": { "line": 11, "column": 0 }, "end": { "line": 11, "column": 6 } } }, { "type": { "label": "default", "keyword": "default", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "default", "start": 441, "end": 448, "loc": { "start": { "line": 11, "column": 7 }, "end": { "line": 11, "column": 14 } } }, { "type": { "label": "function", "keyword": "function", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "function", "start": 449, "end": 457, "loc": { "start": { "line": 11, "column": 15 }, "end": { "line": 11, "column": 23 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "createActions", "start": 458, "end": 471, "loc": { "start": { "line": 11, "column": 24 }, "end": { "line": 11, "column": 37 } } }, { "type": { "label": "(", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 471, "end": 472, "loc": { "start": { "line": 11, "column": 37 }, "end": { "line": 11, "column": 38 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "namespace", "start": 472, "end": 481, "loc": { "start": { "line": 11, "column": 38 }, "end": { "line": 11, "column": 47 } } }, { "type": { "label": ",", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 481, "end": 482, "loc": { "start": { "line": 11, "column": 47 }, "end": { "line": 11, "column": 48 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "actions", "start": 483, "end": 490, "loc": { "start": { "line": 11, "column": 49 }, "end": { "line": 11, "column": 56 } } }, { "type": { "label": ")", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 490, "end": 491, "loc": { "start": { "line": 11, "column": 56 }, "end": { "line": 11, "column": 57 } } }, { "type": { "label": "{", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 492, "end": 493, "loc": { "start": { "line": 11, "column": 58 }, "end": { "line": 11, "column": 59 } } }, { "type": { "label": "return", "keyword": "return", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "return", "start": 499, "end": 505, "loc": { "start": { "line": 12, "column": 4 }, "end": { "line": 12, "column": 10 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "getAltInstance", "start": 506, "end": 520, "loc": { "start": { "line": 12, "column": 11 }, "end": { "line": 12, "column": 25 } } }, { "type": { "label": "(", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 520, "end": 521, "loc": { "start": { "line": 12, "column": 25 }, "end": { "line": 12, "column": 26 } } }, { "type": { "label": ")", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 521, "end": 522, "loc": { "start": { "line": 12, "column": 26 }, "end": { "line": 12, "column": 27 } } }, { "type": { "label": ".", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 522, "end": 523, "loc": { "start": { "line": 12, "column": 27 }, "end": { "line": 12, "column": 28 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "createActions", "start": 523, "end": 536, "loc": { "start": { "line": 12, "column": 28 }, "end": { "line": 12, "column": 41 } } }, { "type": { "label": "(", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 536, "end": 537, "loc": { "start": { "line": 12, "column": 41 }, "end": { "line": 12, "column": 42 } } }, { "type": { "label": "{", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 537, "end": 538, "loc": { "start": { "line": 12, "column": 42 }, "end": { "line": 12, "column": 43 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "name", "start": 548, "end": 552, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 12 } } }, { "type": { "label": ":", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 552, "end": 553,