UNPKG

@eastsideco/escshopify

Version:

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

1,840 lines (1,839 loc) 1.55 MB
{ "type": "File", "start": 0, "end": 8938, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 300, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 8938, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 300, "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": 392, "loc": { "start": { "line": 10, "column": 0 }, "end": { "line": 10, "column": 47 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 352, "end": 361, "loc": { "start": { "line": 10, "column": 7 }, "end": { "line": 10, "column": 16 } }, "local": { "type": "Identifier", "start": 352, "end": 361, "loc": { "start": { "line": 10, "column": 7 }, "end": { "line": 10, "column": 16 }, "identifierName": "Formatter" }, "name": "Formatter" } } ], "source": { "type": "StringLiteral", "start": 367, "end": 391, "loc": { "start": { "line": 10, "column": 22 }, "end": { "line": 10, "column": 46 } }, "extra": { "rawValue": "./formatters/Formatter", "raw": "'./formatters/Formatter'" }, "value": "./formatters/Formatter" } }, { "type": "ImportDeclaration", "start": 393, "end": 453, "loc": { "start": { "line": 11, "column": 0 }, "end": { "line": 11, "column": 60 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 400, "end": 416, "loc": { "start": { "line": 11, "column": 7 }, "end": { "line": 11, "column": 23 } }, "local": { "type": "Identifier", "start": 400, "end": 416, "loc": { "start": { "line": 11, "column": 7 }, "end": { "line": 11, "column": 23 }, "identifierName": "CurrencyResolver" }, "name": "CurrencyResolver" } } ], "source": { "type": "StringLiteral", "start": 422, "end": 452, "loc": { "start": { "line": 11, "column": 29 }, "end": { "line": 11, "column": 59 } }, "extra": { "rawValue": "./resolvers/CurrencyResolver", "raw": "'./resolvers/CurrencyResolver'" }, "value": "./resolvers/CurrencyResolver" } }, { "type": "ImportDeclaration", "start": 454, "end": 504, "loc": { "start": { "line": 12, "column": 0 }, "end": { "line": 12, "column": 50 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 461, "end": 473, "loc": { "start": { "line": 12, "column": 7 }, "end": { "line": 12, "column": 19 } }, "local": { "type": "Identifier", "start": 461, "end": 473, "loc": { "start": { "line": 12, "column": 7 }, "end": { "line": 12, "column": 19 }, "identifierName": "SelectHelper" }, "name": "SelectHelper" } } ], "source": { "type": "StringLiteral", "start": 479, "end": 503, "loc": { "start": { "line": 12, "column": 25 }, "end": { "line": 12, "column": 49 } }, "extra": { "rawValue": "./helpers/SelectHelper", "raw": "'./helpers/SelectHelper'" }, "value": "./helpers/SelectHelper" } }, { "type": "ImportDeclaration", "start": 505, "end": 537, "loc": { "start": { "line": 13, "column": 0 }, "end": { "line": 13, "column": 32 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 512, "end": 519, "loc": { "start": { "line": 13, "column": 7 }, "end": { "line": 13, "column": 14 } }, "local": { "type": "Identifier", "start": 512, "end": 519, "loc": { "start": { "line": 13, "column": 7 }, "end": { "line": 13, "column": 14 }, "identifierName": "Session" }, "name": "Session" } } ], "source": { "type": "StringLiteral", "start": 525, "end": 536, "loc": { "start": { "line": 13, "column": 20 }, "end": { "line": 13, "column": 31 } }, "extra": { "rawValue": "./Session", "raw": "'./Session'" }, "value": "./Session" } }, { "type": "ImportDeclaration", "start": 538, "end": 595, "loc": { "start": { "line": 14, "column": 0 }, "end": { "line": 14, "column": 57 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 545, "end": 555, "loc": { "start": { "line": 14, "column": 7 }, "end": { "line": 14, "column": 17 } }, "local": { "type": "Identifier", "start": 545, "end": 555, "loc": { "start": { "line": 14, "column": 7 }, "end": { "line": 14, "column": 17 }, "identifierName": "GeoService" }, "name": "GeoService" } } ], "source": { "type": "StringLiteral", "start": 561, "end": 594, "loc": { "start": { "line": 14, "column": 23 }, "end": { "line": 14, "column": 56 } }, "extra": { "rawValue": "~/plugins/geoservice/GeoService", "raw": "'~/plugins/geoservice/GeoService'" }, "value": "~/plugins/geoservice/GeoService" }, "trailingComments": [ { "type": "CommentBlock", "value": "* @ignore ", "start": 597, "end": 611, "loc": { "start": { "line": 16, "column": 0 }, "end": { "line": 16, "column": 14 } } } ] }, { "type": "VariableDeclaration", "start": 612, "end": 639, "loc": { "start": { "line": 17, "column": 0 }, "end": { "line": 17, "column": 27 } }, "declarations": [ { "type": "VariableDeclarator", "start": 618, "end": 638, "loc": { "start": { "line": 17, "column": 6 }, "end": { "line": 17, "column": 26 } }, "id": { "type": "Identifier", "start": 618, "end": 621, "loc": { "start": { "line": 17, "column": 6 }, "end": { "line": 17, "column": 9 }, "identifierName": "TAG" }, "name": "TAG", "leadingComments": null }, "init": { "type": "StringLiteral", "start": 624, "end": 638, "loc": { "start": { "line": 17, "column": 12 }, "end": { "line": 17, "column": 26 } }, "extra": { "rawValue": "EasyCurrency", "raw": "'EasyCurrency'" }, "value": "EasyCurrency" }, "leadingComments": null } ], "kind": "const", "leadingComments": [ { "type": "CommentBlock", "value": "* @ignore ", "start": 597, "end": 611, "loc": { "start": { "line": 16, "column": 0 }, "end": { "line": 16, "column": 14 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "* @ignore ", "start": 641, "end": 655, "loc": { "start": { "line": 19, "column": 0 }, "end": { "line": 19, "column": 14 } } } ] }, { "type": "VariableDeclaration", "start": 656, "end": 678, "loc": { "start": { "line": 20, "column": 0 }, "end": { "line": 20, "column": 22 } }, "declarations": [ { "type": "VariableDeclarator", "start": 660, "end": 677, "loc": { "start": { "line": 20, "column": 4 }, "end": { "line": 20, "column": 21 } }, "id": { "type": "Identifier", "start": 660, "end": 673, "loc": { "start": { "line": 20, "column": 4 }, "end": { "line": 20, "column": 17 }, "identifierName": "instanceCount" }, "name": "instanceCount", "leadingComments": null }, "init": { "type": "NumericLiteral", "start": 676, "end": 677, "loc": { "start": { "line": 20, "column": 20 }, "end": { "line": 20, "column": 21 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 }, "leadingComments": null } ], "kind": "var", "leadingComments": [ { "type": "CommentBlock", "value": "* @ignore ", "start": 641, "end": 655, "loc": { "start": { "line": 19, "column": 0 }, "end": { "line": 19, "column": 14 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "*\n * Plugin for automatic currency conversion, tax handling, etc.\n * @extends {evee}\n * @private\n ", "start": 680, "end": 782, "loc": { "start": { "line": 22, "column": 0 }, "end": { "line": 26, "column": 3 } } } ] }, { "type": "Identifier", "start": 783, "end": 8715, "loc": { "start": { "line": 27, "column": 0 }, "end": { "line": 282, "column": 1 } }, "id": { "type": "Identifier", "start": 789, "end": 801, "loc": { "start": { "line": 27, "column": 6 }, "end": { "line": 27, "column": 18 }, "identifierName": "EasyCurrency" }, "name": "EasyCurrency", "leadingComments": null }, "superClass": { "type": "Identifier", "start": 810, "end": 814, "loc": { "start": { "line": 27, "column": 27 }, "end": { "line": 27, "column": 31 }, "identifierName": "Evee" }, "name": "Evee" }, "body": { "type": "ClassBody", "start": 815, "end": 8715, "loc": { "start": { "line": 27, "column": 32 }, "end": { "line": 282, "column": 1 } }, "body": [ { "type": "ClassMethod", "start": 1013, "end": 2083, "loc": { "start": { "line": 34, "column": 4 }, "end": { "line": 58, "column": 5 } }, "static": false, "computed": false, "key": { "type": "Identifier", "start": 1013, "end": 1024, "loc": { "start": { "line": 34, "column": 4 }, "end": { "line": 34, "column": 15 }, "identifierName": "constructor" }, "name": "constructor", "leadingComments": null }, "kind": "constructor", "id": null, "generator": false, "expression": false, "async": false, "params": [], "body": { "type": "BlockStatement", "start": 1027, "end": 2083, "loc": { "start": { "line": 34, "column": 18 }, "end": { "line": 58, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 1037, "end": 1045, "loc": { "start": { "line": 35, "column": 8 }, "end": { "line": 35, "column": 16 } }, "expression": { "type": "CallExpression", "start": 1037, "end": 1044, "loc": { "start": { "line": 35, "column": 8 }, "end": { "line": 35, "column": 15 } }, "callee": { "type": "Super", "start": 1037, "end": 1042, "loc": { "start": { "line": 35, "column": 8 }, "end": { "line": 35, "column": 13 } } }, "arguments": [] } }, { "type": "ExpressionStatement", "start": 1055, "end": 1071, "loc": { "start": { "line": 37, "column": 8 }, "end": { "line": 37, "column": 24 } }, "expression": { "type": "UpdateExpression", "start": 1055, "end": 1070, "loc": { "start": { "line": 37, "column": 8 }, "end": { "line": 37, "column": 23 } }, "operator": "++", "prefix": false, "argument": { "type": "Identifier", "start": 1055, "end": 1068, "loc": { "start": { "line": 37, "column": 8 }, "end": { "line": 37, "column": 21 }, "identifierName": "instanceCount" }, "name": "instanceCount" } } }, { "type": "VariableDeclaration", "start": 1084, "end": 1100, "loc": { "start": { "line": 38, "column": 12 }, "end": { "line": 38, "column": 28 } }, "declarations": [ { "type": "VariableDeclarator", "start": 1088, "end": 1099, "loc": { "start": { "line": 38, "column": 16 }, "end": { "line": 38, "column": 27 } }, "id": { "type": "Identifier", "start": 1088, "end": 1094, "loc": { "start": { "line": 38, "column": 16 }, "end": { "line": 38, "column": 22 }, "identifierName": "styles" }, "name": "styles" }, "init": { "type": "ArrayExpression", "start": 1097, "end": 1099, "loc": { "start": { "line": 38, "column": 25 }, "end": { "line": 38, "column": 27 } }, "elements": [] } } ], "kind": "var" }, { "type": "IfStatement", "start": 1109, "end": 1266, "loc": { "start": { "line": 39, "column": 8 }, "end": { "line": 41, "column": 9 } }, "test": { "type": "BinaryExpression", "start": 1113, "end": 1130, "loc": { "start": { "line": 39, "column": 12 }, "end": { "line": 39, "column": 29 } }, "left": { "type": "Identifier", "start": 1113, "end": 1126, "loc": { "start": { "line": 39, "column": 12 }, "end": { "line": 39, "column": 25 }, "identifierName": "instanceCount" }, "name": "instanceCount" }, "operator": ">", "right": { "type": "NumericLiteral", "start": 1129, "end": 1130, "loc": { "start": { "line": 39, "column": 28 }, "end": { "line": 39, "column": 29 } }, "extra": { "rawValue": 1, "raw": "1" }, "value": 1 } }, "consequent": { "type": "BlockStatement", "start": 1132, "end": 1266, "loc": { "start": { "line": 39, "column": 31 }, "end": { "line": 41, "column": 9 } }, "body": [ { "type": "ExpressionStatement", "start": 1146, "end": 1256, "loc": { "start": { "line": 40, "column": 12 }, "end": { "line": 40, "column": 122 } }, "expression": { "type": "CallExpression", "start": 1146, "end": 1255, "loc": { "start": { "line": 40, "column": 12 }, "end": { "line": 40, "column": 121 } }, "callee": { "type": "MemberExpression", "start": 1146, "end": 1154, "loc": { "start": { "line": 40, "column": 12 }, "end": { "line": 40, "column": 20 } }, "object": { "type": "Identifier", "start": 1146, "end": 1149, "loc": { "start": { "line": 40, "column": 12 }, "end": { "line": 40, "column": 15 }, "identifierName": "log" }, "name": "log" }, "property": { "type": "Identifier", "start": 1150, "end": 1154, "loc": { "start": { "line": 40, "column": 16 }, "end": { "line": 40, "column": 20 }, "identifierName": "warn" }, "name": "warn" }, "computed": false }, "arguments": [ { "type": "Identifier", "start": 1155, "end": 1158, "loc": { "start": { "line": 40, "column": 21 }, "end": { "line": 40, "column": 24 }, "identifierName": "TAG" }, "name": "TAG" }, { "type": "StringLiteral", "start": 1160, "end": 1254, "loc": { "start": { "line": 40, "column": 26 }, "end": { "line": 40, "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/plugins/easycurrency/config.js~Config} ", "start": 1276, "end": 1332, "loc": { "start": { "line": 43, "column": 8 }, "end": { "line": 43, "column": 64 } } } ] }, { "type": "ExpressionStatement", "start": 1341, "end": 1363, "loc": { "start": { "line": 44, "column": 8 }, "end": { "line": 44, "column": 30 } }, "expression": { "type": "AssignmentExpression", "start": 1341, "end": 1362, "loc": { "start": { "line": 44, "column": 8 }, "end": { "line": 44, "column": 29 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 1341, "end": 1353, "loc": { "start": { "line": 44, "column": 8 }, "end": { "line": 44, "column": 20 } }, "object": { "type": "ThisExpression", "start": 1341, "end": 1345, "loc": { "start": { "line": 44, "column": 8 }, "end": { "line": 44, "column": 12 } }, "leadingComments": null }, "property": { "type": "Identifier", "start": 1346, "end": 1353, "loc": { "start": { "line": 44, "column": 13 }, "end": { "line": 44, "column": 20 }, "identifierName": "_config" }, "name": "_config" }, "computed": false, "leadingComments": null }, "right": { "type": "Identifier", "start": 1356, "end": 1362, "loc": { "start": { "line": 44, "column": 23 }, "end": { "line": 44, "column": 29 }, "identifierName": "config" }, "name": "config" }, "leadingComments": null }, "leadingComments": [ { "type": "CommentBlock", "value": "* @type {src/plugins/easycurrency/config.js~Config} ", "start": 1276, "end": 1332,