luxon
Version:
Immutable date wrapper
1,701 lines (1,700 loc) • 136 kB
JSON
{
"type": "File",
"start": 0,
"end": 1011,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 62,
"column": 0
}
},
"program": {
"type": "Program",
"start": 0,
"end": 1011,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 62,
"column": 0
}
},
"sourceType": "module",
"body": [
{
"type": "ClassDeclaration",
"start": 96,
"end": 129,
"loc": {
"start": {
"line": 6,
"column": 0
},
"end": {
"line": 6,
"column": 33
}
},
"id": {
"type": "Identifier",
"start": 102,
"end": 112,
"loc": {
"start": {
"line": 6,
"column": 6
},
"end": {
"line": 6,
"column": 16
},
"identifierName": "LuxonError"
},
"name": "LuxonError",
"leadingComments": null
},
"superClass": {
"type": "Identifier",
"start": 121,
"end": 126,
"loc": {
"start": {
"line": 6,
"column": 25
},
"end": {
"line": 6,
"column": 30
},
"identifierName": "Error"
},
"name": "Error"
},
"body": {
"type": "ClassBody",
"start": 127,
"end": 129,
"loc": {
"start": {
"line": 6,
"column": 31
},
"end": {
"line": 6,
"column": 33
}
},
"body": [],
"leadingComments": null,
"trailingComments": null
},
"leadingComments": [
{
"type": "CommentLine",
"value": " these aren't really private, but nor are they really useful to document",
"start": 0,
"end": 74,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 74
}
}
},
{
"type": "CommentBlock",
"value": "*\n * @private\n ",
"start": 76,
"end": 95,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 5,
"column": 3
}
}
}
],
"trailingComments": [
{
"type": "CommentBlock",
"value": "*\n * @private\n ",
"start": 131,
"end": 150,
"loc": {
"start": {
"line": 8,
"column": 0
},
"end": {
"line": 10,
"column": 3
}
}
}
]
},
{
"type": "ExportNamedDeclaration",
"start": 151,
"end": 277,
"loc": {
"start": {
"line": 11,
"column": 0
},
"end": {
"line": 15,
"column": 1
}
},
"specifiers": [],
"source": null,
"declaration": {
"type": "ClassDeclaration",
"start": 158,
"end": 277,
"loc": {
"start": {
"line": 11,
"column": 7
},
"end": {
"line": 15,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 164,
"end": 184,
"loc": {
"start": {
"line": 11,
"column": 13
},
"end": {
"line": 11,
"column": 33
},
"identifierName": "InvalidDateTimeError"
},
"name": "InvalidDateTimeError",
"leadingComments": null
},
"superClass": {
"type": "Identifier",
"start": 193,
"end": 203,
"loc": {
"start": {
"line": 11,
"column": 42
},
"end": {
"line": 11,
"column": 52
},
"identifierName": "LuxonError"
},
"name": "LuxonError"
},
"body": {
"type": "ClassBody",
"start": 204,
"end": 277,
"loc": {
"start": {
"line": 11,
"column": 53
},
"end": {
"line": 15,
"column": 1
}
},
"body": [
{
"type": "ClassMethod",
"start": 208,
"end": 275,
"loc": {
"start": {
"line": 12,
"column": 2
},
"end": {
"line": 14,
"column": 3
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 208,
"end": 219,
"loc": {
"start": {
"line": 12,
"column": 2
},
"end": {
"line": 12,
"column": 13
},
"identifierName": "constructor"
},
"name": "constructor"
},
"static": false,
"kind": "constructor",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 220,
"end": 226,
"loc": {
"start": {
"line": 12,
"column": 14
},
"end": {
"line": 12,
"column": 20
},
"identifierName": "reason"
},
"name": "reason"
}
],
"body": {
"type": "BlockStatement",
"start": 228,
"end": 275,
"loc": {
"start": {
"line": 12,
"column": 22
},
"end": {
"line": 14,
"column": 3
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 234,
"end": 271,
"loc": {
"start": {
"line": 13,
"column": 4
},
"end": {
"line": 13,
"column": 41
}
},
"expression": {
"type": "CallExpression",
"start": 234,
"end": 270,
"loc": {
"start": {
"line": 13,
"column": 4
},
"end": {
"line": 13,
"column": 40
}
},
"callee": {
"type": "Super",
"start": 234,
"end": 239,
"loc": {
"start": {
"line": 13,
"column": 4
},
"end": {
"line": 13,
"column": 9
}
}
},
"arguments": [
{
"type": "TemplateLiteral",
"start": 240,
"end": 269,
"loc": {
"start": {
"line": 13,
"column": 10
},
"end": {
"line": 13,
"column": 39
}
},
"expressions": [
{
"type": "Identifier",
"start": 261,
"end": 267,
"loc": {
"start": {
"line": 13,
"column": 31
},
"end": {
"line": 13,
"column": 37
},
"identifierName": "reason"
},
"name": "reason"
}
],
"quasis": [
{
"type": "TemplateElement",
"start": 241,
"end": 259,
"loc": {
"start": {
"line": 13,
"column": 11
},
"end": {
"line": 13,
"column": 29
}
},
"value": {
"raw": "Invalid DateTime: ",
"cooked": "Invalid DateTime: "
},
"tail": false
},
{
"type": "TemplateElement",
"start": 268,
"end": 268,
"loc": {
"start": {
"line": 13,
"column": 38
},
"end": {
"line": 13,
"column": 38
}
},
"value": {
"raw": "",
"cooked": ""
},
"tail": true
}
]
}
]
}
}
],
"directives": []
}
}
],
"trailingComments": null
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "*\n * @private\n ",
"start": 131,
"end": 150,
"loc": {
"start": {
"line": 8,
"column": 0
},
"end": {
"line": 10,
"column": 3
}
}
}
],
"trailingComments": [
{
"type": "CommentBlock",
"value": "*\n * @private\n ",
"start": 279,
"end": 298,
"loc": {
"start": {
"line": 17,
"column": 0
},
"end": {
"line": 19,
"column": 3
}
}
}
]
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "*\n * @private\n ",
"start": 131,
"end": 150,
"loc": {
"start": {
"line": 8,
"column": 0
},
"end": {
"line": 10,
"column": 3
}
}
}
],
"trailingComments": [
{
"type": "CommentBlock",
"value": "*\n * @private\n ",
"start": 279,
"end": 298,
"loc": {
"start": {
"line": 17,
"column": 0
},
"end": {
"line": 19,
"column": 3
}
}
}
]
},
{
"type": "ExportNamedDeclaration",
"start": 299,
"end": 425,
"loc": {
"start": {
"line": 20,
"column": 0
},
"end": {
"line": 24,
"column": 1
}
},
"specifiers": [],
"source": null,
"declaration": {
"type": "ClassDeclaration",
"start": 306,
"end": 425,
"loc": {
"start": {
"line": 20,
"column": 7
},
"end": {
"line": 24,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 312,
"end": 332,
"loc": {
"start": {
"line": 20,
"column": 13
},
"end": {
"line": 20,
"column": 33
},
"identifierName": "InvalidIntervalError"
},
"name": "InvalidIntervalError",
"leadingComments": null
},
"superClass": {
"type": "Identifier",
"start": 341,
"end": 351,
"loc": {
"start": {
"line": 20,
"column": 42
},
"end": {
"line": 20,
"column": 52
},
"identifierName": "LuxonError"
},
"name": "LuxonError"
},
"body": {
"type": "ClassBody",
"start": 352,
"end": 425,
"loc": {
"start": {
"line": 20,
"column": 53
},
"end": {
"line": 24,
"column": 1
}
},
"body": [
{
"type": "ClassMethod",
"start": 356,
"end": 423,
"loc": {
"start": {
"line": 21,
"column": 2
},
"end": {
"line": 23,
"column": 3
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 356,
"end": 367,
"loc": {
"start": {
"line": 21,
"column": 2
},
"end": {
"line": 21,
"column": 13
},
"identifierName": "constructor"
},
"name": "constructor"
},
"static": false,
"kind": "constructor",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 368,
"end": 374,
"loc": {
"start": {
"line": 21,
"column": 14
},
"end": {
"line": 21,
"column": 20
},
"identifierName": "reason"
},
"name": "reason"
}
],
"body": {
"type": "BlockStatement",
"start": 376,
"end": 423,
"loc": {
"start": {
"line": 21,
"column": 22
},
"end": {
"line": 23,
"column": 3
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 382,
"end": 419,
"loc": {
"start": {
"line": 22,
"column": 4
},
"end": {
"line": 22,
"column": 41
}
},
"expression": {
"type": "CallExpression",
"start": 382,
"end": 418,
"loc": {
"start": {
"line": 22,
"column": 4
},
"end": {
"line": 22,
"column": 40
}
},
"callee": {
"type": "Super",
"start": 382,
"end": 387,
"loc": {
"start": {
"line": 22,
"column": 4
},
"end": {
"line": 22,
"column": 9
}
}
},
"arguments": [
{
"type": "TemplateLiteral",
"start": 388,
"end": 417,
"loc": {
"start": {
"line": 22,
"column": 10
},
"end": {
"line": 22,
"column": 39
}
},
"expressions": [
{
"type": "Identifier",
"start": 409,
"end": 415,
"loc": {
"start": {
"line": 22,
"column": 31
},
"end": {
"line": 22,
"column": 37
},
"identifierName": "reason"
},
"name": "reason"
}
],
"quasis": [
{
"type": "TemplateElement",
"start": 389,
"end": 407,
"loc": {
"start": {
"line": 22,
"column": 11
},
"end": {
"line": 22,
"column": 29
}
},
"value": {
"raw": "Invalid Interval: ",
"cooked": "Invalid Interval: "
},
"tail": false
},
{
"type": "TemplateElement",
"start": 416,
"end": 416,
"loc": {
"start": {
"line": 22,
"column": 38
},
"end": {
"line": 22,
"column": 38
}
},
"value": {
"raw": "",
"cooked": ""
},
"tail": true
}
]
}
]
}
}
],
"directives": []
}
}
],
"trailingComments": null
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "*\n * @private\n ",
"start": 279,
"end": 298,
"loc": {
"start": {
"line": 17,
"column": 0
},
"end": {
"line": 19,
"column": 3
}
}
}
],
"trailingComments": [
{
"type": "CommentBlock",
"value": "*\n * @private\n ",
"start": 427,
"end": 446,
"loc": {
"start": {
"line": 26,
"column": 0
},
"end": {
"line": 28,
"column": 3
}
}
}
]
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "*\n * @private\n ",
"start": 279,
"end": 298,
"loc": {
"start": {
"line": 17,
"column": 0
},
"end": {
"line": 19,
"column": 3
}
}
}
],
"trailingComments": [
{
"type": "CommentBlock",
"value": "*\n * @private\n ",
"start": 427,
"end": 446,
"loc": {
"start": {
"line": 26,
"column": 0
},
"end": {
"line": 28,
"column": 3
}
}
}
]
},
{
"type": "ExportNamedDeclaration",
"start": 447,
"end": 573,
"loc": {
"start": {
"line": 29,
"column": 0
},
"end": {
"line": 33,
"column": 1
}
},
"specifiers": [],
"source": null,
"declaration": {
"type": "ClassDeclaration",
"start": 454,
"end": 573,
"loc": {
"start": {
"line": 29,
"column": 7
},
"end": {
"line": 33,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 460,
"end": 480,
"loc": {
"start": {
"line": 29,
"column": 13
},
"end": {
"line": 29,
"column": 33
},
"identifierName": "InvalidDurationError"
},
"name": "InvalidDurationError",
"leadingComments": null
},
"superClass": {
"type": "Identifier",
"start": 489,
"end": 499,
"loc": {
"start": {
"line": 29,
"column": 42
},
"end": {
"line": 29,
"column": 52
},
"identifierName": "LuxonError"
},
"name": "LuxonError"
},
"body": {
"type": "ClassBody",
"start": 500,
"end": 573,
"loc": {
"start": {
"line": 29,
"column": 53
},
"end": {
"line": 33,
"column": 1
}
},
"body": [
{
"type": "ClassMethod",
"start": 504,
"end": 571,
"loc": {
"start": {
"line": 30,
"column": 2
},
"end": {
"line": 32,
"column": 3
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 504,
"end": 515,
"loc": {
"start": {
"line": 30,
"column": 2
},
"end": {
"line": 30,
"column": 13
},
"identifierName": "constructor"
},
"name": "constructor"
},
"static": false,
"kind": "constructor",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 516,
"end": 522,
"loc": {
"start": {
"line": 30,
"column": 14
},
"end": {
"line": 30,
"column": 20
},
"identifierName": "reason"
},
"name": "reason"
}
],
"body": {
"type": "BlockStatement",
"start": 524,
"end": 571,
"loc": {
"start": {
"line": 30,
"column": 22
},
"end": {
"line": 32,
"column": 3
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 530,
"end": 567,
"loc": {
"start": {
"line": 31,
"column": 4
},
"end": {
"line": 31,
"column": 41
}
},
"expression": {
"type": "CallExpression",
"start": 530,
"end": 566,
"loc": {
"start": {
"line": 31,
"column": 4
},
"end": {
"line": 31,
"column": 40
}
},
"callee": {
"type": "Super",
"start": 530,
"end": 535,
"loc": {
"start": {
"line": 31,
"column": 4
},
"end": {
"line": 31,
"column": 9
}
}
},
"arguments": [
{
"type": "TemplateLiteral",
"start": 536,
"end": 565,
"loc": {
"start": {
"line": 31,
"column": 10
},
"end": {
"line": 31,
"column": 39
}
},
"expressions": [
{
"type": "Identifier",
"start": 557,
"end": 563,
"loc": {
"start": {
"line": 31,
"column": 31
},
"end": {
"line": 31,
"column": 37
},
"identifierName": "reason"
},
"name": "reason"
}
],
"quasis": [
{
"type": "TemplateElement",
"start": 537,
"end": 555,
"loc": {
"start": {
"line": 31,
"column": 11
},
"end": {
"line": 31,
"column": 29
}
},
"value": {
"raw": "Invalid Duration: ",
"cooked": "Invalid Duration: "
},
"tail": false
},
{
"type": "TemplateElement",
"start": 564,
"end": 564,
"loc": {
"start": {
"line": 31,
"column": 38
},
"end": {
"line": 31,
"column": 38
}
},
"value": {
"raw": "",
"cooked": ""
},
"tail": true
}
]
}
]
}
}
],
"directives": []
}
}
],
"trailingComments": null
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "*\n * @private\n ",
"start": 427,
"end": 446,
"loc": {
"start": {
"line": 26,
"column": 0
},
"end": {
"line": 28,
"column": 3
}
}
}
],
"trailingComments": [
{
"type": "CommentBlock",
"value": "*\n * @private\n ",
"start": 575,
"end": 594,
"loc": {
"start": {
"line": 35,
"column": 0
},
"end": {
"line": 37,
"column": 3
}
}
}
]
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "*\n * @private\n ",
"start": 427,
"end": 446,
"loc": {
"start": {
"line": 26,
"column": 0
},
"end": {
"line": 28,
"column": 3
}
}
}
],
"trailingComments": [
{
"type": "CommentBlock",
"value": "*\n * @private\n ",
"start": 575,
"end": 594,
"loc": {
"start": {
"line": 35,
"column": 0
},
"end": {
"line": 37,
"column": 3
}
}
}
]
},
{
"type": "ExportNamedDeclaration",
"start": 595,
"end": 659,
"loc": {
"start": {
"line": 38,
"column": 0
},
"end": {
"line": 38,
"column": 64
}
},
"specifiers": [],
"source": null,
"declaration": {
"type": "ClassDeclaration",
"start": 602,
"end": 659,
"loc": {
"start": {
"line": 38,
"column": 7
},
"end": {
"line": 38,
"column": 64
}
},
"id": {
"type": "Identifier",
"start": 608,
"end": 637,
"loc": {
"start": {
"line": 38,
"column": 13
},
"end": {
"line": 38,
"column": 42
},
"identifierName": "ConflictingSpecificationError"
},
"name": "ConflictingSpecificationError",
"leadingComments": null
},
"superClass": {
"type": "Identifier",
"start": 646,
"end": 656,
"loc": {
"start": {
"line": 38,
"column": 51
},
"end": {
"line": 38,
"column": 61
},
"identifierName": "LuxonError"
},
"name": "LuxonError"
},
"body": {
"type": "ClassBody",
"start": 657,
"end": 659,
"loc": {
"start": {
"line": 38,
"column": 62
},
"end": {
"line": 38,
"column": 64
}
},
"body": [],
"leadingComments": null,
"trailingComments": null
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "*\n * @private\n ",
"start": 575,
"end": 594,
"loc": {
"start": {
"line": 35,
"column": 0
},
"end": {
"line": 37,
"column": 3
}
}
}
],
"trailingComments": [
{
"type": "CommentBlock",
"value": "*\n * @private\n ",
"start": 661,
"end": 680,
"loc": {
"start": {
"line": 40,
"column": 0
},
"end": {
"line": 42,
"column": 3
}
}
}
]
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "*\n * @private\n ",
"start": 575,
"end": 594,
"loc": {
"start": {
"line": 35,
"column": 0
},
"end": {
"line": 37,
"column": 3
}
}
}
],
"trailingComments": [
{
"type": "CommentBlock",
"value": "*\n * @private\n ",
"start": 661,
"end": 680,
"loc": {
"start": {
"line": 40,
"column": 0
},
"end": {
"line": 42,
"column": 3
}
}
}
]
},
{
"type": "ExportNamedDeclaration",
"start": 681,
"end": 794,
"loc": {
"start": {
"line": 43,
"column": 0
},
"end": {
"line": 47,
"column": 1
}
},
"specifiers": [],
"source": null,
"declaration": {
"type": "ClassDeclaration",
"start": 688,
"end": 794,
"loc": {
"start": {
"line": 43,
"column": 7
},
"end": {
"line": 47,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 694,
"end": 710,
"loc": {
"start": {
"line": 43,
"column": 13
},
"end": {
"line": 43,
"column": 29
},
"identifierName": "InvalidUnitError"
},
"name": "InvalidUnitError",
"leadingComments": null
},
"superClass": {
"type": "Identifier",
"start": 719,
"end": 729,
"loc": {
"start": {
"line": 43,
"column": 38
},
"end": {
"line": 43,
"column": 48
},
"identifierName": "LuxonError"
},
"name": "LuxonError"
},
"body": {
"type": "ClassBody",
"start": 730,
"end": 794,
"loc": {
"start": {
"line": 43,
"column": 49
},
"end": {
"line": 47,
"column": 1
}
},
"body": [
{
"type": "ClassMethod",
"start": 734,
"end": 792,
"loc": {
"start": {
"line": 44,
"column": 2
},
"end": {
"line": 46,
"column": 3
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 734,
"end": 745,
"loc": {
"start": {
"line": 44,
"column": 2
},
"end": {
"line": 44,
"column": 13
},
"identifierName": "constructor"
},
"name": "constructor"
},
"static": false,
"kind": "constructor",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 746,
"end": 750,
"loc": {
"start": {
"line": 44,
"column": 14
},
"end": {
"line": 44,
"column": 18
},
"identifierName": "unit"
},
"name": "unit"
}
],
"body": {
"type": "BlockStatement",
"start": 752,
"end": 792,
"loc": {
"start": {
"line": 44,
"column": 20
},
"end": {
"line": 46,
"column": 3
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 758,
"end": 788,
"loc": {
"start": {
"line": 45,
"column": 4
},
"end": {
"line": 45,
"column": 34
}
},
"expression": {
"type": "CallExpression",
"start": 758,
"end": 787,
"loc": {
"start": {
"line": 45,
"column": 4
},
"end": {
"line": 45,
"column": 33
}
},
"callee": {
"type": "Super",
"start": 758,
"end": 763,
"loc": {
"start": {
"line": 45,
"column": 4
},
"end": {
"line": 45,
"column": 9
}
}
},
"arguments": [
{
"type": "TemplateLiteral",
"start": 764,
"end": 786,
"loc": {
"start": {
"line": 45,
"column": 10
},
"end": {
"line": 45,
"column": 32
}
},
"expressions": [
{
"type": "Identifier",
"start": 780,
"end": 784,
"loc": {
"start": {
"line": 45,
"column": 26
},
"end": {
"line": 45,
"column": 30
},
"identifierName": "unit"
},
"name": "unit"
}
],
"quasis": [
{
"type": "TemplateElement",
"start": 765,
"end": 778,
"loc": {
"start": {
"line": 45,
"column": 11
},
"end": {
"line": 45,
"column": 24
}
},
"value": {
"raw": "Invalid unit ",
"cooked": "Invalid unit "
},
"tail": false
},
{
"type": "TemplateElement",
"start": 785,
"end": 785,
"loc": {
"start": {
"line": 45,
"column": 31
},
"end": {
"line": 45,
"column": 31
}
},
"value": {
"raw": "",
"cooked": ""
},
"tail": true
}
]
}
]
}
}
],
"directives": []
}
}
],
"trailingComments": null
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "*\n * @private\n ",
"start": 661,
"end": 680,
"loc": {
"start": {
"line": 40,
"column": 0
},
"end": {
"line": 42,
"column": 3
}
}
}
],
"trailingComments": [
{
"type": "CommentBlock",
"value": "*\n * @private\n ",
"start": 796,
"end": 815,
"loc": {
"start": {
"line": 49,
"column": 0
},
"end": {
"line": 51,
"column": 3
}
}
}
]
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "*\n * @private\n ",
"start": 661,
"end": 680,