UNPKG

@xailabs/altx

Version:

Flux flavor based on alt.js

1,593 lines (1,592 loc) 201 kB
{ "type": "File", "start": 0, "end": 825, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 27, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 825, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 27, "column": 0 } }, "sourceType": "module", "body": [ { "type": "VariableDeclaration", "start": 18, "end": 33, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 15 } }, "declarations": [ { "type": "VariableDeclarator", "start": 24, "end": 32, "loc": { "start": { "line": 2, "column": 6 }, "end": { "line": 2, "column": 14 } }, "id": { "type": "Identifier", "start": 24, "end": 28, "loc": { "start": { "line": 2, "column": 6 }, "end": { "line": 2, "column": 10 }, "identifierName": "NONE" }, "name": "NONE", "leadingComments": null }, "init": { "type": "NumericLiteral", "start": 31, "end": 32, "loc": { "start": { "line": 2, "column": 13 }, "end": { "line": 2, "column": 14 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 }, "leadingComments": null } ], "kind": "const", "leadingComments": [ { "type": "CommentBlock", "value": "* Never log ", "start": 0, "end": 16, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 16 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "* Log if a definition has `logging: true` ", "start": 35, "end": 81, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 46 } } } ] }, { "type": "VariableDeclaration", "start": 83, "end": 99, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 16 } }, "declarations": [ { "type": "VariableDeclarator", "start": 89, "end": 98, "loc": { "start": { "line": 4, "column": 6 }, "end": { "line": 4, "column": 15 } }, "id": { "type": "Identifier", "start": 89, "end": 94, "loc": { "start": { "line": 4, "column": 6 }, "end": { "line": 4, "column": 11 }, "identifierName": "ALLOW" }, "name": "ALLOW", "leadingComments": null }, "init": { "type": "NumericLiteral", "start": 97, "end": 98, "loc": { "start": { "line": 4, "column": 14 }, "end": { "line": 4, "column": 15 } }, "extra": { "rawValue": 1, "raw": "1" }, "value": 1 }, "leadingComments": null } ], "kind": "const", "leadingComments": [ { "type": "CommentBlock", "value": "* Log if a definition has `logging: true` ", "start": 35, "end": 81, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 46 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "* Always log, regardless of `logging` in definition ", "start": 101, "end": 157, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 56 } } } ] }, { "type": "VariableDeclaration", "start": 159, "end": 175, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 16 } }, "declarations": [ { "type": "VariableDeclarator", "start": 165, "end": 174, "loc": { "start": { "line": 6, "column": 6 }, "end": { "line": 6, "column": 15 } }, "id": { "type": "Identifier", "start": 165, "end": 170, "loc": { "start": { "line": 6, "column": 6 }, "end": { "line": 6, "column": 11 }, "identifierName": "FORCE" }, "name": "FORCE", "leadingComments": null }, "init": { "type": "NumericLiteral", "start": 173, "end": 174, "loc": { "start": { "line": 6, "column": 14 }, "end": { "line": 6, "column": 15 } }, "extra": { "rawValue": 2, "raw": "2" }, "value": 2 }, "leadingComments": null } ], "kind": "const", "leadingComments": [ { "type": "CommentBlock", "value": "* Always log, regardless of `logging` in definition ", "start": 101, "end": 157, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 56 } } } ] }, { "type": "ExportNamedDeclaration", "start": 177, "end": 222, "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 7, "column": 45 } }, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", "start": 184, "end": 222, "loc": { "start": { "line": 7, "column": 7 }, "end": { "line": 7, "column": 45 } }, "declarations": [ { "type": "VariableDeclarator", "start": 190, "end": 221, "loc": { "start": { "line": 7, "column": 13 }, "end": { "line": 7, "column": 44 } }, "id": { "type": "Identifier", "start": 190, "end": 198, "loc": { "start": { "line": 7, "column": 13 }, "end": { "line": 7, "column": 21 }, "identifierName": "logLevel" }, "name": "logLevel" }, "init": { "type": "ObjectExpression", "start": 201, "end": 221, "loc": { "start": { "line": 7, "column": 24 }, "end": { "line": 7, "column": 44 } }, "properties": [ { "type": "ObjectProperty", "start": 202, "end": 206, "loc": { "start": { "line": 7, "column": 25 }, "end": { "line": 7, "column": 29 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 202, "end": 206, "loc": { "start": { "line": 7, "column": 25 }, "end": { "line": 7, "column": 29 }, "identifierName": "NONE" }, "name": "NONE" }, "value": { "type": "Identifier", "start": 202, "end": 206, "loc": { "start": { "line": 7, "column": 25 }, "end": { "line": 7, "column": 29 }, "identifierName": "NONE" }, "name": "NONE" }, "extra": { "shorthand": true } }, { "type": "ObjectProperty", "start": 208, "end": 213, "loc": { "start": { "line": 7, "column": 31 }, "end": { "line": 7, "column": 36 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 208, "end": 213, "loc": { "start": { "line": 7, "column": 31 }, "end": { "line": 7, "column": 36 }, "identifierName": "ALLOW" }, "name": "ALLOW" }, "value": { "type": "Identifier", "start": 208, "end": 213, "loc": { "start": { "line": 7, "column": 31 }, "end": { "line": 7, "column": 36 }, "identifierName": "ALLOW" }, "name": "ALLOW" }, "extra": { "shorthand": true } }, { "type": "ObjectProperty", "start": 215, "end": 220, "loc": { "start": { "line": 7, "column": 38 }, "end": { "line": 7, "column": 43 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 215, "end": 220, "loc": { "start": { "line": 7, "column": 38 }, "end": { "line": 7, "column": 43 }, "identifierName": "FORCE" }, "name": "FORCE" }, "value": { "type": "Identifier", "start": 215, "end": 220, "loc": { "start": { "line": 7, "column": 38 }, "end": { "line": 7, "column": 43 }, "identifierName": "FORCE" }, "name": "FORCE" }, "extra": { "shorthand": true } } ] } } ], "kind": "const", "leadingComments": [], "trailingComments": [] } }, { "type": "VariableDeclaration", "start": 228, "end": 246, "loc": { "start": { "line": 10, "column": 0 }, "end": { "line": 10, "column": 18 } }, "declarations": [ { "type": "VariableDeclarator", "start": 232, "end": 245, "loc": { "start": { "line": 10, "column": 4 }, "end": { "line": 10, "column": 17 } }, "id": { "type": "Identifier", "start": 232, "end": 237, "loc": { "start": { "line": 10, "column": 4 }, "end": { "line": 10, "column": 9 }, "identifierName": "level" }, "name": "level" }, "init": { "type": "Identifier", "start": 240, "end": 245, "loc": { "start": { "line": 10, "column": 12 }, "end": { "line": 10, "column": 17 }, "identifierName": "ALLOW" }, "name": "ALLOW" } } ], "kind": "let" }, { "type": "ExportNamedDeclaration", "start": 248, "end": 304, "loc": { "start": { "line": 11, "column": 0 }, "end": { "line": 13, "column": 1 } }, "specifiers": [], "source": null, "declaration": { "type": "FunctionDeclaration", "start": 255, "end": 304, "loc": { "start": { "line": 11, "column": 7 }, "end": { "line": 13, "column": 1 } }, "id": { "type": "Identifier", "start": 264, "end": 272, "loc": { "start": { "line": 11, "column": 16 }, "end": { "line": 11, "column": 24 }, "identifierName": "setLevel" }, "name": "setLevel" }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 273, "end": 278, "loc": { "start": { "line": 11, "column": 25 }, "end": { "line": 11, "column": 30 }, "identifierName": "value" }, "name": "value" } ], "body": { "type": "BlockStatement", "start": 280, "end": 304, "loc": { "start": { "line": 11, "column": 32 }, "end": { "line": 13, "column": 1 } }, "body": [ { "type": "ExpressionStatement", "start": 287, "end": 301, "loc": { "start": { "line": 12, "column": 4 }, "end": { "line": 12, "column": 18 } }, "expression": { "type": "AssignmentExpression", "start": 287, "end": 300, "loc": { "start": { "line": 12, "column": 4 }, "end": { "line": 12, "column": 17 } }, "operator": "=", "left": { "type": "Identifier", "start": 287, "end": 292, "loc": { "start": { "line": 12, "column": 4 }, "end": { "line": 12, "column": 9 }, "identifierName": "level" }, "name": "level" }, "right": { "type": "Identifier", "start": 295, "end": 300, "loc": { "start": { "line": 12, "column": 12 }, "end": { "line": 12, "column": 17 }, "identifierName": "value" }, "name": "value" } } } ], "directives": [] }, "leadingComments": [], "trailingComments": [] } }, { "type": "ExportNamedDeclaration", "start": 306, "end": 356, "loc": { "start": { "line": 14, "column": 0 }, "end": { "line": 16, "column": 1 } }, "specifiers": [], "source": null, "declaration": { "type": "FunctionDeclaration", "start": 313, "end": 356, "loc": { "start": { "line": 14, "column": 7 }, "end": { "line": 16, "column": 1 } }, "id": { "type": "Identifier", "start": 322, "end": 330, "loc": { "start": { "line": 14, "column": 16 }, "end": { "line": 14, "column": 24 }, "identifierName": "getLevel" }, "name": "getLevel" }, "generator": false, "expression": false, "async": false, "params": [], "body": { "type": "BlockStatement", "start": 333, "end": 356, "loc": { "start": { "line": 14, "column": 27 }, "end": { "line": 16, "column": 1 } }, "body": [ { "type": "ReturnStatement", "start": 340, "end": 353, "loc": { "start": { "line": 15, "column": 4 }, "end": { "line": 15, "column": 17 } }, "argument": { "type": "Identifier", "start": 347, "end": 352, "loc": { "start": { "line": 15, "column": 11 }, "end": { "line": 15, "column": 16 }, "identifierName": "level" }, "name": "level" } } ], "directives": [] }, "leadingComments": [], "trailingComments": [] } }, { "type": "ExportNamedDeclaration", "start": 360, "end": 823, "loc": { "start": { "line": 18, "column": 0 }, "end": { "line": 26, "column": 1 } }, "specifiers": [], "source": null, "declaration": { "type": "FunctionDeclaration", "start": 367, "end": 823, "loc": { "start": { "line": 18, "column": 7 }, "end": { "line": 26, "column": 1 } }, "id": { "type": "Identifier", "start": 376, "end": 388, "loc": { "start": { "line": 18, "column": 16 }, "end": { "line": 18, "column": 28 }, "identifierName": "createLogger" }, "name": "createLogger" }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 389, "end": 393, "loc": { "start": { "line": 18, "column": 29 }, "end": { "line": 18, "column": 33 }, "identifierName": "name" }, "name": "name" } ], "body": { "type": "BlockStatement", "start": 395, "end": 823, "loc": { "start": { "line": 18, "column": 35 }, "end": { "line": 26, "column": 1 } }, "body": [ { "type": "ReturnStatement", "start": 402, "end": 820, "loc": { "start": { "line": 19, "column": 4 }, "end": { "line": 25, "column": 6 } }, "argument": { "type": "ObjectExpression", "start": 409, "end": 819, "loc": { "start": { "line": 19, "column": 11 }, "end": { "line": 25, "column": 5 } }, "properties": [ { "type": "ObjectProperty", "start": 420, "end": 487, "loc": { "start": { "line": 20, "column": 8 }, "end": { "line": 20, "column": 75 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 420, "end": 423, "loc": { "start": { "line": 20, "column": 8 }, "end": { "line": 20, "column": 11 }, "identifierName": "log" }, "name": "log" }, "value": { "type": "ArrowFunctionExpression", "start": 425, "end": 487, "loc": { "start": { "line": 20, "column": 13 }, "end": { "line": 20, "column": 75 } }, "id": null, "generator": false, "expression": true, "async": false, "params": [ { "type": "RestElement", "start": 426, "end": 433, "loc": { "start": { "line": 20, "column": 14 }, "end": { "line": 20, "column": 21 } }, "argument": { "type": "Identifier", "start": 429, "end": 433, "loc": { "start": { "line": 20, "column": 17 }, "end": { "line": 20, "column": 21 }, "identifierName": "args" }, "name": "args" } } ], "body": { "type": "LogicalExpression", "start": 438, "end": 487, "loc": { "start": { "line": 20, "column": 26 }, "end": { "line": 20, "column": 75 } }, "left": { "type": "BinaryExpression", "start": 438, "end": 450, "loc": { "start": { "line": 20, "column": 26 }, "end": { "line": 20, "column": 38 } }, "left": { "type": "Identifier", "start": 438, "end": 443, "loc": { "start": { "line": 20, "column": 26 }, "end": { "line": 20, "column": 31 }, "identifierName": "level" }, "name": "level" }, "operator": ">", "right": { "type": "Identifier", "start": 446, "end": 450, "loc": { "start": { "line": 20, "column": 34 }, "end": { "line": 20, "column": 38 }, "identifierName": "NONE" }, "name": "NONE" } }, "operator": "&&", "right": { "type": "CallExpression", "start": 454, "end": 487, "loc": { "start": { "line": 20, "column": 42 }, "end": { "line": 20, "column": 75 } }, "callee": { "type": "MemberExpression", "start": 454, "end": 465, "loc": { "start": { "line": 20, "column": 42 }, "end": { "line": 20, "column": 53 } }, "object": { "type": "Identifier", "start": 454, "end": 461, "loc": { "start": { "line": 20, "column": 42 }, "end": { "line": 20, "column": 49 }, "identifierName": "console" }, "name": "console" }, "property": { "type": "Identifier", "start": 462, "end": 465, "loc": { "start": { "line": 20, "column": 50 }, "end": { "line": 20, "column": 53 }, "identifierName": "log" }, "name": "log" }, "computed": false }, "arguments": [ { "type": "TemplateLiteral", "start": 466, "end": 477, "loc": { "start": { "line": 20, "column": 54 }, "end": { "line": 20, "column": 65 } }, "expressions": [ { "type": "Identifier", "start": 470, "end": 474, "loc": { "start": { "line": 20, "column": 58 }, "end": { "line": 20, "column": 62 }, "identifierName": "name" }, "name": "name" } ], "quasis": [ { "type": "TemplateElement", "start": 467, "end": 468, "loc": { "start": { "line": 20, "column": 55 }, "end": { "line": 20, "column": 56 } }, "value": { "raw": "[", "cooked": "[" }, "tail": false }, { "type": "TemplateElement", "start": 475, "end": 476, "loc": { "start": { "line": 20, "column": 63 }, "end": { "line": 20, "column": 64 } }, "value": { "raw": "]", "cooked": "]" }, "tail": true } ] }, { "type": "SpreadElement", "start": 479, "end": 486, "loc": { "start": { "line": 20, "column": 67 }, "end": { "line": 20, "column": 74 } }, "argument": { "type": "Identifier", "start": 482, "end": 486, "loc": { "start": { "line": 20, "column": 70 }, "end": { "line": 20, "column": 74 }, "identifierName": "args" }, "name": "args" } } ] } } } }, { "type": "ObjectProperty", "start": 498, "end": 567, "loc": { "start": { "line": 21, "column": 8 }, "end": { "line": 21, "column": 77 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 498, "end": 502, "loc": { "start": { "line": 21, "column": 8 }, "end": { "line": 21, "column": 12 }, "identifierName": "info" }, "name": "info" }, "value": { "type": "ArrowFunctionExpression", "start": 504, "end": 567, "loc": { "start": { "line": 21, "column": 14 }, "end": { "line": 21, "column": 77 } }, "id": null, "generator": false, "expression": true, "async": false, "params": [ { "type": "RestElement", "start": 505, "end": 512, "loc": { "start": { "line": 21, "column": 15 }, "end": { "line": 21, "column": 22 } }, "argument": { "type": "Identifier", "start": 508, "end": 512, "loc": { "start": { "line": 21, "column": 18 }, "end": { "line": 21, "column": 22 }, "identifierName": "args" }, "name": "args" } } ], "body": { "type": "LogicalExpression", "start": 517, "end": 567, "loc": { "start": { "line": 21, "column": 27 }, "end": { "line": 21, "column": 77 } }, "left": { "type": "BinaryExpression", "start": 517, "end": 529, "loc": { "start": { "line": 21, "column": 27 }, "end": { "line": 21, "column": 39 } }, "left": { "type": "Identifier", "start": 517, "end": 522, "loc": { "start": { "line": 21, "column": 27 }, "end": { "line": 21, "column": 32 }, "identifierName": "level" }, "name": "level" }, "operator": ">", "right": { "type": "Identifier", "start": 525, "end": 529, "loc": { "start": { "line": 21, "column": 35 }, "end": { "line": 21, "column": 39 }, "identifierName": "NONE" }, "name": "NONE" } }, "operator": "&&", "right": { "type": "CallExpression", "start": 533, "end": 567, "loc": { "start": { "line": 21, "column": 43 }, "end": { "line": 21, "column": 77 } }, "callee": { "type": "MemberExpression", "start": 533, "end": 545, "loc": { "start": { "line": 21, "column": 43 }, "end": { "line": 21, "column": 55 } }, "object": { "type": "Identifier", "start": 533, "end": 540, "loc": { "start": { "line": 21, "column": 43 }, "end": { "line": 21, "column": 50 }, "identifierName": "console" }, "name": "console" }, "property": { "type": "Identifier", "start": 541, "end": 545, "loc": { "start": { "line": 21, "column": 51 }, "end": { "line": 21, "column": 55 }, "identifierName": "info" }, "name": "info" }, "computed": false }, "arguments": [ { "type": "TemplateLiteral", "start": 546, "end": 557, "loc": { "start": { "line": 21, "column": 56 }, "end": { "line": 21, "column": 67 } }, "expressions": [ { "type": "Identifier", "start": 550, "end": 554,