UNPKG

@eastsideco/escshopify

Version:

WIP JS library for Shopify, containing a variety of useful functionality.

1,769 lines (1,768 loc) 964 kB
{ "type": "File", "start": 0, "end": 8149, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 272, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 8149, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 272, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 24, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 24 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 7, "end": 11, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 11 } }, "local": { "type": "Identifier", "start": 7, "end": 11, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 11 }, "identifierName": "Evee" }, "name": "Evee" } } ], "source": { "type": "StringLiteral", "start": 17, "end": 23, "loc": { "start": { "line": 1, "column": 17 }, "end": { "line": 1, "column": 23 } }, "extra": { "rawValue": "evee", "raw": "'evee'" }, "value": "evee" } }, { "type": "ImportDeclaration", "start": 25, "end": 54, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 29 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 32, "end": 37, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 12 } }, "local": { "type": "Identifier", "start": 32, "end": 37, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 12 }, "identifierName": "Money" }, "name": "Money" } } ], "source": { "type": "StringLiteral", "start": 43, "end": 53, "loc": { "start": { "line": 2, "column": 18 }, "end": { "line": 2, "column": 28 } }, "extra": { "rawValue": "js-money", "raw": "'js-money'" }, "value": "js-money" } }, { "type": "ImportDeclaration", "start": 55, "end": 85, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 30 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 62, "end": 68, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 13 } }, "local": { "type": "Identifier", "start": 62, "end": 68, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 13 }, "identifierName": "config" }, "name": "config" } } ], "source": { "type": "StringLiteral", "start": 74, "end": 84, "loc": { "start": { "line": 3, "column": 19 }, "end": { "line": 3, "column": 29 } }, "extra": { "rawValue": "./config", "raw": "'./config'" }, "value": "./config" } }, { "type": "ImportDeclaration", "start": 86, "end": 114, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 28 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 93, "end": 98, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 12 } }, "local": { "type": "Identifier", "start": 93, "end": 98, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 12 }, "identifierName": "state" }, "name": "state" } } ], "source": { "type": "StringLiteral", "start": 104, "end": 113, "loc": { "start": { "line": 4, "column": 18 }, "end": { "line": 4, "column": 27 } }, "extra": { "rawValue": "./state", "raw": "'./state'" }, "value": "./state" } }, { "type": "ImportDeclaration", "start": 115, "end": 137, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 22 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 122, "end": 125, "loc": { "start": { "line": 5, "column": 7 }, "end": { "line": 5, "column": 10 } }, "local": { "type": "Identifier", "start": 122, "end": 125, "loc": { "start": { "line": 5, "column": 7 }, "end": { "line": 5, "column": 10 }, "identifierName": "log" }, "name": "log" } } ], "source": { "type": "StringLiteral", "start": 131, "end": 136, "loc": { "start": { "line": 5, "column": 16 }, "end": { "line": 5, "column": 21 } }, "extra": { "rawValue": "log", "raw": "'log'" }, "value": "log" } }, { "type": "ImportDeclaration", "start": 138, "end": 180, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 42 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 145, "end": 157, "loc": { "start": { "line": 6, "column": 7 }, "end": { "line": 6, "column": 19 } }, "local": { "type": "Identifier", "start": 145, "end": 157, "loc": { "start": { "line": 6, "column": 7 }, "end": { "line": 6, "column": 19 }, "identifierName": "MoneySpanSet" }, "name": "MoneySpanSet" } } ], "source": { "type": "StringLiteral", "start": 163, "end": 179, "loc": { "start": { "line": 6, "column": 25 }, "end": { "line": 6, "column": 41 } }, "extra": { "rawValue": "./MoneySpanSet", "raw": "'./MoneySpanSet'" }, "value": "./MoneySpanSet" } }, { "type": "ImportDeclaration", "start": 181, "end": 217, "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 7, "column": 36 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 188, "end": 197, "loc": { "start": { "line": 7, "column": 7 }, "end": { "line": 7, "column": 16 } }, "local": { "type": "Identifier", "start": 188, "end": 197, "loc": { "start": { "line": 7, "column": 7 }, "end": { "line": 7, "column": 16 }, "identifierName": "MoneySpan" }, "name": "MoneySpan" } } ], "source": { "type": "StringLiteral", "start": 203, "end": 216, "loc": { "start": { "line": 7, "column": 22 }, "end": { "line": 7, "column": 35 } }, "extra": { "rawValue": "./MoneySpan", "raw": "'./MoneySpan'" }, "value": "./MoneySpan" } }, { "type": "ImportDeclaration", "start": 218, "end": 282, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 8, "column": 64 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 225, "end": 243, "loc": { "start": { "line": 8, "column": 7 }, "end": { "line": 8, "column": 25 } }, "local": { "type": "Identifier", "start": 225, "end": 243, "loc": { "start": { "line": 8, "column": 7 }, "end": { "line": 8, "column": 25 }, "identifierName": "GeoserviceResolver" }, "name": "GeoserviceResolver" } } ], "source": { "type": "StringLiteral", "start": 249, "end": 281, "loc": { "start": { "line": 8, "column": 31 }, "end": { "line": 8, "column": 63 } }, "extra": { "rawValue": "./resolvers/GeoserviceResolver", "raw": "'./resolvers/GeoserviceResolver'" }, "value": "./resolvers/GeoserviceResolver" } }, { "type": "ImportDeclaration", "start": 283, "end": 344, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 9, "column": 61 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 290, "end": 306, "loc": { "start": { "line": 9, "column": 7 }, "end": { "line": 9, "column": 23 } }, "local": { "type": "Identifier", "start": 290, "end": 306, "loc": { "start": { "line": 9, "column": 7 }, "end": { "line": 9, "column": 23 }, "identifierName": "DefaultFormatter" }, "name": "DefaultFormatter" } } ], "source": { "type": "StringLiteral", "start": 312, "end": 343, "loc": { "start": { "line": 9, "column": 29 }, "end": { "line": 9, "column": 60 } }, "extra": { "rawValue": "./formatters/DefaultFormatter", "raw": "'./formatters/DefaultFormatter'" }, "value": "./formatters/DefaultFormatter" } }, { "type": "ImportDeclaration", "start": 345, "end": 395, "loc": { "start": { "line": 10, "column": 0 }, "end": { "line": 10, "column": 50 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 352, "end": 364, "loc": { "start": { "line": 10, "column": 7 }, "end": { "line": 10, "column": 19 } }, "local": { "type": "Identifier", "start": 352, "end": 364, "loc": { "start": { "line": 10, "column": 7 }, "end": { "line": 10, "column": 19 }, "identifierName": "SelectHelper" }, "name": "SelectHelper" } } ], "source": { "type": "StringLiteral", "start": 370, "end": 394, "loc": { "start": { "line": 10, "column": 25 }, "end": { "line": 10, "column": 49 } }, "extra": { "rawValue": "./helpers/SelectHelper", "raw": "'./helpers/SelectHelper'" }, "value": "./helpers/SelectHelper" } }, { "type": "ImportDeclaration", "start": 396, "end": 428, "loc": { "start": { "line": 11, "column": 0 }, "end": { "line": 11, "column": 32 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 403, "end": 410, "loc": { "start": { "line": 11, "column": 7 }, "end": { "line": 11, "column": 14 } }, "local": { "type": "Identifier", "start": 403, "end": 410, "loc": { "start": { "line": 11, "column": 7 }, "end": { "line": 11, "column": 14 }, "identifierName": "Session" }, "name": "Session" } } ], "source": { "type": "StringLiteral", "start": 416, "end": 427, "loc": { "start": { "line": 11, "column": 20 }, "end": { "line": 11, "column": 31 } }, "extra": { "rawValue": "./Session", "raw": "'./Session'" }, "value": "./Session" } }, { "type": "ImportDeclaration", "start": 429, "end": 462, "loc": { "start": { "line": 12, "column": 0 }, "end": { "line": 12, "column": 33 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 437, "end": 447, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 18 } }, "imported": { "type": "Identifier", "start": 437, "end": 447, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 18 }, "identifierName": "geoService" }, "name": "geoService" }, "local": { "type": "Identifier", "start": 437, "end": 447, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 18 }, "identifierName": "geoService" }, "name": "geoService" } } ], "source": { "type": "StringLiteral", "start": 454, "end": 461, "loc": { "start": { "line": 12, "column": 25 }, "end": { "line": 12, "column": 32 } }, "extra": { "rawValue": "index", "raw": "'index'" }, "value": "index" }, "trailingComments": [ { "type": "CommentBlock", "value": "* @ignore ", "start": 464, "end": 478, "loc": { "start": { "line": 14, "column": 0 }, "end": { "line": 14, "column": 14 } } } ] }, { "type": "VariableDeclaration", "start": 479, "end": 506, "loc": { "start": { "line": 15, "column": 0 }, "end": { "line": 15, "column": 27 } }, "declarations": [ { "type": "VariableDeclarator", "start": 485, "end": 505, "loc": { "start": { "line": 15, "column": 6 }, "end": { "line": 15, "column": 26 } }, "id": { "type": "Identifier", "start": 485, "end": 488, "loc": { "start": { "line": 15, "column": 6 }, "end": { "line": 15, "column": 9 }, "identifierName": "TAG" }, "name": "TAG", "leadingComments": null }, "init": { "type": "StringLiteral", "start": 491, "end": 505, "loc": { "start": { "line": 15, "column": 12 }, "end": { "line": 15, "column": 26 } }, "extra": { "rawValue": "EasyCurrency", "raw": "'EasyCurrency'" }, "value": "EasyCurrency" }, "leadingComments": null } ], "kind": "const", "leadingComments": [ { "type": "CommentBlock", "value": "* @ignore ", "start": 464, "end": 478, "loc": { "start": { "line": 14, "column": 0 }, "end": { "line": 14, "column": 14 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "* @ignore ", "start": 508, "end": 522, "loc": { "start": { "line": 17, "column": 0 }, "end": { "line": 17, "column": 14 } } } ] }, { "type": "VariableDeclaration", "start": 523, "end": 545, "loc": { "start": { "line": 18, "column": 0 }, "end": { "line": 18, "column": 22 } }, "declarations": [ { "type": "VariableDeclarator", "start": 527, "end": 544, "loc": { "start": { "line": 18, "column": 4 }, "end": { "line": 18, "column": 21 } }, "id": { "type": "Identifier", "start": 527, "end": 540, "loc": { "start": { "line": 18, "column": 4 }, "end": { "line": 18, "column": 17 }, "identifierName": "instanceCount" }, "name": "instanceCount", "leadingComments": null }, "init": { "type": "NumericLiteral", "start": 543, "end": 544, "loc": { "start": { "line": 18, "column": 20 }, "end": { "line": 18, "column": 21 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 }, "leadingComments": null } ], "kind": "var", "leadingComments": [ { "type": "CommentBlock", "value": "* @ignore ", "start": 508, "end": 522, "loc": { "start": { "line": 17, "column": 0 }, "end": { "line": 17, "column": 14 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "*\n * Plugin for automatic currency conversion, tax handling, etc.\n * @extends {evee}\n * @private\n ", "start": 547, "end": 649, "loc": { "start": { "line": 20, "column": 0 }, "end": { "line": 24, "column": 3 } } } ] }, { "type": "ExportDefaultDeclaration", "start": 650, "end": 8148, "loc": { "start": { "line": 25, "column": 0 }, "end": { "line": 271, "column": 1 } }, "declaration": { "type": "ClassDeclaration", "start": 665, "end": 8148, "loc": { "start": { "line": 25, "column": 15 }, "end": { "line": 271, "column": 1 } }, "id": { "type": "Identifier", "start": 671, "end": 683, "loc": { "start": { "line": 25, "column": 21 }, "end": { "line": 25, "column": 33 }, "identifierName": "EasyCurrency" }, "name": "EasyCurrency", "leadingComments": null }, "superClass": { "type": "Identifier", "start": 692, "end": 696, "loc": { "start": { "line": 25, "column": 42 }, "end": { "line": 25, "column": 46 }, "identifierName": "Evee" }, "name": "Evee" }, "body": { "type": "ClassBody", "start": 697, "end": 8148, "loc": { "start": { "line": 25, "column": 47 }, "end": { "line": 271, "column": 1 } }, "body": [ { "type": "ClassMethod", "start": 895, "end": 1880, "loc": { "start": { "line": 32, "column": 4 }, "end": { "line": 55, "column": 5 } }, "static": false, "computed": false, "key": { "type": "Identifier", "start": 895, "end": 906, "loc": { "start": { "line": 32, "column": 4 }, "end": { "line": 32, "column": 15 }, "identifierName": "constructor" }, "name": "constructor", "leadingComments": null }, "kind": "constructor", "id": null, "generator": false, "expression": false, "async": false, "params": [], "body": { "type": "BlockStatement", "start": 909, "end": 1880, "loc": { "start": { "line": 32, "column": 18 }, "end": { "line": 55, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 919, "end": 927, "loc": { "start": { "line": 33, "column": 8 }, "end": { "line": 33, "column": 16 } }, "expression": { "type": "CallExpression", "start": 919, "end": 926, "loc": { "start": { "line": 33, "column": 8 }, "end": { "line": 33, "column": 15 } }, "callee": { "type": "Super", "start": 919, "end": 924, "loc": { "start": { "line": 33, "column": 8 }, "end": { "line": 33, "column": 13 } } }, "arguments": [] } }, { "type": "ExpressionStatement", "start": 937, "end": 953, "loc": { "start": { "line": 35, "column": 8 }, "end": { "line": 35, "column": 24 } }, "expression": { "type": "UpdateExpression", "start": 937, "end": 952, "loc": { "start": { "line": 35, "column": 8 }, "end": { "line": 35, "column": 23 } }, "operator": "++", "prefix": false, "argument": { "type": "Identifier", "start": 937, "end": 950, "loc": { "start": { "line": 35, "column": 8 }, "end": { "line": 35, "column": 21 }, "identifierName": "instanceCount" }, "name": "instanceCount" } } }, { "type": "IfStatement", "start": 962, "end": 1119, "loc": { "start": { "line": 36, "column": 8 }, "end": { "line": 38, "column": 9 } }, "test": { "type": "BinaryExpression", "start": 966, "end": 983, "loc": { "start": { "line": 36, "column": 12 }, "end": { "line": 36, "column": 29 } }, "left": { "type": "Identifier", "start": 966, "end": 979, "loc": { "start": { "line": 36, "column": 12 }, "end": { "line": 36, "column": 25 }, "identifierName": "instanceCount" }, "name": "instanceCount" }, "operator": ">", "right": { "type": "NumericLiteral", "start": 982, "end": 983, "loc": { "start": { "line": 36, "column": 28 }, "end": { "line": 36, "column": 29 } }, "extra": { "rawValue": 1, "raw": "1" }, "value": 1 } }, "consequent": { "type": "BlockStatement", "start": 985, "end": 1119, "loc": { "start": { "line": 36, "column": 31 }, "end": { "line": 38, "column": 9 } }, "body": [ { "type": "ExpressionStatement", "start": 999, "end": 1109, "loc": { "start": { "line": 37, "column": 12 }, "end": { "line": 37, "column": 122 } }, "expression": { "type": "CallExpression", "start": 999, "end": 1108, "loc": { "start": { "line": 37, "column": 12 }, "end": { "line": 37, "column": 121 } }, "callee": { "type": "MemberExpression", "start": 999, "end": 1007, "loc": { "start": { "line": 37, "column": 12 }, "end": { "line": 37, "column": 20 } }, "object": { "type": "Identifier", "start": 999, "end": 1002, "loc": { "start": { "line": 37, "column": 12 }, "end": { "line": 37, "column": 15 }, "identifierName": "log" }, "name": "log" }, "property": { "type": "Identifier", "start": 1003, "end": 1007, "loc": { "start": { "line": 37, "column": 16 }, "end": { "line": 37, "column": 20 }, "identifierName": "warn" }, "name": "warn" }, "computed": false }, "arguments": [ { "type": "Identifier", "start": 1008, "end": 1011, "loc": { "start": { "line": 37, "column": 21 }, "end": { "line": 37, "column": 24 }, "identifierName": "TAG" }, "name": "TAG" }, { "type": "StringLiteral", "start": 1013, "end": 1107, "loc": { "start": { "line": 37, "column": 26 }, "end": { "line": 37, "column": 120 } }, "extra": { "rawValue": "More than one instance of EasyCurrency has been created. This may cause unexpected behavior.", "raw": "'More than one instance of EasyCurrency has been created. This may cause unexpected behavior.'" }, "value": "More than one instance of EasyCurrency has been created. This may cause unexpected behavior." } ] } } ], "directives": [], "trailingComments": null }, "alternate": null, "trailingComments": [ { "type": "CommentBlock", "value": "* @type {src/easycurrency/config.js~Config} ", "start": 1129, "end": 1177, "loc": { "start": { "line": 40, "column": 8 }, "end": { "line": 40, "column": 56 } } } ] }, { "type": "ExpressionStatement", "start": 1186, "end": 1208, "loc": { "start": { "line": 41, "column": 8 }, "end": { "line": 41, "column": 30 } }, "expression": { "type": "AssignmentExpression", "start": 1186, "end": 1207, "loc": { "start": { "line": 41, "column": 8 }, "end": { "line": 41, "column": 29 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 1186, "end": 1198, "loc": { "start": { "line": 41, "column": 8 }, "end": { "line": 41, "column": 20 } }, "object": { "type": "ThisExpression", "start": 1186, "end": 1190, "loc": { "start": { "line": 41, "column": 8 }, "end": { "line": 41, "column": 12 } }, "leadingComments": null }, "property": { "type": "Identifier", "start": 1191, "end": 1198, "loc": { "start": { "line": 41, "column": 13 }, "end": { "line": 41, "column": 20 }, "identifierName": "_config" }, "name": "_config" }, "computed": false, "leadingComments": null }, "right": { "type": "Identifier", "start": 1201, "end": 1207, "loc": { "start": { "line": 41, "column": 23 }, "end": { "line": 41, "column": 29 }, "identifierName": "config" }, "name": "config" }, "leadingComments": null }, "leadingComments": [ { "type": "CommentBlock", "value": "* @type {src/easycurrency/config.js~Config} ", "start": 1129, "end": 1177, "loc": { "start": { "line": 40, "column": 8 }, "end": { "line": 40, "column": 56 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "* @type {src/easycurrency/resolvers/CurrencyResolver.js~CurrencyResolver} ", "start": 1217, "end": 1295, "loc": { "start": { "line": 42, "column": 8 }, "end": { "line": 42, "column": 86 } } } ] }, { "type": "ExpressionStatement", "start": 1304, "end": 1326, "loc": { "start": { "line": 43, "column": 8 }, "end": { "line": 43, "column": 30 } }, "expression": { "type": "AssignmentExpression", "start": 1304, "end": 1325, "loc": { "start": { "line": 43, "column": 8 }, "end": { "line": 43, "column": 29 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 1304, "end": 1318, "loc": { "start": { "line": 43, "column": 8 }, "end": { "line": 43, "column": 22 } }, "object": { "type": "ThisExpression", "start": 1304, "end": 1308, "loc": { "start": { "line": 43, "column": 8 }, "end": { "line": 43, "column": 12 } }, "leadingComments": null }, "property": { "type": "Identifier", "start": 1309, "end": 1318, "loc": { "start": { "line": 43, "column": 13 }, "end": { "line": 43, "column": 22