luxon
Version:
Immutable date wrapper
1,412 lines (1,411 loc) • 1.06 MB
JSON
{
"type": "File",
"start": 0,
"end": 6301,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 218,
"column": 0
}
},
"program": {
"type": "Program",
"start": 0,
"end": 6301,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 218,
"column": 0
}
},
"sourceType": "module",
"body": [
{
"type": "ImportDeclaration",
"start": 0,
"end": 30,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 30
}
},
"specifiers": [
{
"type": "ImportSpecifier",
"start": 9,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 13
}
},
"imported": {
"type": "Identifier",
"start": 9,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 13
},
"identifierName": "Util"
},
"name": "Util"
},
"local": {
"type": "Identifier",
"start": 9,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 13
},
"identifierName": "Util"
},
"name": "Util"
}
}
],
"source": {
"type": "StringLiteral",
"start": 21,
"end": 29,
"loc": {
"start": {
"line": 1,
"column": 21
},
"end": {
"line": 1,
"column": 29
}
},
"extra": {
"rawValue": "./util",
"raw": "'./util'"
},
"value": "./util"
}
},
{
"type": "ImportDeclaration",
"start": 31,
"end": 67,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 36
}
},
"specifiers": [
{
"type": "ImportSpecifier",
"start": 40,
"end": 47,
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 16
}
},
"imported": {
"type": "Identifier",
"start": 40,
"end": 47,
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 16
},
"identifierName": "English"
},
"name": "English"
},
"local": {
"type": "Identifier",
"start": 40,
"end": 47,
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 16
},
"identifierName": "English"
},
"name": "English"
}
}
],
"source": {
"type": "StringLiteral",
"start": 55,
"end": 66,
"loc": {
"start": {
"line": 2,
"column": 24
},
"end": {
"line": 2,
"column": 35
}
},
"extra": {
"rawValue": "./english",
"raw": "'./english'"
},
"value": "./english"
}
},
{
"type": "ImportDeclaration",
"start": 68,
"end": 127,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 59
}
},
"specifiers": [
{
"type": "ImportSpecifier",
"start": 77,
"end": 92,
"loc": {
"start": {
"line": 3,
"column": 9
},
"end": {
"line": 3,
"column": 24
}
},
"imported": {
"type": "Identifier",
"start": 77,
"end": 92,
"loc": {
"start": {
"line": 3,
"column": 9
},
"end": {
"line": 3,
"column": 24
},
"identifierName": "FixedOffsetZone"
},
"name": "FixedOffsetZone"
},
"local": {
"type": "Identifier",
"start": 77,
"end": 92,
"loc": {
"start": {
"line": 3,
"column": 9
},
"end": {
"line": 3,
"column": 24
},
"identifierName": "FixedOffsetZone"
},
"name": "FixedOffsetZone"
}
}
],
"source": {
"type": "StringLiteral",
"start": 100,
"end": 126,
"loc": {
"start": {
"line": 3,
"column": 32
},
"end": {
"line": 3,
"column": 58
}
},
"extra": {
"rawValue": "../zones/fixedOffsetZone",
"raw": "'../zones/fixedOffsetZone'"
},
"value": "../zones/fixedOffsetZone"
}
},
{
"type": "FunctionDeclaration",
"start": 129,
"end": 250,
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 8,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 138,
"end": 152,
"loc": {
"start": {
"line": 5,
"column": 9
},
"end": {
"line": 5,
"column": 23
},
"identifierName": "combineRegexes"
},
"name": "combineRegexes"
},
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "RestElement",
"start": 153,
"end": 163,
"loc": {
"start": {
"line": 5,
"column": 24
},
"end": {
"line": 5,
"column": 34
}
},
"argument": {
"type": "Identifier",
"start": 156,
"end": 163,
"loc": {
"start": {
"line": 5,
"column": 27
},
"end": {
"line": 5,
"column": 34
},
"identifierName": "regexes"
},
"name": "regexes"
}
}
],
"body": {
"type": "BlockStatement",
"start": 165,
"end": 250,
"loc": {
"start": {
"line": 5,
"column": 36
},
"end": {
"line": 8,
"column": 1
}
},
"body": [
{
"type": "VariableDeclaration",
"start": 169,
"end": 225,
"loc": {
"start": {
"line": 6,
"column": 2
},
"end": {
"line": 6,
"column": 58
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 175,
"end": 224,
"loc": {
"start": {
"line": 6,
"column": 8
},
"end": {
"line": 6,
"column": 57
}
},
"id": {
"type": "Identifier",
"start": 175,
"end": 179,
"loc": {
"start": {
"line": 6,
"column": 8
},
"end": {
"line": 6,
"column": 12
},
"identifierName": "full"
},
"name": "full"
},
"init": {
"type": "CallExpression",
"start": 182,
"end": 224,
"loc": {
"start": {
"line": 6,
"column": 15
},
"end": {
"line": 6,
"column": 57
}
},
"callee": {
"type": "MemberExpression",
"start": 182,
"end": 196,
"loc": {
"start": {
"line": 6,
"column": 15
},
"end": {
"line": 6,
"column": 29
}
},
"object": {
"type": "Identifier",
"start": 182,
"end": 189,
"loc": {
"start": {
"line": 6,
"column": 15
},
"end": {
"line": 6,
"column": 22
},
"identifierName": "regexes"
},
"name": "regexes"
},
"property": {
"type": "Identifier",
"start": 190,
"end": 196,
"loc": {
"start": {
"line": 6,
"column": 23
},
"end": {
"line": 6,
"column": 29
},
"identifierName": "reduce"
},
"name": "reduce"
},
"computed": false
},
"arguments": [
{
"type": "ArrowFunctionExpression",
"start": 197,
"end": 219,
"loc": {
"start": {
"line": 6,
"column": 30
},
"end": {
"line": 6,
"column": 52
}
},
"id": null,
"generator": false,
"expression": true,
"async": false,
"params": [
{
"type": "Identifier",
"start": 198,
"end": 199,
"loc": {
"start": {
"line": 6,
"column": 31
},
"end": {
"line": 6,
"column": 32
},
"identifierName": "f"
},
"name": "f"
},
{
"type": "Identifier",
"start": 201,
"end": 202,
"loc": {
"start": {
"line": 6,
"column": 34
},
"end": {
"line": 6,
"column": 35
},
"identifierName": "r"
},
"name": "r"
}
],
"body": {
"type": "BinaryExpression",
"start": 207,
"end": 219,
"loc": {
"start": {
"line": 6,
"column": 40
},
"end": {
"line": 6,
"column": 52
}
},
"left": {
"type": "Identifier",
"start": 207,
"end": 208,
"loc": {
"start": {
"line": 6,
"column": 40
},
"end": {
"line": 6,
"column": 41
},
"identifierName": "f"
},
"name": "f"
},
"operator": "+",
"right": {
"type": "MemberExpression",
"start": 211,
"end": 219,
"loc": {
"start": {
"line": 6,
"column": 44
},
"end": {
"line": 6,
"column": 52
}
},
"object": {
"type": "Identifier",
"start": 211,
"end": 212,
"loc": {
"start": {
"line": 6,
"column": 44
},
"end": {
"line": 6,
"column": 45
},
"identifierName": "r"
},
"name": "r"
},
"property": {
"type": "Identifier",
"start": 213,
"end": 219,
"loc": {
"start": {
"line": 6,
"column": 46
},
"end": {
"line": 6,
"column": 52
},
"identifierName": "source"
},
"name": "source"
},
"computed": false
}
}
},
{
"type": "StringLiteral",
"start": 221,
"end": 223,
"loc": {
"start": {
"line": 6,
"column": 54
},
"end": {
"line": 6,
"column": 56
}
},
"extra": {
"rawValue": "",
"raw": "''"
},
"value": ""
}
]
}
}
],
"kind": "const"
},
{
"type": "ReturnStatement",
"start": 228,
"end": 248,
"loc": {
"start": {
"line": 7,
"column": 2
},
"end": {
"line": 7,
"column": 22
}
},
"argument": {
"type": "CallExpression",
"start": 235,
"end": 247,
"loc": {
"start": {
"line": 7,
"column": 9
},
"end": {
"line": 7,
"column": 21
}
},
"callee": {
"type": "Identifier",
"start": 235,
"end": 241,
"loc": {
"start": {
"line": 7,
"column": 9
},
"end": {
"line": 7,
"column": 15
},
"identifierName": "RegExp"
},
"name": "RegExp"
},
"arguments": [
{
"type": "Identifier",
"start": 242,
"end": 246,
"loc": {
"start": {
"line": 7,
"column": 16
},
"end": {
"line": 7,
"column": 20
},
"identifierName": "full"
},
"name": "full"
}
]
}
}
],
"directives": []
}
},
{
"type": "FunctionDeclaration",
"start": 252,
"end": 582,
"loc": {
"start": {
"line": 10,
"column": 0
},
"end": {
"line": 21,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 261,
"end": 278,
"loc": {
"start": {
"line": 10,
"column": 9
},
"end": {
"line": 10,
"column": 26
},
"identifierName": "combineExtractors"
},
"name": "combineExtractors"
},
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "RestElement",
"start": 279,
"end": 292,
"loc": {
"start": {
"line": 10,
"column": 27
},
"end": {
"line": 10,
"column": 40
}
},
"argument": {
"type": "Identifier",
"start": 282,
"end": 292,
"loc": {
"start": {
"line": 10,
"column": 30
},
"end": {
"line": 10,
"column": 40
},
"identifierName": "extractors"
},
"name": "extractors"
}
}
],
"body": {
"type": "BlockStatement",
"start": 294,
"end": 582,
"loc": {
"start": {
"line": 10,
"column": 42
},
"end": {
"line": 21,
"column": 1
}
},
"body": [
{
"type": "ReturnStatement",
"start": 298,
"end": 580,
"loc": {
"start": {
"line": 11,
"column": 2
},
"end": {
"line": 20,
"column": 19
}
},
"argument": {
"type": "ArrowFunctionExpression",
"start": 305,
"end": 579,
"loc": {
"start": {
"line": 11,
"column": 9
},
"end": {
"line": 20,
"column": 18
}
},
"id": null,
"generator": false,
"expression": true,
"async": false,
"params": [
{
"type": "Identifier",
"start": 305,
"end": 306,
"loc": {
"start": {
"line": 11,
"column": 9
},
"end": {
"line": 11,
"column": 10
},
"identifierName": "m"
},
"name": "m"
}
],
"body": {
"type": "CallExpression",
"start": 314,
"end": 579,
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 20,
"column": 18
}
},
"callee": {
"type": "MemberExpression",
"start": 314,
"end": 573,
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 20,
"column": 12
}
},
"object": {
"type": "CallExpression",
"start": 314,
"end": 560,
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 19,
"column": 7
}
},
"callee": {
"type": "MemberExpression",
"start": 314,
"end": 338,
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 13,
"column": 13
}
},
"object": {
"type": "Identifier",
"start": 314,
"end": 324,
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 12,
"column": 14
},
"identifierName": "extractors"
},
"name": "extractors"
},
"property": {
"type": "Identifier",
"start": 332,
"end": 338,
"loc": {
"start": {
"line": 13,
"column": 7
},
"end": {
"line": 13,
"column": 13
},
"identifierName": "reduce"
},
"name": "reduce"
},
"computed": false
},
"arguments": [
{
"type": "ArrowFunctionExpression",
"start": 348,
"end": 529,
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 17,
"column": 9
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "ArrayPattern",
"start": 349,
"end": 381,
"loc": {
"start": {
"line": 14,
"column": 9
},
"end": {
"line": 14,
"column": 41
}
},
"elements": [
{
"type": "Identifier",
"start": 350,
"end": 360,
"loc": {
"start": {
"line": 14,
"column": 10
},
"end": {
"line": 14,
"column": 20
},
"identifierName": "mergedVals"
},
"name": "mergedVals"
},
{
"type": "Identifier",
"start": 362,
"end": 372,
"loc": {
"start": {
"line": 14,
"column": 22
},
"end": {
"line": 14,
"column": 32
},
"identifierName": "mergedZone"
},
"name": "mergedZone"
},
{
"type": "Identifier",
"start": 374,
"end": 380,
"loc": {
"start": {
"line": 14,
"column": 34
},
"end": {
"line": 14,
"column": 40
},
"identifierName": "cursor"
},
"name": "cursor"
}
]
},
{
"type": "Identifier",
"start": 383,
"end": 385,
"loc": {
"start": {
"line": 14,
"column": 43
},
"end": {
"line": 14,
"column": 45
},
"identifierName": "ex"
},
"name": "ex"
}
],
"body": {
"type": "BlockStatement",
"start": 390,
"end": 529,
"loc": {
"start": {
"line": 14,
"column": 50
},
"end": {
"line": 17,
"column": 9
}
},
"body": [
{
"type": "VariableDeclaration",
"start": 402,
"end": 442,
"loc": {
"start": {
"line": 15,
"column": 10
},
"end": {
"line": 15,
"column": 50
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 408,
"end": 441,
"loc": {
"start": {
"line": 15,
"column": 16
},
"end": {
"line": 15,
"column": 49
}
},
"id": {
"type": "ArrayPattern",
"start": 408,
"end": 425,
"loc": {
"start": {
"line": 15,
"column": 16
},
"end": {
"line": 15,
"column": 33
}
},
"elements": [
{
"type": "Identifier",
"start": 409,
"end": 412,
"loc": {
"start": {
"line": 15,
"column": 17
},
"end": {
"line": 15,
"column": 20
},
"identifierName": "val"
},
"name": "val"
},
{
"type": "Identifier",
"start": 414,
"end": 418,
"loc": {
"start": {
"line": 15,
"column": 22
},
"end": {
"line": 15,
"column": 26
},
"identifierName": "zone"
},
"name": "zone"
},
{
"type": "Identifier",
"start": 420,
"end": 424,
"loc": {
"start": {
"line": 15,
"column": 28
},
"end": {
"line": 15,
"column": 32
},
"identifierName": "next"
},
"name": "next"
}
]
},
"init": {
"type": "CallExpression",
"start": 428,
"end": 441,
"loc": {
"start": {
"line": 15,
"column": 36
},
"end": {
"line": 15,
"column": 49
}
},
"callee": {
"type": "Identifier",
"start": 428,
"end": 430,
"loc": {
"start": {
"line": 15,
"column": 36
},
"end": {
"line": 15,
"column": 38
},
"identifierName": "ex"
},
"name": "ex"
},
"arguments": [
{
"type": "Identifier",
"start": 431,
"end": 432,
"loc": {
"start": {
"line": 15,
"column": 39
},
"end": {
"line": 15,
"column": 40
},
"identifierName": "m"
},
"name": "m"
},
{
"type": "Identifier",
"start": 434,
"end": 440,
"loc": {
"start": {
"line": 15,
"column": 42
},
"end": {
"line": 15,
"column": 48
},
"identifierName": "cursor"
},
"name": "cursor"
}
]
}
}
],
"kind": "const"
},
{
"type": "ReturnStatement",
"start": 453,
"end": 519,
"loc": {
"start": {
"line": 16,
"column": 10
},
"end": {
"line": 16,
"column": 76
}
},
"argument": {
"type": "ArrayExpression",
"start": 460,
"end": 518,
"loc": {
"start": {
"line": 16,
"column": 17
},
"end": {
"line": 16,
"column": 75
}
},
"elements": [
{
"type": "CallExpression",
"start": 461,
"end": 491,
"loc": {
"start": {
"line": 16,
"column": 18
},
"end": {
"line": 16,
"column": 48
}
},
"callee": {
"type": "MemberExpression",
"start": 461,
"end": 474,
"loc": {
"start": {
"line": 16,
"column": 18
},
"end": {
"line": 16,
"column": 31
}
},
"object": {
"type": "Identifier",
"start": 461,
"end": 467,
"loc": {
"start": {
"line": 16,
"column": 18
},
"end": {
"line": 16,
"column": 24
},
"identifierName": "Object"
},
"name": "Object"
},
"property": {
"type": "Identifier",
"start": 468,
"end": 474,
"loc": {
"start": {
"line": 16,
"column": 25
},
"end": {
"line": 16,
"column": 31
},
"identifierName": "assign"
},
"name": "assign"
},
"computed": false
},
"arguments": [
{
"type": "Identifier",
"start": 475,
"end": 485,
"loc": {
"start": {
"line": 16,
"column": 32
},
"end": {
"line": 16,
"column": 42
},
"identifierName": "mergedVals"
},
"name": "mergedVals"
},
{
"type": "Identifier",
"start": 487,
"end": 490,
"loc": {
"start": {
"line": 16,
"column": 44
},
"end": {
"line": 16,
"column": 47
},
"identifierName": "val"
},
"name": "val"
}
]
},
{
"type": "LogicalExpression",
"start": 493,
"end": 511,
"loc": {
"start": {
"line": 16,
"column": 50
},
"end": {
"line": 16,
"column": 68
}
},
"left": {
"type": "Identifier",
"start": 493,
"end": 503,
"loc": {
"start": {
"line": 16,
"column": 50
},
"end": {
"line": 16,
"column": 60
},
"identifierName": "mergedZone"
},
"name": "mergedZone"
},
"operator": "||",
"right": {
"type": "Identifier",
"start": 507,
"end": 511,
"loc": {
"start": {
"line": 16,
"column": 64
},
"end": {
"line": 16,
"column": 68
},
"identifierName": "zone"
},
"name": "zone"
}