@eastsideco/escshopify
Version:
WIP JS library for Shopify, containing a variety of useful functionality.
1,239 lines (1,238 loc) • 103 kB
JSON
{
"type": "File",
"start": 0,
"end": 869,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 33,
"column": 0
}
},
"program": {
"type": "Program",
"start": 0,
"end": 869,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 33,
"column": 0
}
},
"sourceType": "module",
"body": [
{
"type": "ExportDefaultDeclaration",
"start": 59,
"end": 868,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 32,
"column": 1
}
},
"declaration": {
"type": "ClassDeclaration",
"start": 74,
"end": 868,
"loc": {
"start": {
"line": 4,
"column": 15
},
"end": {
"line": 32,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 80,
"end": 92,
"loc": {
"start": {
"line": 4,
"column": 21
},
"end": {
"line": 4,
"column": 33
},
"identifierName": "SelectHelper"
},
"name": "SelectHelper",
"leadingComments": null
},
"superClass": null,
"body": {
"type": "ClassBody",
"start": 93,
"end": 868,
"loc": {
"start": {
"line": 4,
"column": 34
},
"end": {
"line": 32,
"column": 1
}
},
"body": [
{
"type": "ClassMethod",
"start": 246,
"end": 399,
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 13,
"column": 5
}
},
"static": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 246,
"end": 257,
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 10,
"column": 15
},
"identifierName": "constructor"
},
"name": "constructor",
"leadingComments": null
},
"kind": "constructor",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 258,
"end": 270,
"loc": {
"start": {
"line": 10,
"column": 16
},
"end": {
"line": 10,
"column": 28
},
"identifierName": "easyCurrency"
},
"name": "easyCurrency"
}
],
"body": {
"type": "BlockStatement",
"start": 272,
"end": 399,
"loc": {
"start": {
"line": 10,
"column": 30
},
"end": {
"line": 13,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 359,
"end": 393,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 42
}
},
"expression": {
"type": "AssignmentExpression",
"start": 359,
"end": 392,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 41
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 359,
"end": 377,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 26
}
},
"object": {
"type": "ThisExpression",
"start": 359,
"end": 363,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 12
}
},
"leadingComments": null
},
"property": {
"type": "Identifier",
"start": 364,
"end": 377,
"loc": {
"start": {
"line": 12,
"column": 13
},
"end": {
"line": 12,
"column": 26
},
"identifierName": "_easyCurrency"
},
"name": "_easyCurrency"
},
"computed": false,
"leadingComments": null
},
"right": {
"type": "Identifier",
"start": 380,
"end": 392,
"loc": {
"start": {
"line": 12,
"column": 29
},
"end": {
"line": 12,
"column": 41
},
"identifierName": "easyCurrency"
},
"name": "easyCurrency"
},
"leadingComments": null
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "* @type {src/plugins/easycurrency/EasyCurrency.js~EasyCurrency} ",
"start": 282,
"end": 350,
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 76
}
}
}
]
}
],
"directives": [],
"trailingComments": null
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "*\n * Construct a new instance of the helper.\n * @param {src/plugins/easycurrency/EasyCurrency.js~EasyCurrency} easyCurrency\n ",
"start": 100,
"end": 241,
"loc": {
"start": {
"line": 6,
"column": 4
},
"end": {
"line": 9,
"column": 7
}
}
}
],
"trailingComments": [
{
"type": "CommentBlock",
"value": "*\n * Bind a input element with EasyCurrency.\n * @param {DOMNode}\telement\n ",
"start": 406,
"end": 496,
"loc": {
"start": {
"line": 16,
"column": 4
},
"end": {
"line": 19,
"column": 7
}
}
}
]
},
{
"type": "ClassMethod",
"start": 501,
"end": 866,
"loc": {
"start": {
"line": 20,
"column": 4
},
"end": {
"line": 31,
"column": 5
}
},
"static": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 501,
"end": 505,
"loc": {
"start": {
"line": 20,
"column": 4
},
"end": {
"line": 20,
"column": 8
},
"identifierName": "link"
},
"name": "link",
"leadingComments": null
},
"kind": "method",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 506,
"end": 513,
"loc": {
"start": {
"line": 20,
"column": 9
},
"end": {
"line": 20,
"column": 16
},
"identifierName": "element"
},
"name": "element"
}
],
"body": {
"type": "BlockStatement",
"start": 515,
"end": 866,
"loc": {
"start": {
"line": 20,
"column": 18
},
"end": {
"line": 31,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 525,
"end": 645,
"loc": {
"start": {
"line": 21,
"column": 8
},
"end": {
"line": 23,
"column": 11
}
},
"expression": {
"type": "CallExpression",
"start": 525,
"end": 644,
"loc": {
"start": {
"line": 21,
"column": 8
},
"end": {
"line": 23,
"column": 10
}
},
"callee": {
"type": "MemberExpression",
"start": 525,
"end": 549,
"loc": {
"start": {
"line": 21,
"column": 8
},
"end": {
"line": 21,
"column": 32
}
},
"object": {
"type": "Identifier",
"start": 525,
"end": 532,
"loc": {
"start": {
"line": 21,
"column": 8
},
"end": {
"line": 21,
"column": 15
},
"identifierName": "element"
},
"name": "element"
},
"property": {
"type": "Identifier",
"start": 533,
"end": 549,
"loc": {
"start": {
"line": 21,
"column": 16
},
"end": {
"line": 21,
"column": 32
},
"identifierName": "addEventListener"
},
"name": "addEventListener"
},
"computed": false
},
"arguments": [
{
"type": "StringLiteral",
"start": 550,
"end": 558,
"loc": {
"start": {
"line": 21,
"column": 33
},
"end": {
"line": 21,
"column": 41
}
},
"extra": {
"rawValue": "change",
"raw": "'change'"
},
"value": "change"
},
{
"type": "ArrowFunctionExpression",
"start": 560,
"end": 643,
"loc": {
"start": {
"line": 21,
"column": 43
},
"end": {
"line": 23,
"column": 9
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 561,
"end": 562,
"loc": {
"start": {
"line": 21,
"column": 44
},
"end": {
"line": 21,
"column": 45
},
"identifierName": "e"
},
"name": "e"
}
],
"body": {
"type": "BlockStatement",
"start": 567,
"end": 643,
"loc": {
"start": {
"line": 21,
"column": 50
},
"end": {
"line": 23,
"column": 9
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 581,
"end": 633,
"loc": {
"start": {
"line": 22,
"column": 12
},
"end": {
"line": 22,
"column": 64
}
},
"expression": {
"type": "CallExpression",
"start": 581,
"end": 632,
"loc": {
"start": {
"line": 22,
"column": 12
},
"end": {
"line": 22,
"column": 63
}
},
"callee": {
"type": "MemberExpression",
"start": 581,
"end": 617,
"loc": {
"start": {
"line": 22,
"column": 12
},
"end": {
"line": 22,
"column": 48
}
},
"object": {
"type": "MemberExpression",
"start": 581,
"end": 599,
"loc": {
"start": {
"line": 22,
"column": 12
},
"end": {
"line": 22,
"column": 30
}
},
"object": {
"type": "ThisExpression",
"start": 581,
"end": 585,
"loc": {
"start": {
"line": 22,
"column": 12
},
"end": {
"line": 22,
"column": 16
}
}
},
"property": {
"type": "Identifier",
"start": 586,
"end": 599,
"loc": {
"start": {
"line": 22,
"column": 17
},
"end": {
"line": 22,
"column": 30
},
"identifierName": "_easyCurrency"
},
"name": "_easyCurrency"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 600,
"end": 617,
"loc": {
"start": {
"line": 22,
"column": 31
},
"end": {
"line": 22,
"column": 48
},
"identifierName": "setActiveCurrency"
},
"name": "setActiveCurrency"
},
"computed": false
},
"arguments": [
{
"type": "MemberExpression",
"start": 618,
"end": 631,
"loc": {
"start": {
"line": 22,
"column": 49
},
"end": {
"line": 22,
"column": 62
}
},
"object": {
"type": "Identifier",
"start": 618,
"end": 625,
"loc": {
"start": {
"line": 22,
"column": 49
},
"end": {
"line": 22,
"column": 56
},
"identifierName": "element"
},
"name": "element"
},
"property": {
"type": "Identifier",
"start": 626,
"end": 631,
"loc": {
"start": {
"line": 22,
"column": 57
},
"end": {
"line": 22,
"column": 62
},
"identifierName": "value"
},
"name": "value"
},
"computed": false
}
]
}
}
],
"directives": []
}
}
]
}
},
{
"type": "ExpressionStatement",
"start": 655,
"end": 795,
"loc": {
"start": {
"line": 25,
"column": 8
},
"end": {
"line": 28,
"column": 11
}
},
"expression": {
"type": "CallExpression",
"start": 655,
"end": 794,
"loc": {
"start": {
"line": 25,
"column": 8
},
"end": {
"line": 28,
"column": 10
}
},
"callee": {
"type": "MemberExpression",
"start": 655,
"end": 676,
"loc": {
"start": {
"line": 25,
"column": 8
},
"end": {
"line": 25,
"column": 29
}
},
"object": {
"type": "MemberExpression",
"start": 655,
"end": 673,
"loc": {
"start": {
"line": 25,
"column": 8
},
"end": {
"line": 25,
"column": 26
}
},
"object": {
"type": "ThisExpression",
"start": 655,
"end": 659,
"loc": {
"start": {
"line": 25,
"column": 8
},
"end": {
"line": 25,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 660,
"end": 673,
"loc": {
"start": {
"line": 25,
"column": 13
},
"end": {
"line": 25,
"column": 26
},
"identifierName": "_easyCurrency"
},
"name": "_easyCurrency"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 674,
"end": 676,
"loc": {
"start": {
"line": 25,
"column": 27
},
"end": {
"line": 25,
"column": 29
},
"identifierName": "on"
},
"name": "on"
},
"computed": false
},
"arguments": [
{
"type": "StringLiteral",
"start": 677,
"end": 694,
"loc": {
"start": {
"line": 25,
"column": 30
},
"end": {
"line": 25,
"column": 47
}
},
"extra": {
"rawValue": "currencyChanged",
"raw": "'currencyChanged'"
},
"value": "currencyChanged"
},
{
"type": "ArrowFunctionExpression",
"start": 696,
"end": 793,
"loc": {
"start": {
"line": 25,
"column": 49
},
"end": {
"line": 28,
"column": 9
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 697,
"end": 698,
"loc": {
"start": {
"line": 25,
"column": 50
},
"end": {
"line": 25,
"column": 51
},
"identifierName": "e"
},
"name": "e"
}
],
"body": {
"type": "BlockStatement",
"start": 703,
"end": 793,
"loc": {
"start": {
"line": 25,
"column": 56
},
"end": {
"line": 28,
"column": 9
}
},
"body": [
{
"type": "VariableDeclaration",
"start": 717,
"end": 742,
"loc": {
"start": {
"line": 26,
"column": 12
},
"end": {
"line": 26,
"column": 37
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 721,
"end": 741,
"loc": {
"start": {
"line": 26,
"column": 16
},
"end": {
"line": 26,
"column": 36
}
},
"id": {
"type": "Identifier",
"start": 721,
"end": 732,
"loc": {
"start": {
"line": 26,
"column": 16
},
"end": {
"line": 26,
"column": 27
},
"identifierName": "newCurrency"
},
"name": "newCurrency"
},
"init": {
"type": "MemberExpression",
"start": 735,
"end": 741,
"loc": {
"start": {
"line": 26,
"column": 30
},
"end": {
"line": 26,
"column": 36
}
},
"object": {
"type": "Identifier",
"start": 735,
"end": 736,
"loc": {
"start": {
"line": 26,
"column": 30
},
"end": {
"line": 26,
"column": 31
},
"identifierName": "e"
},
"name": "e"
},
"property": {
"type": "Identifier",
"start": 737,
"end": 741,
"loc": {
"start": {
"line": 26,
"column": 32
},
"end": {
"line": 26,
"column": 36
},
"identifierName": "data"
},
"name": "data"
},
"computed": false
}
}
],
"kind": "var"
},
{
"type": "ExpressionStatement",
"start": 755,
"end": 783,
"loc": {
"start": {
"line": 27,
"column": 12
},
"end": {
"line": 27,
"column": 40
}
},
"expression": {
"type": "AssignmentExpression",
"start": 755,
"end": 782,
"loc": {
"start": {
"line": 27,
"column": 12
},
"end": {
"line": 27,
"column": 39
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 755,
"end": 768,
"loc": {
"start": {
"line": 27,
"column": 12
},
"end": {
"line": 27,
"column": 25
}
},
"object": {
"type": "Identifier",
"start": 755,
"end": 762,
"loc": {
"start": {
"line": 27,
"column": 12
},
"end": {
"line": 27,
"column": 19
},
"identifierName": "element"
},
"name": "element"
},
"property": {
"type": "Identifier",
"start": 763,
"end": 768,
"loc": {
"start": {
"line": 27,
"column": 20
},
"end": {
"line": 27,
"column": 25
},
"identifierName": "value"
},
"name": "value"
},
"computed": false
},
"right": {
"type": "Identifier",
"start": 771,
"end": 782,
"loc": {
"start": {
"line": 27,
"column": 28
},
"end": {
"line": 27,
"column": 39
},
"identifierName": "newCurrency"
},
"name": "newCurrency"
}
}
}
],
"directives": []
}
}
]
}
},
{
"type": "ExpressionStatement",
"start": 805,
"end": 860,
"loc": {
"start": {
"line": 30,
"column": 8
},
"end": {
"line": 30,
"column": 63
}
},
"expression": {
"type": "AssignmentExpression",
"start": 805,
"end": 859,
"loc": {
"start": {
"line": 30,
"column": 8
},
"end": {
"line": 30,
"column": 62
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 805,
"end": 818,
"loc": {
"start": {
"line": 30,
"column": 8
},
"end": {
"line": 30,
"column": 21
}
},
"object": {
"type": "Identifier",
"start": 805,
"end": 812,
"loc": {
"start": {
"line": 30,
"column": 8
},
"end": {
"line": 30,
"column": 15
},
"identifierName": "element"
},
"name": "element"
},
"property": {
"type": "Identifier",
"start": 813,
"end": 818,
"loc": {
"start": {
"line": 30,
"column": 16
},
"end": {
"line": 30,
"column": 21
},
"identifierName": "value"
},
"name": "value"
},
"computed": false
},
"right": {
"type": "CallExpression",
"start": 821,
"end": 859,
"loc": {
"start": {
"line": 30,
"column": 24
},
"end": {
"line": 30,
"column": 62
}
},
"callee": {
"type": "MemberExpression",
"start": 821,
"end": 857,
"loc": {
"start": {
"line": 30,
"column": 24
},
"end": {
"line": 30,
"column": 60
}
},
"object": {
"type": "MemberExpression",
"start": 821,
"end": 839,
"loc": {
"start": {
"line": 30,
"column": 24
},
"end": {
"line": 30,
"column": 42
}
},
"object": {
"type": "ThisExpression",
"start": 821,
"end": 825,
"loc": {
"start": {
"line": 30,
"column": 24
},
"end": {
"line": 30,
"column": 28
}