UNPKG

awv3

Version:
1,235 lines (1,234 loc) 67.1 kB
{ "type": "Program", "body": [ { "type": "ImportDeclaration", "specifiers": [ { "type": "ImportSpecifier", "local": { "type": "Identifier", "name": "pluginTypes", "range": [ 18, 29 ], "loc": { "start": { "line": 1, "column": 18 }, "end": { "line": 1, "column": 29 } } }, "imported": { "type": "Identifier", "name": "types", "range": [ 9, 14 ], "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 14 } } }, "range": [ 9, 29 ], "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 29 } } } ], "source": { "type": "Literal", "value": "./plugins", "raw": "'./plugins'", "range": [ 37, 48 ], "loc": { "start": { "line": 1, "column": 37 }, "end": { "line": 1, "column": 48 } } }, "range": [ 0, 49 ], "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 49 } } }, { "type": "ExportNamedDeclaration", "declaration": { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "reducer", "range": [ 66, 73 ], "loc": { "start": { "line": 3, "column": 13 }, "end": { "line": 3, "column": 20 } } }, "init": { "type": "ArrowFunctionExpression", "id": null, "params": [ { "type": "AssignmentPattern", "left": { "type": "Identifier", "name": "state", "range": [ 77, 82 ], "loc": { "start": { "line": 3, "column": 24 }, "end": { "line": 3, "column": 29 } } }, "right": { "type": "ObjectExpression", "properties": [ { "type": "Property", "key": { "type": "Identifier", "name": "plugins", "range": [ 87, 94 ], "loc": { "start": { "line": 3, "column": 34 }, "end": { "line": 3, "column": 41 } } }, "value": { "type": "ArrayExpression", "elements": [], "range": [ 96, 98 ], "loc": { "start": { "line": 3, "column": 43 }, "end": { "line": 3, "column": 45 } } }, "kind": "init", "method": false, "shorthand": false, "computed": false, "range": [ 87, 98 ], "loc": { "start": { "line": 3, "column": 34 }, "end": { "line": 3, "column": 45 } } } ], "range": [ 85, 100 ], "loc": { "start": { "line": 3, "column": 32 }, "end": { "line": 3, "column": 47 } } }, "range": [ 77, 100 ], "loc": { "start": { "line": 3, "column": 24 }, "end": { "line": 3, "column": 47 } } }, { "type": "ObjectPattern", "properties": [ { "type": "Property", "key": { "type": "Identifier", "name": "type", "range": [ 104, 108 ], "loc": { "start": { "line": 3, "column": 51 }, "end": { "line": 3, "column": 55 } } }, "value": { "type": "Identifier", "name": "type", "range": [ 104, 108 ], "loc": { "start": { "line": 3, "column": 51 }, "end": { "line": 3, "column": 55 } } }, "kind": "init", "method": false, "shorthand": true, "computed": false, "range": [ 104, 108 ], "loc": { "start": { "line": 3, "column": 51 }, "end": { "line": 3, "column": 55 } } }, { "type": "Property", "key": { "type": "Identifier", "name": "payload", "range": [ 110, 117 ], "loc": { "start": { "line": 3, "column": 57 }, "end": { "line": 3, "column": 64 } } }, "value": { "type": "Identifier", "name": "payload", "range": [ 110, 117 ], "loc": { "start": { "line": 3, "column": 57 }, "end": { "line": 3, "column": 64 } } }, "kind": "init", "method": false, "shorthand": true, "computed": false, "range": [ 110, 117 ], "loc": { "start": { "line": 3, "column": 57 }, "end": { "line": 3, "column": 64 } } } ], "range": [ 102, 119 ], "loc": { "start": { "line": 3, "column": 49 }, "end": { "line": 3, "column": 66 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "IfStatement", "test": { "type": "BinaryExpression", "operator": "===", "left": { "type": "Identifier", "name": "type", "range": [ 135, 139 ], "loc": { "start": { "line": 4, "column": 8 }, "end": { "line": 4, "column": 12 } } }, "right": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "pluginTypes", "range": [ 144, 155 ], "loc": { "start": { "line": 4, "column": 17 }, "end": { "line": 4, "column": 28 } } }, "property": { "type": "Identifier", "name": "register", "range": [ 156, 164 ], "loc": { "start": { "line": 4, "column": 29 }, "end": { "line": 4, "column": 37 } } }, "range": [ 144, 164 ], "loc": { "start": { "line": 4, "column": 17 }, "end": { "line": 4, "column": 37 } } }, "range": [ 135, 164 ], "loc": { "start": { "line": 4, "column": 8 }, "end": { "line": 4, "column": 37 } } }, "consequent": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "ObjectExpression", "properties": [ { "type": "Property", "key": { "type": "Identifier", "name": "plugins", "range": [ 213, 220 ], "loc": { "start": { "line": 6, "column": 17 }, "end": { "line": 6, "column": 24 } } }, "value": { "type": "ArrayExpression", "elements": [ { "type": "SpreadElement", "argument": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "state", "range": [ 227, 232 ], "loc": { "start": { "line": 6, "column": 31 }, "end": { "line": 6, "column": 36 } } }, "property": { "type": "Identifier", "name": "plugins", "range": [ 233, 240 ], "loc": { "start": { "line": 6, "column": 37 }, "end": { "line": 6, "column": 44 } } }, "range": [ 227, 240 ], "loc": { "start": { "line": 6, "column": 31 }, "end": { "line": 6, "column": 44 } } }, "range": [ 224, 240 ], "loc": { "start": { "line": 6, "column": 28 }, "end": { "line": 6, "column": 44 } } }, { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "payload", "range": [ 242, 249 ], "loc": { "start": { "line": 6, "column": 46 }, "end": { "line": 6, "column": 53 } } }, "property": { "type": "Identifier", "name": "id", "range": [ 250, 252 ], "loc": { "start": { "line": 6, "column": 54 }, "end": { "line": 6, "column": 56 } } }, "range": [ 242, 252 ], "loc": { "start": { "line": 6, "column": 46 }, "end": { "line": 6, "column": 56 } } } ], "range": [ 222, 254 ], "loc": { "start": { "line": 6, "column": 26 }, "end": { "line": 6, "column": 58 } } }, "kind": "init", "method": false, "shorthand": false, "computed": false, "range": [ 213, 254 ], "loc": { "start": { "line": 6, "column": 17 }, "end": { "line": 6, "column": 58 } } } ], "range": [ 211, 256 ], "loc": { "start": { "line": 6, "column": 15 }, "end": { "line": 6, "column": 60 } } }, "range": [ 204, 257 ], "loc": { "start": { "line": 6, "column": 8 }, "end": { "line": 6, "column": 61 } }, "leadingComments": [ { "type": "Line", "value": " Add new plugin", "range": [ 177, 194 ], "loc": { "start": { "line": 5, "column": 8 }, "end": { "line": 5, "column": 25 } } } ] } ], "range": [ 166, 264 ], "loc": { "start": { "line": 4, "column": 39 }, "end": { "line": 7, "column": 5 } } }, "alternate": { "type": "IfStatement", "test": { "type": "BinaryExpression", "operator": "===", "left": { "type": "Identifier", "name": "type", "range": [ 274, 278 ], "loc": { "start": { "line": 7, "column": 15 }, "end": { "line": 7, "column": 19 } } }, "right": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "pluginTypes", "range": [ 283, 294 ], "loc": { "start": { "line": 7, "column": 24 }, "end": { "line": 7, "column": 35 } } }, "property": { "type": "Identifier", "name": "unregister", "range": [ 295, 305 ], "loc": { "start": { "line": 7, "column": 36 }, "end": { "line": 7, "column": 46 } } }, "range": [ 283, 305 ], "loc": { "start": { "line": 7, "column": 24 }, "end": { "line": 7, "column": 46 } } }, "range": [ 274, 305 ], "loc": { "start": { "line": 7, "column": 15 }, "end": { "line": 7, "column": 46 } } }, "consequent": { "type": "BlockStatement", "body": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "index", "range": [ 322, 327 ], "loc": { "start": { "line": 8, "column": 12 }, "end": { "line": 8, "column": 17 } } }, "init": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "state", "range": [ 330, 335 ], "loc": { "start": { "line": 8, "column": 20 }, "end": { "line": 8, "column": 25 } } }, "property": { "type": "Identifier", "name": "plugins", "range": [ 336, 343 ], "loc": { "start": { "line": 8, "column": 26 }, "end": { "line": 8, "column": 33 } } }, "range": [ 330, 343 ], "loc": { "start": { "line": 8, "column": 20 }, "end": { "line": 8, "column": 33 } } }, "property": { "type": "Identifier", "name": "indexOf", "range": [ 344, 351 ], "loc": { "start": { "line": 8, "column": 34 }, "end": { "line": 8, "column": 41 } } }, "range": [ 330, 351 ], "loc": { "start": { "line": 8, "column": 20 }, "end": { "line": 8, "column": 41 } } }, "arguments": [ { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "payload", "range": [ 352, 359 ], "loc": { "start": { "line": 8, "column": 42 }, "end": { "line": 8, "column": 49 } } }, "property": { "type": "Identifier", "name": "id", "range": [ 360, 362 ], "loc": { "start": { "line": 8, "column": 50 }, "end": { "line": 8, "column": 52 } } }, "range": [ 352, 362 ], "loc": { "start": { "line": 8, "column": 42 }, "end": { "line": 8, "column": 52 } } } ], "range": [ 330, 363 ], "loc": { "start": { "line": 8, "column": 20 }, "end": { "line": 8, "column": 53 } } }, "range": [ 322, 363 ], "loc": { "start": { "line": 8, "column": 12 }, "end": { "line": 8, "column": 53 } } } ], "kind": "let", "range": [ 318, 364 ], "loc": { "start": { "line": 8, "column": 8 }, "end": { "line": 8, "column": 54 } } }, { "type": "ReturnStatement", "argument": { "type": "ObjectExpression", "properties": [ { "type": "Property", "key": { "type": "Identifier", "name": "plugins", "range": [ 396, 403 ], "loc": { "start": { "line": 10, "column": 12 }, "end": { "line": 10, "column": 19 } } }, "value": { "type": "ArrayExpression", "elements": [ { "type": "SpreadElement", "argument": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "state", "range": [ 427, 432 ], "loc": { "start": { "line": 11, "column": 19 }, "end": { "line": 11, "column": 24 } } }, "property": { "type": "Identifier", "name": "plugins", "range": [ 433, 440 ], "loc": { "start": { "line": 11, "column": 25 }, "end": { "line": 11, "column": 32 } } }, "range": [ 427, 440 ], "loc": { "start": { "line": 11, "column": 19 }, "end": { "line": 11, "column": 32 } } }, "property": { "type": "Identifier", "name": "slice", "range": [ 441, 446 ], "loc": { "start": { "line": 11, "column": 33 }, "end": { "line": 11, "column": 38 } } }, "range": [ 427, 446 ], "loc": { "start": { "line": 11, "column": 19 }, "end": { "line": 11, "column": 38 } } }, "arguments": [ { "type": "Literal", "value": 0, "raw": "0", "range": [ 447, 448 ], "loc": { "start": { "line": 11, "column": 39 }, "end": { "line": 11, "column": 40 } } }, { "type": "Identifier", "name": "index", "range": [ 450, 455 ], "loc": { "start": { "line": 11, "column": 42 }, "end": { "line": 11, "column": 47 } } } ], "range": [ 427, 456 ], "loc": { "start": { "line": 11, "column": 19 }, "end": { "line": 11, "column": 48 } } }, "range": [ 424, 456 ], "loc": { "start": { "line": 11, "column": 16 }, "end": { "line": 11, "column": 48 } } }, { "type": "SpreadElement", "argument": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "MemberExpression",