UNPKG

@eastsideco/escshopify

Version:

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

1,915 lines 48.6 kB
{ "type": "File", "start": 0, "end": 317, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 18, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 317, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 18, "column": 0 } }, "sourceType": "module", "body": [ { "type": "Identifier", "start": 53, "end": 272, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 14, "column": 1 } }, "id": { "type": "Identifier", "start": 59, "end": 64, "loc": { "start": { "line": 4, "column": 6 }, "end": { "line": 4, "column": 11 }, "identifierName": "State" }, "name": "State", "leadingComments": null }, "superClass": null, "body": { "type": "ClassBody", "start": 65, "end": 272, "loc": { "start": { "line": 4, "column": 12 }, "end": { "line": 14, "column": 1 } }, "body": [ { "type": "ClassMethod", "start": 128, "end": 270, "loc": { "start": { "line": 8, "column": 4 }, "end": { "line": 13, "column": 5 } }, "static": false, "computed": false, "key": { "type": "Identifier", "start": 128, "end": 139, "loc": { "start": { "line": 8, "column": 4 }, "end": { "line": 8, "column": 15 }, "identifierName": "constructor" }, "name": "constructor", "leadingComments": null }, "kind": "constructor", "id": null, "generator": false, "expression": false, "async": false, "params": [], "body": { "type": "BlockStatement", "start": 142, "end": 270, "loc": { "start": { "line": 8, "column": 18 }, "end": { "line": 13, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 187, "end": 208, "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 29 } }, "expression": { "type": "AssignmentExpression", "start": 187, "end": 207, "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 28 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 187, "end": 200, "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 21 } }, "object": { "type": "ThisExpression", "start": 187, "end": 191, "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 12 } }, "leadingComments": null }, "property": { "type": "Identifier", "start": 192, "end": 200, "loc": { "start": { "line": 10, "column": 13 }, "end": { "line": 10, "column": 21 }, "identifierName": "currency" }, "name": "currency" }, "computed": false, "leadingComments": null }, "right": { "type": "NullLiteral", "start": 203, "end": 207, "loc": { "start": { "line": 10, "column": 24 }, "end": { "line": 10, "column": 28 } } }, "leadingComments": null }, "leadingComments": [ { "type": "CommentBlock", "value": "* @type {null|String} ", "start": 152, "end": 178, "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 34 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "* @type {Number} ", "start": 217, "end": 238, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 29 } } } ] }, { "type": "ExpressionStatement", "start": 247, "end": 264, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 25 } }, "expression": { "type": "AssignmentExpression", "start": 247, "end": 263, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 24 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 247, "end": 259, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 20 } }, "object": { "type": "ThisExpression", "start": 247, "end": 251, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 12 } }, "leadingComments": null }, "property": { "type": "Identifier", "start": 252, "end": 259, "loc": { "start": { "line": 12, "column": 13 }, "end": { "line": 12, "column": 20 }, "identifierName": "taxRate" }, "name": "taxRate" }, "computed": false, "leadingComments": null }, "right": { "type": "NumericLiteral", "start": 262, "end": 263, "loc": { "start": { "line": 12, "column": 23 }, "end": { "line": 12, "column": 24 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 }, "leadingComments": null }, "leadingComments": [ { "type": "CommentBlock", "value": "* @type {Number} ", "start": 217, "end": 238, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 29 } } } ] } ], "directives": [] }, "leadingComments": [ { "type": "CommentBlock", "value": "*\n * Create new instance of the state.\n ", "start": 71, "end": 123, "loc": { "start": { "line": 5, "column": 4 }, "end": { "line": 7, "column": 7 } } } ] } ], "trailingComments": null }, "leadingComments": [], "trailingComments": [], "name": "_" }, { "type": "Identifier", "start": 289, "end": 316, "loc": { "start": { "line": 17, "column": 0 }, "end": { "line": 17, "column": 27 } }, "declaration": { "type": "NewExpression", "start": 304, "end": 315, "loc": { "start": { "line": 17, "column": 15 }, "end": { "line": 17, "column": 26 } }, "callee": { "type": "Identifier", "start": 308, "end": 313, "loc": { "start": { "line": 17, "column": 19 }, "end": { "line": 17, "column": 24 }, "identifierName": "State" }, "name": "State" }, "arguments": [], "leadingComments": null }, "leadingComments": [], "name": "_", "trailingComments": [] }, { "type": "ExportDefaultDeclaration", "start": 289, "end": 316, "loc": { "start": { "line": 17, "column": 0 }, "end": { "line": 17, "column": 27 } }, "declaration": { "type": "ClassDeclaration", "start": 53, "end": 272, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 14, "column": 1 } }, "id": { "type": "Identifier", "start": 59, "end": 64, "loc": { "start": { "line": 4, "column": 6 }, "end": { "line": 4, "column": 11 }, "identifierName": "State" }, "name": "State", "leadingComments": null }, "superClass": null, "body": { "type": "ClassBody", "start": 65, "end": 272, "loc": { "start": { "line": 4, "column": 12 }, "end": { "line": 14, "column": 1 } }, "body": [ { "type": "ClassMethod", "start": 128, "end": 270, "loc": { "start": { "line": 8, "column": 4 }, "end": { "line": 13, "column": 5 } }, "static": false, "computed": false, "key": { "type": "Identifier", "start": 128, "end": 139, "loc": { "start": { "line": 8, "column": 4 }, "end": { "line": 8, "column": 15 }, "identifierName": "constructor" }, "name": "constructor", "leadingComments": null }, "kind": "constructor", "id": null, "generator": false, "expression": false, "async": false, "params": [], "body": { "type": "BlockStatement", "start": 142, "end": 270, "loc": { "start": { "line": 8, "column": 18 }, "end": { "line": 13, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 187, "end": 208, "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 29 } }, "expression": { "type": "AssignmentExpression", "start": 187, "end": 207, "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 28 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 187, "end": 200, "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 21 } }, "object": { "type": "ThisExpression", "start": 187, "end": 191, "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 12 } }, "leadingComments": null }, "property": { "type": "Identifier", "start": 192, "end": 200, "loc": { "start": { "line": 10, "column": 13 }, "end": { "line": 10, "column": 21 }, "identifierName": "currency" }, "name": "currency" }, "computed": false, "leadingComments": null }, "right": { "type": "NullLiteral", "start": 203, "end": 207, "loc": { "start": { "line": 10, "column": 24 }, "end": { "line": 10, "column": 28 } } }, "leadingComments": null }, "leadingComments": [ { "type": "CommentBlock", "value": "* @type {null|String} ", "start": 152, "end": 178, "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 34 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "* @type {Number} ", "start": 217, "end": 238, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 29 } } } ] }, { "type": "ExpressionStatement", "start": 247, "end": 264, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 25 } }, "expression": { "type": "AssignmentExpression", "start": 247, "end": 263, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 24 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 247, "end": 259, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 20 } }, "object": { "type": "ThisExpression", "start": 247, "end": 251, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 12 } }, "leadingComments": null }, "property": { "type": "Identifier", "start": 252, "end": 259, "loc": { "start": { "line": 12, "column": 13 }, "end": { "line": 12, "column": 20 }, "identifierName": "taxRate" }, "name": "taxRate" }, "computed": false, "leadingComments": null }, "right": { "type": "NumericLiteral", "start": 262, "end": 263, "loc": { "start": { "line": 12, "column": 23 }, "end": { "line": 12, "column": 24 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 }, "leadingComments": null }, "leadingComments": [ { "type": "CommentBlock", "value": "* @type {Number} ", "start": 217, "end": 238, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 29 } } } ] } ], "directives": [] }, "leadingComments": [ { "type": "CommentBlock", "value": "*\n * Create new instance of the state.\n ", "start": 71, "end": 123, "loc": { "start": { "line": 5, "column": 4 }, "end": { "line": 7, "column": 7 } } } ] } ], "trailingComments": null }, "leadingComments": [ { "type": "CommentBlock", "value": "*\n * Represents the current currency settings.\n ", "start": 0, "end": 52, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 3, "column": 3 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "* @ignore ", "start": 274, "end": 288, "loc": { "start": { "line": 16, "column": 0 }, "end": { "line": 16, "column": 14 } } } ], "__PseudoExport__": true }, "leadingComments": null }, { "type": "ExportDefaultDeclaration", "start": 289, "end": 316, "loc": { "start": { "line": 17, "column": 0 }, "end": { "line": 17, "column": 27 } }, "declaration": { "type": "VariableDeclaration", "kind": "let", "loc": { "start": { "line": 17, "column": 0 }, "end": { "line": 17, "column": 27 } }, "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "state" }, "init": { "type": "NewExpression", "callee": { "type": "Identifier", "name": "State" } } } ], "leadingComments": [ { "type": "CommentBlock", "value": "* @ignore ", "start": 274, "end": 288, "loc": { "start": { "line": 16, "column": 0 }, "end": { "line": 16, "column": 14 } } } ], "trailingComments": [] }, "leadingComments": [ { "type": "CommentBlock", "value": "* @ignore ", "start": 274, "end": 288, "loc": { "start": { "line": 16, "column": 0 }, "end": { "line": 16, "column": 14 } } } ] } ], "directives": [] }, "comments": [ { "type": "CommentBlock", "value": "*\n * Represents the current currency settings.\n ", "start": 0, "end": 52, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 3, "column": 3 } } }, { "type": "CommentBlock", "value": "*\n * Create new instance of the state.\n ", "start": 71, "end": 123, "loc": { "start": { "line": 5, "column": 4 }, "end": { "line": 7, "column": 7 } } }, { "type": "CommentBlock", "value": "* @type {null|String} ", "start": 152, "end": 178, "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 34 } } }, { "type": "CommentBlock", "value": "* @type {Number} ", "start": 217, "end": 238, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 29 } } }, { "type": "CommentBlock", "value": "* @ignore ", "start": 274, "end": 288, "loc": { "start": { "line": 16, "column": 0 }, "end": { "line": 16, "column": 14 } } } ], "tokens": [ { "type": "CommentBlock", "value": "*\n * Represents the current currency settings.\n ", "start": 0, "end": 52, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 3, "column": 3 } } }, { "type": { "label": "class", "keyword": "class", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "class", "start": 53, "end": 58, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 5 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "State", "start": 59, "end": 64, "loc": { "start": { "line": 4, "column": 6 }, "end": { "line": 4, "column": 11 } } }, { "type": { "label": "{", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 65, "end": 66, "loc": { "start": { "line": 4, "column": 12 }, "end": { "line": 4, "column": 13 } } }, { "type": "CommentBlock", "value": "*\n * Create new instance of the state.\n ", "start": 71, "end": 123, "loc": { "start": { "line": 5, "column": 4 }, "end": { "line": 7, "column": 7 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "constructor", "start": 128, "end": 139, "loc": { "start": { "line": 8, "column": 4 }, "end": { "line": 8, "column": 15 } } }, { "type": { "label": "(", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 139, "end": 140, "loc": { "start": { "line": 8, "column": 15 }, "end": { "line": 8, "column": 16 } } }, { "type": { "label": ")", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 140, "end": 141, "loc": { "start": { "line": 8, "column": 16 }, "end": { "line": 8, "column": 17 } } }, { "type": { "label": "{", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 142, "end": 143, "loc": { "start": { "line": 8, "column": 18 }, "end": { "line": 8, "column": 19 } } }, { "type": "CommentBlock", "value": "* @type {null|String} ", "start": 152, "end": 178, "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 34 } } }, { "type": { "label": "this", "keyword": "this", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "this", "start": 187, "end": 191, "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 12 } } }, { "type": { "label": ".", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 191, "end": 192, "loc": { "start": { "line": 10, "column": 12 }, "end": { "line": 10, "column": 13 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "currency", "start": 192, "end": 200, "loc": { "start": { "line": 10, "column": 13 }, "end": { "line": 10, "column": 21 } } }, { "type": { "label": "=", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": true, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "=", "start": 201, "end": 202, "loc": { "start": { "line": 10, "column": 22 }, "end": { "line": 10, "column": 23 } } }, { "type": { "label": "null", "keyword": "null", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "null", "start": 203, "end": 207, "loc": { "start": { "line": 10, "column": 24 }, "end": { "line": 10, "column": 28 } } }, { "type": { "label": ";", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 207, "end": 208, "loc": { "start": { "line": 10, "column": 28 }, "end": { "line": 10, "column": 29 } } }, { "type": "CommentBlock", "value": "* @type {Number} ", "start": 217, "end": 238, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 29 } } }, { "type": { "label": "this", "keyword": "this", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "this", "start": 247, "end": 251, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 12 } } }, { "type": { "label": ".", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 251, "end": 252, "loc": { "start": { "line": 12, "column": 12 }, "end": { "line": 12, "column": 13 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "taxRate", "start": 252, "end": 259, "loc": { "start": { "line": 12, "column": 13 }, "end": { "line": 12, "column": 20 } } }, { "type": { "label": "=", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": true, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "=", "start": 260, "end": 261, "loc": { "start": { "line": 12, "column": 21 }, "end": { "line": 12, "column": 22 } } }, { "type": { "label": "num", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": 0, "start": 262, "end": 263, "loc": { "start": { "line": 12, "column": 23 }, "end": { "line": 12, "column": 24 } } }, { "type": { "label": ";", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 263, "end": 264, "loc": { "start": { "line": 12, "column": 24 }, "end": { "line": 12, "column": 25 } } }, { "type": { "label": "}", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 269, "end": 270, "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 13, "column": 5 } } }, { "type": { "label": "}", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 271, "end": 272, "loc": { "start": { "line": 14, "column": 0 }, "end": { "line": 14, "column": 1 } } }, { "type": "CommentBlock", "value": "* @ignore ", "start": 274, "end": 288, "loc": { "start": { "line": 16, "column": 0 }, "end": { "line": 16, "column": 14 } } }, { "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": 289, "end": 295, "loc": { "start": { "line": 17, "column": 0 }, "end": { "line": 17, "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": 296, "end": 303, "loc": { "start": { "line": 17, "column": 7 }, "end": { "line": 17, "column": 14 } } }, { "type": { "label": "new", "keyword": "new", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "new", "start": 304, "end": 307, "loc": { "start": { "line": 17, "column": 15 }, "end": { "line": 17, "column": 18 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "State", "start": 308, "end": 313, "loc": { "start": { "line": 17, "column": 19 }, "end": { "line": 17, "column": 24 } } }, { "type": { "label": "(", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 313, "end": 314, "loc": { "start": { "line": 17, "column": 24 }, "end": { "line": 17, "column": 25 } } }, { "type": { "label": ")", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 314, "end": 315, "loc": { "start": { "line": 17, "column": 25 }, "end": { "line": 17, "column": 26 } } }, { "type": { "label": ";", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 315, "end": 316, "loc": { "start": { "line": 17, "column": 26 }, "end": { "line": 17, "column": 27 } } }, { "type": { "label": "eof", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 317, "end": 317, "loc": { "start": { "line": 18, "column": 0 }, "end": { "line": 18, "column": 0 } } } ] }