luxon
Version:
Immutable date wrapper
1,372 lines (1,371 loc) • 505 kB
JSON
{
"type": "File",
"start": 0,
"end": 2544,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 120,
"column": 0
}
},
"program": {
"type": "Program",
"start": 0,
"end": 2544,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 120,
"column": 0
}
},
"sourceType": "module",
"body": [
{
"type": "ExportNamedDeclaration",
"start": 21,
"end": 2543,
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 119,
"column": 1
}
},
"specifiers": [],
"source": null,
"declaration": {
"type": "ClassDeclaration",
"start": 28,
"end": 2543,
"loc": {
"start": {
"line": 5,
"column": 7
},
"end": {
"line": 119,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 34,
"end": 41,
"loc": {
"start": {
"line": 5,
"column": 13
},
"end": {
"line": 5,
"column": 20
},
"identifierName": "English"
},
"name": "English",
"leadingComments": null
},
"superClass": null,
"body": {
"type": "ClassBody",
"start": 42,
"end": 2543,
"loc": {
"start": {
"line": 5,
"column": 21
},
"end": {
"line": 119,
"column": 1
}
},
"body": [
{
"type": "ClassMethod",
"start": 46,
"end": 288,
"loc": {
"start": {
"line": 6,
"column": 2
},
"end": {
"line": 21,
"column": 3
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 57,
"end": 67,
"loc": {
"start": {
"line": 6,
"column": 13
},
"end": {
"line": 6,
"column": 23
},
"identifierName": "monthsLong"
},
"name": "monthsLong"
},
"static": true,
"kind": "get",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 70,
"end": 288,
"loc": {
"start": {
"line": 6,
"column": 26
},
"end": {
"line": 21,
"column": 3
}
},
"body": [
{
"type": "ReturnStatement",
"start": 76,
"end": 284,
"loc": {
"start": {
"line": 7,
"column": 4
},
"end": {
"line": 20,
"column": 6
}
},
"argument": {
"type": "ArrayExpression",
"start": 83,
"end": 283,
"loc": {
"start": {
"line": 7,
"column": 11
},
"end": {
"line": 20,
"column": 5
}
},
"elements": [
{
"type": "StringLiteral",
"start": 91,
"end": 100,
"loc": {
"start": {
"line": 8,
"column": 6
},
"end": {
"line": 8,
"column": 15
}
},
"extra": {
"rawValue": "January",
"raw": "'January'"
},
"value": "January"
},
{
"type": "StringLiteral",
"start": 108,
"end": 118,
"loc": {
"start": {
"line": 9,
"column": 6
},
"end": {
"line": 9,
"column": 16
}
},
"extra": {
"rawValue": "February",
"raw": "'February'"
},
"value": "February"
},
{
"type": "StringLiteral",
"start": 126,
"end": 133,
"loc": {
"start": {
"line": 10,
"column": 6
},
"end": {
"line": 10,
"column": 13
}
},
"extra": {
"rawValue": "March",
"raw": "'March'"
},
"value": "March"
},
{
"type": "StringLiteral",
"start": 141,
"end": 148,
"loc": {
"start": {
"line": 11,
"column": 6
},
"end": {
"line": 11,
"column": 13
}
},
"extra": {
"rawValue": "April",
"raw": "'April'"
},
"value": "April"
},
{
"type": "StringLiteral",
"start": 156,
"end": 161,
"loc": {
"start": {
"line": 12,
"column": 6
},
"end": {
"line": 12,
"column": 11
}
},
"extra": {
"rawValue": "May",
"raw": "'May'"
},
"value": "May"
},
{
"type": "StringLiteral",
"start": 169,
"end": 175,
"loc": {
"start": {
"line": 13,
"column": 6
},
"end": {
"line": 13,
"column": 12
}
},
"extra": {
"rawValue": "June",
"raw": "'June'"
},
"value": "June"
},
{
"type": "StringLiteral",
"start": 183,
"end": 189,
"loc": {
"start": {
"line": 14,
"column": 6
},
"end": {
"line": 14,
"column": 12
}
},
"extra": {
"rawValue": "July",
"raw": "'July'"
},
"value": "July"
},
{
"type": "StringLiteral",
"start": 197,
"end": 205,
"loc": {
"start": {
"line": 15,
"column": 6
},
"end": {
"line": 15,
"column": 14
}
},
"extra": {
"rawValue": "August",
"raw": "'August'"
},
"value": "August"
},
{
"type": "StringLiteral",
"start": 213,
"end": 224,
"loc": {
"start": {
"line": 16,
"column": 6
},
"end": {
"line": 16,
"column": 17
}
},
"extra": {
"rawValue": "September",
"raw": "'September'"
},
"value": "September"
},
{
"type": "StringLiteral",
"start": 232,
"end": 241,
"loc": {
"start": {
"line": 17,
"column": 6
},
"end": {
"line": 17,
"column": 15
}
},
"extra": {
"rawValue": "October",
"raw": "'October'"
},
"value": "October"
},
{
"type": "StringLiteral",
"start": 249,
"end": 259,
"loc": {
"start": {
"line": 18,
"column": 6
},
"end": {
"line": 18,
"column": 16
}
},
"extra": {
"rawValue": "November",
"raw": "'November'"
},
"value": "November"
},
{
"type": "StringLiteral",
"start": 267,
"end": 277,
"loc": {
"start": {
"line": 19,
"column": 6
},
"end": {
"line": 19,
"column": 16
}
},
"extra": {
"rawValue": "December",
"raw": "'December'"
},
"value": "December"
}
]
}
}
],
"directives": []
}
},
{
"type": "ClassMethod",
"start": 292,
"end": 419,
"loc": {
"start": {
"line": 23,
"column": 2
},
"end": {
"line": 25,
"column": 3
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 303,
"end": 314,
"loc": {
"start": {
"line": 23,
"column": 13
},
"end": {
"line": 23,
"column": 24
},
"identifierName": "monthsShort"
},
"name": "monthsShort"
},
"static": true,
"kind": "get",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 317,
"end": 419,
"loc": {
"start": {
"line": 23,
"column": 27
},
"end": {
"line": 25,
"column": 3
}
},
"body": [
{
"type": "ReturnStatement",
"start": 323,
"end": 415,
"loc": {
"start": {
"line": 24,
"column": 4
},
"end": {
"line": 24,
"column": 96
}
},
"argument": {
"type": "ArrayExpression",
"start": 330,
"end": 414,
"loc": {
"start": {
"line": 24,
"column": 11
},
"end": {
"line": 24,
"column": 95
}
},
"elements": [
{
"type": "StringLiteral",
"start": 331,
"end": 336,
"loc": {
"start": {
"line": 24,
"column": 12
},
"end": {
"line": 24,
"column": 17
}
},
"extra": {
"rawValue": "Jan",
"raw": "'Jan'"
},
"value": "Jan"
},
{
"type": "StringLiteral",
"start": 338,
"end": 343,
"loc": {
"start": {
"line": 24,
"column": 19
},
"end": {
"line": 24,
"column": 24
}
},
"extra": {
"rawValue": "Feb",
"raw": "'Feb'"
},
"value": "Feb"
},
{
"type": "StringLiteral",
"start": 345,
"end": 350,
"loc": {
"start": {
"line": 24,
"column": 26
},
"end": {
"line": 24,
"column": 31
}
},
"extra": {
"rawValue": "Mar",
"raw": "'Mar'"
},
"value": "Mar"
},
{
"type": "StringLiteral",
"start": 352,
"end": 357,
"loc": {
"start": {
"line": 24,
"column": 33
},
"end": {
"line": 24,
"column": 38
}
},
"extra": {
"rawValue": "Apr",
"raw": "'Apr'"
},
"value": "Apr"
},
{
"type": "StringLiteral",
"start": 359,
"end": 364,
"loc": {
"start": {
"line": 24,
"column": 40
},
"end": {
"line": 24,
"column": 45
}
},
"extra": {
"rawValue": "May",
"raw": "'May'"
},
"value": "May"
},
{
"type": "StringLiteral",
"start": 366,
"end": 371,
"loc": {
"start": {
"line": 24,
"column": 47
},
"end": {
"line": 24,
"column": 52
}
},
"extra": {
"rawValue": "Jun",
"raw": "'Jun'"
},
"value": "Jun"
},
{
"type": "StringLiteral",
"start": 373,
"end": 378,
"loc": {
"start": {
"line": 24,
"column": 54
},
"end": {
"line": 24,
"column": 59
}
},
"extra": {
"rawValue": "Jul",
"raw": "'Jul'"
},
"value": "Jul"
},
{
"type": "StringLiteral",
"start": 380,
"end": 385,
"loc": {
"start": {
"line": 24,
"column": 61
},
"end": {
"line": 24,
"column": 66
}
},
"extra": {
"rawValue": "Aug",
"raw": "'Aug'"
},
"value": "Aug"
},
{
"type": "StringLiteral",
"start": 387,
"end": 392,
"loc": {
"start": {
"line": 24,
"column": 68
},
"end": {
"line": 24,
"column": 73
}
},
"extra": {
"rawValue": "Sep",
"raw": "'Sep'"
},
"value": "Sep"
},
{
"type": "StringLiteral",
"start": 394,
"end": 399,
"loc": {
"start": {
"line": 24,
"column": 75
},
"end": {
"line": 24,
"column": 80
}
},
"extra": {
"rawValue": "Oct",
"raw": "'Oct'"
},
"value": "Oct"
},
{
"type": "StringLiteral",
"start": 401,
"end": 406,
"loc": {
"start": {
"line": 24,
"column": 82
},
"end": {
"line": 24,
"column": 87
}
},
"extra": {
"rawValue": "Nov",
"raw": "'Nov'"
},
"value": "Nov"
},
{
"type": "StringLiteral",
"start": 408,
"end": 413,
"loc": {
"start": {
"line": 24,
"column": 89
},
"end": {
"line": 24,
"column": 94
}
},
"extra": {
"rawValue": "Dec",
"raw": "'Dec'"
},
"value": "Dec"
}
]
}
}
],
"directives": []
}
},
{
"type": "ClassMethod",
"start": 423,
"end": 527,
"loc": {
"start": {
"line": 27,
"column": 2
},
"end": {
"line": 29,
"column": 3
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 434,
"end": 446,
"loc": {
"start": {
"line": 27,
"column": 13
},
"end": {
"line": 27,
"column": 25
},
"identifierName": "monthsNarrow"
},
"name": "monthsNarrow"
},
"static": true,
"kind": "get",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 449,
"end": 527,
"loc": {
"start": {
"line": 27,
"column": 28
},
"end": {
"line": 29,
"column": 3
}
},
"body": [
{
"type": "ReturnStatement",
"start": 455,
"end": 523,
"loc": {
"start": {
"line": 28,
"column": 4
},
"end": {
"line": 28,
"column": 72
}
},
"argument": {
"type": "ArrayExpression",
"start": 462,
"end": 522,
"loc": {
"start": {
"line": 28,
"column": 11
},
"end": {
"line": 28,
"column": 71
}
},
"elements": [
{
"type": "StringLiteral",
"start": 463,
"end": 466,
"loc": {
"start": {
"line": 28,
"column": 12
},
"end": {
"line": 28,
"column": 15
}
},
"extra": {
"rawValue": "J",
"raw": "'J'"
},
"value": "J"
},
{
"type": "StringLiteral",
"start": 468,
"end": 471,
"loc": {
"start": {
"line": 28,
"column": 17
},
"end": {
"line": 28,
"column": 20
}
},
"extra": {
"rawValue": "F",
"raw": "'F'"
},
"value": "F"
},
{
"type": "StringLiteral",
"start": 473,
"end": 476,
"loc": {
"start": {
"line": 28,
"column": 22
},
"end": {
"line": 28,
"column": 25
}
},
"extra": {
"rawValue": "M",
"raw": "'M'"
},
"value": "M"
},
{
"type": "StringLiteral",
"start": 478,
"end": 481,
"loc": {
"start": {
"line": 28,
"column": 27
},
"end": {
"line": 28,
"column": 30
}
},
"extra": {
"rawValue": "A",
"raw": "'A'"
},
"value": "A"
},
{
"type": "StringLiteral",
"start": 483,
"end": 486,
"loc": {
"start": {
"line": 28,
"column": 32
},
"end": {
"line": 28,
"column": 35
}
},
"extra": {
"rawValue": "M",
"raw": "'M'"
},
"value": "M"
},
{
"type": "StringLiteral",
"start": 488,
"end": 491,
"loc": {
"start": {
"line": 28,
"column": 37
},
"end": {
"line": 28,
"column": 40
}
},
"extra": {
"rawValue": "J",
"raw": "'J'"
},
"value": "J"
},
{
"type": "StringLiteral",
"start": 493,
"end": 496,
"loc": {
"start": {
"line": 28,
"column": 42
},
"end": {
"line": 28,
"column": 45
}
},
"extra": {
"rawValue": "J",
"raw": "'J'"
},
"value": "J"
},
{
"type": "StringLiteral",
"start": 498,
"end": 501,
"loc": {
"start": {
"line": 28,
"column": 47
},
"end": {
"line": 28,
"column": 50
}
},
"extra": {
"rawValue": "A",
"raw": "'A'"
},
"value": "A"
},
{
"type": "StringLiteral",
"start": 503,
"end": 506,
"loc": {
"start": {
"line": 28,
"column": 52
},
"end": {
"line": 28,
"column": 55
}
},
"extra": {
"rawValue": "S",
"raw": "'S'"
},
"value": "S"
},
{
"type": "StringLiteral",
"start": 508,
"end": 511,
"loc": {
"start": {
"line": 28,
"column": 57
},
"end": {
"line": 28,
"column": 60
}
},
"extra": {
"rawValue": "O",
"raw": "'O'"
},
"value": "O"
},
{
"type": "StringLiteral",
"start": 513,
"end": 516,
"loc": {
"start": {
"line": 28,
"column": 62
},
"end": {
"line": 28,
"column": 65
}
},
"extra": {
"rawValue": "N",
"raw": "'N'"
},
"value": "N"
},
{
"type": "StringLiteral",
"start": 518,
"end": 521,
"loc": {
"start": {
"line": 28,
"column": 67
},
"end": {
"line": 28,
"column": 70
}
},
"extra": {
"rawValue": "D",
"raw": "'D'"
},
"value": "D"
}
]
}
}
],
"directives": []
}
},
{
"type": "ClassMethod",
"start": 531,
"end": 1003,
"loc": {
"start": {
"line": 31,
"column": 2
},
"end": {
"line": 46,
"column": 3
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 538,
"end": 544,
"loc": {
"start": {
"line": 31,
"column": 9
},
"end": {
"line": 31,
"column": 15
},
"identifierName": "months"
},
"name": "months"
},
"static": true,
"kind": "method",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 545,
"end": 551,
"loc": {
"start": {
"line": 31,
"column": 16
},
"end": {
"line": 31,
"column": 22
},
"identifierName": "length"
},
"name": "length"
}
],
"body": {
"type": "BlockStatement",
"start": 553,
"end": 1003,
"loc": {
"start": {
"line": 31,
"column": 24
},
"end": {
"line": 46,
"column": 3
}
},
"body": [
{
"type": "SwitchStatement",
"start": 559,
"end": 999,
"loc": {
"start": {
"line": 32,
"column": 4
},
"end": {
"line": 45,
"column": 5
}
},
"discriminant": {
"type": "Identifier",
"start": 567,
"end": 573,
"loc": {
"start": {
"line": 32,
"column": 12
},
"end": {
"line": 32,
"column": 18
},
"identifierName": "length"
},
"name": "length"
},
"cases": [
{
"type": "SwitchCase",
"start": 583,
"end": 634,
"loc": {
"start": {
"line": 33,
"column": 6
},
"end": {
"line": 34,
"column": 36
}
},
"consequent": [
{
"type": "ReturnStatement",
"start": 606,
"end": 634,
"loc": {
"start": {
"line": 34,
"column": 8
},
"end": {
"line": 34,
"column": 36
}
},
"argument": {
"type": "MemberExpression",
"start": 613,
"end": 633,
"loc": {
"start": {
"line": 34,
"column": 15
},
"end": {
"line": 34,
"column": 35
}
},
"object": {
"type": "Identifier",
"start": 613,
"end": 620,
"loc": {
"start": {
"line": 34,
"column": 15
},
"end": {
"line": 34,
"column": 22
},
"identifierName": "English"
},
"name": "English"
},
"property": {
"type": "Identifier",
"start": 621,
"end": 633,
"loc": {
"start": {
"line": 34,
"column": 23
},
"end": {
"line": 34,
"column": 35
},
"identifierName": "monthsNarrow"
},
"name": "monthsNarrow"
},
"computed": false
}
}
],
"test": {
"type": "StringLiteral",
"start": 588,
"end": 596,
"loc": {
"start": {
"line": 33,
"column": 11
},
"end": {
"line": 33,
"column": 19
}
},
"extra": {
"rawValue": "narrow",
"raw": "'narrow'"
},
"value": "narrow"
}
},
{
"type": "SwitchCase",
"start": 641,
"end": 690,
"loc": {
"start": {
"line": 35,
"column": 6
},
"end": {
"line": 36,
"column": 35
}
},
"consequent": [
{
"type": "ReturnStatement",
"start": 663,
"end": 690,
"loc": {
"start": {
"line": 36,
"column": 8
},
"end": {
"line": 36,
"column": 35
}
},
"argument": {
"type": "MemberExpression",
"start": 670,
"end": 689,
"loc": {
"start": {
"line": 36,
"column": 15
},
"end": {
"line": 36,
"column": 34
}
},
"object": {
"type": "Identifier",
"start": 670,
"end": 677,
"loc": {
"start": {
"line": 36,
"column": 15
},
"end": {
"line": 36,
"column": 22
},
"identifierName": "English"
},
"name": "English"
},
"property": {
"type": "Identifier",
"start": 678,
"end": 689,
"loc": {
"start": {
"line": 36,
"column": 23
},
"end": {
"line": 36,
"column": 34
},
"identifierName": "monthsShort"
},
"name": "monthsShort"
},
"computed": false
}
}
],