UNPKG

@kkbox/kkbox-js-sdk

Version:

KKBOX Open API developer SDK for JavaScript. Use it to easily access KKBOX open API to get various metadata about KKBOX's tracks, albums, artists, playlists and stations.

1,069 lines (1,068 loc) 201 kB
{ "type": "File", "start": 0, "end": 687, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 17, "column": 1 } }, "program": { "type": "Program", "start": 0, "end": 687, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 17, "column": 1 } }, "sourceType": "module", "body": [ { "type": "ExportDefaultDeclaration", "start": 19, "end": 687, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 17, "column": 1 } }, "declaration": { "type": "ArrowFunctionExpression", "start": 34, "end": 687, "loc": { "start": { "line": 4, "column": 15 }, "end": { "line": 17, "column": 1 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 35, "end": 43, "loc": { "start": { "line": 4, "column": 16 }, "end": { "line": 4, "column": 24 }, "identifierName": "callback" }, "name": "callback", "leadingComments": null }, { "type": "Identifier", "start": 45, "end": 50, "loc": { "start": { "line": 4, "column": 26 }, "end": { "line": 4, "column": 31 }, "identifierName": "limit" }, "name": "limit" } ], "body": { "type": "BlockStatement", "start": 55, "end": 687, "loc": { "start": { "line": 4, "column": 36 }, "end": { "line": 17, "column": 1 } }, "body": [ { "type": "ReturnStatement", "start": 61, "end": 685, "loc": { "start": { "line": 5, "column": 4 }, "end": { "line": 16, "column": 6 } }, "argument": { "type": "CallExpression", "start": 68, "end": 685, "loc": { "start": { "line": 5, "column": 11 }, "end": { "line": 16, "column": 6 } }, "callee": { "type": "MemberExpression", "start": 68, "end": 88, "loc": { "start": { "line": 5, "column": 11 }, "end": { "line": 5, "column": 31 } }, "object": { "type": "CallExpression", "start": 68, "end": 83, "loc": { "start": { "line": 5, "column": 11 }, "end": { "line": 5, "column": 26 } }, "callee": { "type": "Identifier", "start": 68, "end": 76, "loc": { "start": { "line": 5, "column": 11 }, "end": { "line": 5, "column": 19 }, "identifierName": "callback" }, "name": "callback" }, "arguments": [ { "type": "Identifier", "start": 77, "end": 82, "loc": { "start": { "line": 5, "column": 20 }, "end": { "line": 5, "column": 25 }, "identifierName": "limit" }, "name": "limit" } ] }, "property": { "type": "Identifier", "start": 84, "end": 88, "loc": { "start": { "line": 5, "column": 27 }, "end": { "line": 5, "column": 31 }, "identifierName": "then" }, "name": "then" }, "computed": false }, "arguments": [ { "type": "ArrowFunctionExpression", "start": 89, "end": 684, "loc": { "start": { "line": 5, "column": 32 }, "end": { "line": 16, "column": 5 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 89, "end": 97, "loc": { "start": { "line": 5, "column": 32 }, "end": { "line": 5, "column": 40 }, "identifierName": "response" }, "name": "response" } ], "body": { "type": "BlockStatement", "start": 101, "end": 684, "loc": { "start": { "line": 5, "column": 44 }, "end": { "line": 16, "column": 5 } }, "body": [ { "type": "VariableDeclaration", "start": 111, "end": 179, "loc": { "start": { "line": 6, "column": 8 }, "end": { "line": 6, "column": 76 } }, "declarations": [ { "type": "VariableDeclarator", "start": 117, "end": 179, "loc": { "start": { "line": 6, "column": 14 }, "end": { "line": 6, "column": 76 } }, "id": { "type": "Identifier", "start": 117, "end": 124, "loc": { "start": { "line": 6, "column": 14 }, "end": { "line": 6, "column": 21 }, "identifierName": "offsets" }, "name": "offsets" }, "init": { "type": "CallExpression", "start": 127, "end": 179, "loc": { "start": { "line": 6, "column": 24 }, "end": { "line": 6, "column": 76 } }, "callee": { "type": "MemberExpression", "start": 127, "end": 137, "loc": { "start": { "line": 6, "column": 24 }, "end": { "line": 6, "column": 34 } }, "object": { "type": "Identifier", "start": 127, "end": 131, "loc": { "start": { "line": 6, "column": 24 }, "end": { "line": 6, "column": 28 }, "identifierName": "Math" }, "name": "Math" }, "property": { "type": "Identifier", "start": 132, "end": 137, "loc": { "start": { "line": 6, "column": 29 }, "end": { "line": 6, "column": 34 }, "identifierName": "floor" }, "name": "floor" }, "computed": false }, "arguments": [ { "type": "LogicalExpression", "start": 138, "end": 178, "loc": { "start": { "line": 6, "column": 35 }, "end": { "line": 6, "column": 75 } }, "left": { "type": "MemberExpression", "start": 138, "end": 165, "loc": { "start": { "line": 6, "column": 35 }, "end": { "line": 6, "column": 62 } }, "object": { "type": "MemberExpression", "start": 138, "end": 159, "loc": { "start": { "line": 6, "column": 35 }, "end": { "line": 6, "column": 56 } }, "object": { "type": "MemberExpression", "start": 138, "end": 151, "loc": { "start": { "line": 6, "column": 35 }, "end": { "line": 6, "column": 48 } }, "object": { "type": "Identifier", "start": 138, "end": 146, "loc": { "start": { "line": 6, "column": 35 }, "end": { "line": 6, "column": 43 }, "identifierName": "response" }, "name": "response" }, "property": { "type": "Identifier", "start": 147, "end": 151, "loc": { "start": { "line": 6, "column": 44 }, "end": { "line": 6, "column": 48 }, "identifierName": "data" }, "name": "data" }, "computed": false }, "property": { "type": "Identifier", "start": 152, "end": 159, "loc": { "start": { "line": 6, "column": 49 }, "end": { "line": 6, "column": 56 }, "identifierName": "summary" }, "name": "summary" }, "computed": false }, "property": { "type": "Identifier", "start": 160, "end": 165, "loc": { "start": { "line": 6, "column": 57 }, "end": { "line": 6, "column": 62 }, "identifierName": "total" }, "name": "total" }, "computed": false }, "operator": "||", "right": { "type": "BinaryExpression", "start": 169, "end": 178, "loc": { "start": { "line": 6, "column": 66 }, "end": { "line": 6, "column": 75 } }, "left": { "type": "NumericLiteral", "start": 169, "end": 170, "loc": { "start": { "line": 6, "column": 66 }, "end": { "line": 6, "column": 67 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 }, "operator": "/", "right": { "type": "Identifier", "start": 173, "end": 178, "loc": { "start": { "line": 6, "column": 70 }, "end": { "line": 6, "column": 75 }, "identifierName": "limit" }, "name": "limit" } } } ] } } ], "kind": "const" }, { "type": "VariableDeclaration", "start": 188, "end": 343, "loc": { "start": { "line": 7, "column": 8 }, "end": { "line": 9, "column": 51 } }, "declarations": [ { "type": "VariableDeclarator", "start": 194, "end": 343, "loc": { "start": { "line": 7, "column": 14 }, "end": { "line": 9, "column": 51 } }, "id": { "type": "Identifier", "start": 194, "end": 202, "loc": { "start": { "line": 7, "column": 14 }, "end": { "line": 7, "column": 22 }, "identifierName": "promises" }, "name": "promises" }, "init": { "type": "CallExpression", "start": 205, "end": 343, "loc": { "start": { "line": 7, "column": 25 }, "end": { "line": 9, "column": 51 } }, "callee": { "type": "MemberExpression", "start": 205, "end": 308, "loc": { "start": { "line": 7, "column": 25 }, "end": { "line": 9, "column": 16 } }, "object": { "type": "CallExpression", "start": 205, "end": 291, "loc": { "start": { "line": 7, "column": 25 }, "end": { "line": 8, "column": 55 } }, "callee": { "type": "MemberExpression", "start": 205, "end": 252, "loc": { "start": { "line": 7, "column": 25 }, "end": { "line": 8, "column": 16 } }, "object": { "type": "CallExpression", "start": 205, "end": 235, "loc": { "start": { "line": 7, "column": 25 }, "end": { "line": 7, "column": 55 } }, "callee": { "type": "MemberExpression", "start": 205, "end": 228, "loc": { "start": { "line": 7, "column": 25 }, "end": { "line": 7, "column": 48 } }, "object": { "type": "NewExpression", "start": 205, "end": 223, "loc": { "start": { "line": 7, "column": 25 }, "end": { "line": 7, "column": 43 } }, "callee": { "type": "Identifier", "start": 209, "end": 214, "loc": { "start": { "line": 7, "column": 29 }, "end": { "line": 7, "column": 34 }, "identifierName": "Array" }, "name": "Array" }, "arguments": [ { "type": "Identifier", "start": 215, "end": 222, "loc": { "start": { "line": 7, "column": 35 }, "end": { "line": 7, "column": 42 }, "identifierName": "offsets" }, "name": "offsets" } ] }, "property": { "type": "Identifier", "start": 224, "end": 228, "loc": { "start": { "line": 7, "column": 44 }, "end": { "line": 7, "column": 48 }, "identifierName": "fill" }, "name": "fill" }, "computed": false }, "arguments": [ { "type": "Identifier", "start": 229, "end": 234, "loc": { "start": { "line": 7, "column": 49 }, "end": { "line": 7, "column": 54 }, "identifierName": "limit" }, "name": "limit" } ] }, "property": { "type": "Identifier", "start": 249, "end": 252, "loc": { "start": { "line": 8, "column": 13 }, "end": { "line": 8, "column": 16 }, "identifierName": "map" }, "name": "map" }, "computed": false }, "arguments": [ { "type": "ArrowFunctionExpression", "start": 253, "end": 290, "loc": { "start": { "line": 8, "column": 17 }, "end": { "line": 8, "column": 54 } }, "id": null, "generator": false, "expression": true, "async": false, "params": [ { "type": "Identifier", "start": 254, "end": 259, "loc": { "start": { "line": 8, "column": 18 }, "end": { "line": 8, "column": 23 }, "identifierName": "value" }, "name": "value" }, { "type": "Identifier", "start": 261, "end": 266, "loc": { "start": { "line": 8, "column": 25 }, "end": { "line": 8, "column": 30 }, "identifierName": "index" }, "name": "index" } ], "body": { "type": "BinaryExpression", "start": 271, "end": 290, "loc": { "start": { "line": 8, "column": 35 }, "end": { "line": 8, "column": 54 } }, "left": { "type": "Identifier", "start": 271, "end": 276, "loc": { "start": { "line": 8, "column": 35 }, "end": { "line": 8, "column": 40 }, "identifierName": "value" }, "name": "value" }, "operator": "*", "right": { "type": "BinaryExpression", "start": 280, "end": 289, "loc": { "start": { "line": 8, "column": 44 }, "end": { "line": 8, "column": 53 } }, "left": { "type": "Identifier", "start": 280, "end": 285, "loc": { "start": { "line": 8, "column": 44 }, "end": { "line": 8, "column": 49 }, "identifierName": "index" }, "name": "index" }, "operator": "+", "right": { "type": "NumericLiteral", "start": 288, "end": 289, "loc": { "start": { "line": 8, "column": 52 }, "end": { "line": 8, "column": 53 } }, "extra": { "rawValue": 1, "raw": "1" }, "value": 1 }, "extra": { "parenthesized": true, "parenStart": 279 } } } } ] }, "property": { "type": "Identifier", "start": 305, "end": 308, "loc": { "start": { "line": 9, "column": 13 }, "end": { "line": 9, "column": 16 }, "identifierName": "map" }, "name": "map" }, "computed": false }, "arguments": [ { "type": "ArrowFunctionExpression", "start": 309, "end": 342, "loc": { "start": { "line": 9, "column": 17 }, "end": { "line": 9, "column": 50 } }, "id": null, "generator": false, "expression": true, "async": false, "params": [ { "type": "Identifier", "start": 309, "end": 315, "loc": { "start": { "line": 9, "column": 17 }, "end": { "line": 9, "column": 23 }, "identifierName": "offset" }, "name": "offset" } ], "body": { "type": "CallExpression", "start": 319, "end": 342, "loc": { "start": { "line": 9, "column": 27 }, "end": { "line": 9, "column": 50 } }, "callee": { "type": "Identifier", "start": 319, "end": 327, "loc": { "start": { "line": 9, "column": 27 }, "end": { "line": 9, "column": 35 }, "identifierName": "callback" }, "name": "callback" }, "arguments": [ { "type": "Identifier", "start": 328, "end": 333, "loc": { "start": { "line": 9, "column": 36 }, "end": { "line": 9,