@eastsideco/escshopify
Version:
WIP JS library for Shopify, containing a variety of useful functionality.
1,240 lines (1,239 loc) • 103 kB
JSON
{
"type": "File",
"start": 0,
"end": 853,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 33,
"column": 0
}
},
"program": {
"type": "Program",
"start": 0,
"end": 853,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 33,
"column": 0
}
},
"sourceType": "module",
"body": [
{
"type": "ExportDefaultDeclaration",
"start": 59,
"end": 852,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 32,
"column": 1
}
},
"declaration": {
"type": "ClassDeclaration",
"start": 74,
"end": 852,
"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": 852,
"loc": {
"start": {
"line": 4,
"column": 34
},
"end": {
"line": 32,
"column": 1
}
},
"body": [
{
"type": "ClassMethod",
"start": 238,
"end": 383,
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 13,
"column": 5
}
},
"static": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 238,
"end": 249,
"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": 250,
"end": 262,
"loc": {
"start": {
"line": 10,
"column": 16
},
"end": {
"line": 10,
"column": 28
},
"identifierName": "easyCurrency"
},
"name": "easyCurrency"
}
],
"body": {
"type": "BlockStatement",
"start": 264,
"end": 383,
"loc": {
"start": {
"line": 10,
"column": 30
},
"end": {
"line": 13,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 343,
"end": 377,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 42
}
},
"expression": {
"type": "AssignmentExpression",
"start": 343,
"end": 376,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 41
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 343,
"end": 361,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 26
}
},
"object": {
"type": "ThisExpression",
"start": 343,
"end": 347,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 12
}
},
"leadingComments": null
},
"property": {
"type": "Identifier",
"start": 348,
"end": 361,
"loc": {
"start": {
"line": 12,
"column": 13
},
"end": {
"line": 12,
"column": 26
},
"identifierName": "_easyCurrency"
},
"name": "_easyCurrency"
},
"computed": false,
"leadingComments": null
},
"right": {
"type": "Identifier",
"start": 364,
"end": 376,
"loc": {
"start": {
"line": 12,
"column": 29
},
"end": {
"line": 12,
"column": 41
},
"identifierName": "easyCurrency"
},
"name": "easyCurrency"
},
"leadingComments": null
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "* @type {src/easycurrency/EasyCurrency.js~EasyCurrency} ",
"start": 274,
"end": 334,
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 68
}
}
}
]
}
],
"directives": [],
"trailingComments": null
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "*\n * Construct a new instance of the helper.\n * @param {src/easycurrency/EasyCurrency.js~EasyCurrency} easyCurrency\n ",
"start": 100,
"end": 233,
"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": 390,
"end": 480,
"loc": {
"start": {
"line": 16,
"column": 4
},
"end": {
"line": 19,
"column": 7
}
}
}
]
},
{
"type": "ClassMethod",
"start": 485,
"end": 850,
"loc": {
"start": {
"line": 20,
"column": 4
},
"end": {
"line": 31,
"column": 5
}
},
"static": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 485,
"end": 489,
"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": 490,
"end": 497,
"loc": {
"start": {
"line": 20,
"column": 9
},
"end": {
"line": 20,
"column": 16
},
"identifierName": "element"
},
"name": "element"
}
],
"body": {
"type": "BlockStatement",
"start": 499,
"end": 850,
"loc": {
"start": {
"line": 20,
"column": 18
},
"end": {
"line": 31,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 509,
"end": 629,
"loc": {
"start": {
"line": 21,
"column": 8
},
"end": {
"line": 23,
"column": 11
}
},
"expression": {
"type": "CallExpression",
"start": 509,
"end": 628,
"loc": {
"start": {
"line": 21,
"column": 8
},
"end": {
"line": 23,
"column": 10
}
},
"callee": {
"type": "MemberExpression",
"start": 509,
"end": 533,
"loc": {
"start": {
"line": 21,
"column": 8
},
"end": {
"line": 21,
"column": 32
}
},
"object": {
"type": "Identifier",
"start": 509,
"end": 516,
"loc": {
"start": {
"line": 21,
"column": 8
},
"end": {
"line": 21,
"column": 15
},
"identifierName": "element"
},
"name": "element"
},
"property": {
"type": "Identifier",
"start": 517,
"end": 533,
"loc": {
"start": {
"line": 21,
"column": 16
},
"end": {
"line": 21,
"column": 32
},
"identifierName": "addEventListener"
},
"name": "addEventListener"
},
"computed": false
},
"arguments": [
{
"type": "StringLiteral",
"start": 534,
"end": 542,
"loc": {
"start": {
"line": 21,
"column": 33
},
"end": {
"line": 21,
"column": 41
}
},
"extra": {
"rawValue": "change",
"raw": "'change'"
},
"value": "change"
},
{
"type": "ArrowFunctionExpression",
"start": 544,
"end": 627,
"loc": {
"start": {
"line": 21,
"column": 43
},
"end": {
"line": 23,
"column": 9
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 545,
"end": 546,
"loc": {
"start": {
"line": 21,
"column": 44
},
"end": {
"line": 21,
"column": 45
},
"identifierName": "e"
},
"name": "e"
}
],
"body": {
"type": "BlockStatement",
"start": 551,
"end": 627,
"loc": {
"start": {
"line": 21,
"column": 50
},
"end": {
"line": 23,
"column": 9
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 565,
"end": 617,
"loc": {
"start": {
"line": 22,
"column": 12
},
"end": {
"line": 22,
"column": 64
}
},
"expression": {
"type": "CallExpression",
"start": 565,
"end": 616,
"loc": {
"start": {
"line": 22,
"column": 12
},
"end": {
"line": 22,
"column": 63
}
},
"callee": {
"type": "MemberExpression",
"start": 565,
"end": 601,
"loc": {
"start": {
"line": 22,
"column": 12
},
"end": {
"line": 22,
"column": 48
}
},
"object": {
"type": "MemberExpression",
"start": 565,
"end": 583,
"loc": {
"start": {
"line": 22,
"column": 12
},
"end": {
"line": 22,
"column": 30
}
},
"object": {
"type": "ThisExpression",
"start": 565,
"end": 569,
"loc": {
"start": {
"line": 22,
"column": 12
},
"end": {
"line": 22,
"column": 16
}
}
},
"property": {
"type": "Identifier",
"start": 570,
"end": 583,
"loc": {
"start": {
"line": 22,
"column": 17
},
"end": {
"line": 22,
"column": 30
},
"identifierName": "_easyCurrency"
},
"name": "_easyCurrency"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 584,
"end": 601,
"loc": {
"start": {
"line": 22,
"column": 31
},
"end": {
"line": 22,
"column": 48
},
"identifierName": "setActiveCurrency"
},
"name": "setActiveCurrency"
},
"computed": false
},
"arguments": [
{
"type": "MemberExpression",
"start": 602,
"end": 615,
"loc": {
"start": {
"line": 22,
"column": 49
},
"end": {
"line": 22,
"column": 62
}
},
"object": {
"type": "Identifier",
"start": 602,
"end": 609,
"loc": {
"start": {
"line": 22,
"column": 49
},
"end": {
"line": 22,
"column": 56
},
"identifierName": "element"
},
"name": "element"
},
"property": {
"type": "Identifier",
"start": 610,
"end": 615,
"loc": {
"start": {
"line": 22,
"column": 57
},
"end": {
"line": 22,
"column": 62
},
"identifierName": "value"
},
"name": "value"
},
"computed": false
}
]
}
}
],
"directives": []
}
}
]
}
},
{
"type": "ExpressionStatement",
"start": 639,
"end": 779,
"loc": {
"start": {
"line": 25,
"column": 8
},
"end": {
"line": 28,
"column": 11
}
},
"expression": {
"type": "CallExpression",
"start": 639,
"end": 778,
"loc": {
"start": {
"line": 25,
"column": 8
},
"end": {
"line": 28,
"column": 10
}
},
"callee": {
"type": "MemberExpression",
"start": 639,
"end": 660,
"loc": {
"start": {
"line": 25,
"column": 8
},
"end": {
"line": 25,
"column": 29
}
},
"object": {
"type": "MemberExpression",
"start": 639,
"end": 657,
"loc": {
"start": {
"line": 25,
"column": 8
},
"end": {
"line": 25,
"column": 26
}
},
"object": {
"type": "ThisExpression",
"start": 639,
"end": 643,
"loc": {
"start": {
"line": 25,
"column": 8
},
"end": {
"line": 25,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 644,
"end": 657,
"loc": {
"start": {
"line": 25,
"column": 13
},
"end": {
"line": 25,
"column": 26
},
"identifierName": "_easyCurrency"
},
"name": "_easyCurrency"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 658,
"end": 660,
"loc": {
"start": {
"line": 25,
"column": 27
},
"end": {
"line": 25,
"column": 29
},
"identifierName": "on"
},
"name": "on"
},
"computed": false
},
"arguments": [
{
"type": "StringLiteral",
"start": 661,
"end": 678,
"loc": {
"start": {
"line": 25,
"column": 30
},
"end": {
"line": 25,
"column": 47
}
},
"extra": {
"rawValue": "currencyChanged",
"raw": "'currencyChanged'"
},
"value": "currencyChanged"
},
{
"type": "ArrowFunctionExpression",
"start": 680,
"end": 777,
"loc": {
"start": {
"line": 25,
"column": 49
},
"end": {
"line": 28,
"column": 9
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 681,
"end": 682,
"loc": {
"start": {
"line": 25,
"column": 50
},
"end": {
"line": 25,
"column": 51
},
"identifierName": "e"
},
"name": "e"
}
],
"body": {
"type": "BlockStatement",
"start": 687,
"end": 777,
"loc": {
"start": {
"line": 25,
"column": 56
},
"end": {
"line": 28,
"column": 9
}
},
"body": [
{
"type": "VariableDeclaration",
"start": 701,
"end": 726,
"loc": {
"start": {
"line": 26,
"column": 12
},
"end": {
"line": 26,
"column": 37
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 705,
"end": 725,
"loc": {
"start": {
"line": 26,
"column": 16
},
"end": {
"line": 26,
"column": 36
}
},
"id": {
"type": "Identifier",
"start": 705,
"end": 716,
"loc": {
"start": {
"line": 26,
"column": 16
},
"end": {
"line": 26,
"column": 27
},
"identifierName": "newCurrency"
},
"name": "newCurrency"
},
"init": {
"type": "MemberExpression",
"start": 719,
"end": 725,
"loc": {
"start": {
"line": 26,
"column": 30
},
"end": {
"line": 26,
"column": 36
}
},
"object": {
"type": "Identifier",
"start": 719,
"end": 720,
"loc": {
"start": {
"line": 26,
"column": 30
},
"end": {
"line": 26,
"column": 31
},
"identifierName": "e"
},
"name": "e"
},
"property": {
"type": "Identifier",
"start": 721,
"end": 725,
"loc": {
"start": {
"line": 26,
"column": 32
},
"end": {
"line": 26,
"column": 36
},
"identifierName": "data"
},
"name": "data"
},
"computed": false
}
}
],
"kind": "var"
},
{
"type": "ExpressionStatement",
"start": 739,
"end": 767,
"loc": {
"start": {
"line": 27,
"column": 12
},
"end": {
"line": 27,
"column": 40
}
},
"expression": {
"type": "AssignmentExpression",
"start": 739,
"end": 766,
"loc": {
"start": {
"line": 27,
"column": 12
},
"end": {
"line": 27,
"column": 39
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 739,
"end": 752,
"loc": {
"start": {
"line": 27,
"column": 12
},
"end": {
"line": 27,
"column": 25
}
},
"object": {
"type": "Identifier",
"start": 739,
"end": 746,
"loc": {
"start": {
"line": 27,
"column": 12
},
"end": {
"line": 27,
"column": 19
},
"identifierName": "element"
},
"name": "element"
},
"property": {
"type": "Identifier",
"start": 747,
"end": 752,
"loc": {
"start": {
"line": 27,
"column": 20
},
"end": {
"line": 27,
"column": 25
},
"identifierName": "value"
},
"name": "value"
},
"computed": false
},
"right": {
"type": "Identifier",
"start": 755,
"end": 766,
"loc": {
"start": {
"line": 27,
"column": 28
},
"end": {
"line": 27,
"column": 39
},
"identifierName": "newCurrency"
},
"name": "newCurrency"
}
}
}
],
"directives": []
}
}
]
}
},
{
"type": "ExpressionStatement",
"start": 789,
"end": 844,
"loc": {
"start": {
"line": 30,
"column": 8
},
"end": {
"line": 30,
"column": 63
}
},
"expression": {
"type": "AssignmentExpression",
"start": 789,
"end": 843,
"loc": {
"start": {
"line": 30,
"column": 8
},
"end": {
"line": 30,
"column": 62
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 789,
"end": 802,
"loc": {
"start": {
"line": 30,
"column": 8
},
"end": {
"line": 30,
"column": 21
}
},
"object": {
"type": "Identifier",
"start": 789,
"end": 796,
"loc": {
"start": {
"line": 30,
"column": 8
},
"end": {
"line": 30,
"column": 15
},
"identifierName": "element"
},
"name": "element"
},
"property": {
"type": "Identifier",
"start": 797,
"end": 802,
"loc": {
"start": {
"line": 30,
"column": 16
},
"end": {
"line": 30,
"column": 21
},
"identifierName": "value"
},
"name": "value"
},
"computed": false
},
"right": {
"type": "CallExpression",
"start": 805,
"end": 843,
"loc": {
"start": {
"line": 30,
"column": 24
},
"end": {
"line": 30,
"column": 62
}
},
"callee": {
"type": "MemberExpression",
"start": 805,
"end": 841,
"loc": {
"start": {
"line": 30,
"column": 24
},
"end": {
"line": 30,
"column": 60
}
},
"object": {
"type": "MemberExpression",
"start": 805,
"end": 823,
"loc": {
"start": {
"line": 30,
"column": 24
},
"end": {
"line": 30,
"column": 42
}
},
"object": {
"type": "ThisExpression",
"start": 805,
"end": 809,
"loc": {
"start": {
"line": 30,
"column": 24
},
"end": {
"line": 30,
"column": 28
}
}