@wener/common 1.0.5 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/lib/cn/DivisionCode.js +55 -32
  2. package/lib/cn/DivisionCode.test.js +140 -0
  3. package/lib/cn/Mod11Checksum.js +80 -37
  4. package/lib/cn/Mod31Checksum.js +89 -40
  5. package/lib/cn/ResidentIdentityCardNumber.js +16 -16
  6. package/lib/cn/ResidentIdentityCardNumber.test.js +21 -0
  7. package/lib/cn/UnifiedSocialCreditCode.js +32 -26
  8. package/lib/cn/UnifiedSocialCreditCode.test.js +16 -0
  9. package/lib/cn/formatDate.js +5 -7
  10. package/lib/cn/index.js +0 -1
  11. package/lib/cn/parseSex.js +0 -2
  12. package/lib/cn/types.d.js +0 -2
  13. package/lib/consola/createStandardConsolaReporter.js +6 -6
  14. package/lib/consola/formatLogObject.js +133 -32
  15. package/lib/consola/index.js +0 -1
  16. package/lib/data/formatSort.js +5 -6
  17. package/lib/data/formatSort.test.js +34 -0
  18. package/lib/data/index.js +0 -1
  19. package/lib/data/maybeNumber.js +11 -5
  20. package/lib/data/parseSort.js +28 -22
  21. package/lib/data/parseSort.test.js +188 -0
  22. package/lib/data/resolvePagination.js +27 -16
  23. package/lib/data/resolvePagination.test.js +232 -0
  24. package/lib/data/types.d.js +0 -2
  25. package/lib/index.js +0 -1
  26. package/lib/jsonschema/JsonSchema.js +78 -52
  27. package/lib/jsonschema/JsonSchema.test.js +137 -0
  28. package/lib/jsonschema/index.js +0 -1
  29. package/lib/jsonschema/types.d.js +5 -3
  30. package/lib/meta/defineFileType.js +103 -20
  31. package/lib/meta/defineInit.js +250 -31
  32. package/lib/meta/defineMetadata.js +140 -24
  33. package/lib/meta/defineMetadata.test.js +13 -0
  34. package/lib/meta/index.js +0 -1
  35. package/lib/password/PHC.js +87 -63
  36. package/lib/password/PHC.test.js +539 -0
  37. package/lib/password/Password.js +291 -29
  38. package/lib/password/Password.test.js +362 -0
  39. package/lib/password/createArgon2PasswordAlgorithm.js +191 -35
  40. package/lib/password/createBase64PasswordAlgorithm.js +141 -8
  41. package/lib/password/createBcryptPasswordAlgorithm.js +168 -13
  42. package/lib/password/createPBKDF2PasswordAlgorithm.js +228 -46
  43. package/lib/password/createScryptPasswordAlgorithm.js +211 -55
  44. package/lib/password/index.js +0 -1
  45. package/lib/password/server/index.js +0 -1
  46. package/lib/resource/Identifiable.js +1 -0
  47. package/lib/resource/getTitleOfResource.js +10 -0
  48. package/lib/resource/index.js +1 -0
  49. package/lib/resource/schema/AnyResourceSchema.js +89 -0
  50. package/lib/resource/schema/BaseResourceSchema.js +29 -0
  51. package/lib/resource/schema/ResourceActionType.js +118 -0
  52. package/lib/resource/schema/ResourceStatus.js +93 -0
  53. package/lib/resource/schema/ResourceType.js +24 -0
  54. package/lib/resource/schema/SchemaRegistry.js +38 -0
  55. package/lib/resource/schema/SexType.js +10 -0
  56. package/lib/resource/schema/types.js +89 -0
  57. package/lib/resource/schema/types.test.js +14 -0
  58. package/lib/schema/TypeSchema.d.js +1 -0
  59. package/lib/schema/createSchemaData.js +173 -0
  60. package/lib/schema/findJsonSchemaByPath.js +49 -0
  61. package/lib/schema/getSchemaCache.js +11 -0
  62. package/lib/schema/getSchemaOptions.js +24 -0
  63. package/lib/schema/index.js +5 -0
  64. package/lib/schema/toJsonSchema.js +441 -0
  65. package/lib/schema/toJsonSchema.test.js +27 -0
  66. package/lib/schema/validate.js +124 -0
  67. package/lib/search/AdvanceSearch.js +0 -1
  68. package/lib/search/AdvanceSearch.test.js +435 -0
  69. package/lib/search/formatAdvanceSearch.js +41 -27
  70. package/lib/search/index.js +0 -1
  71. package/lib/search/optimizeAdvanceSearch.js +79 -25
  72. package/lib/search/parseAdvanceSearch.js +5 -5
  73. package/lib/search/parser.d.js +0 -2
  74. package/lib/search/parser.js +97 -74
  75. package/lib/search/types.d.js +0 -2
  76. package/lib/tools/generateSchema.js +197 -39
  77. package/lib/tools/renderJsonSchemaToMarkdownDoc.js +143 -55
  78. package/package.json +23 -11
  79. package/src/data/maybeNumber.ts +5 -1
  80. package/src/data/resolvePagination.test.ts +1 -1
  81. package/src/data/resolvePagination.ts +18 -7
  82. package/src/data/types.d.ts +12 -0
  83. package/src/jsonschema/JsonSchema.test.ts +17 -0
  84. package/src/jsonschema/JsonSchema.ts +2 -2
  85. package/src/jsonschema/types.d.ts +63 -12
  86. package/src/resource/Identifiable.ts +3 -0
  87. package/src/resource/getTitleOfResource.tsx +6 -0
  88. package/src/resource/index.ts +3 -0
  89. package/src/resource/schema/AnyResourceSchema.ts +113 -0
  90. package/src/resource/schema/BaseResourceSchema.ts +32 -0
  91. package/src/resource/schema/ResourceActionType.ts +123 -0
  92. package/src/resource/schema/ResourceStatus.ts +94 -0
  93. package/src/resource/schema/ResourceType.ts +25 -0
  94. package/src/resource/schema/SchemaRegistry.ts +42 -0
  95. package/src/resource/schema/SexType.ts +13 -0
  96. package/src/resource/schema/types.test.ts +18 -0
  97. package/src/resource/schema/types.ts +105 -0
  98. package/src/schema/TypeSchema.d.ts +32 -0
  99. package/src/schema/createSchemaData.ts +81 -0
  100. package/src/schema/findJsonSchemaByPath.ts +37 -0
  101. package/src/schema/getSchemaCache.ts +21 -0
  102. package/src/schema/getSchemaOptions.ts +24 -0
  103. package/src/schema/index.ts +6 -0
  104. package/src/schema/toJsonSchema.test.ts +37 -0
  105. package/src/schema/toJsonSchema.ts +200 -0
  106. package/src/schema/validate.ts +135 -0
  107. package/src/tools/generateSchema.ts +28 -28
  108. package/lib/cn/DivisionCode.js.map +0 -1
  109. package/lib/cn/Mod11Checksum.js.map +0 -1
  110. package/lib/cn/Mod31Checksum.js.map +0 -1
  111. package/lib/cn/ResidentIdentityCardNumber.js.map +0 -1
  112. package/lib/cn/UnifiedSocialCreditCode.js.map +0 -1
  113. package/lib/cn/formatDate.js.map +0 -1
  114. package/lib/cn/index.js.map +0 -1
  115. package/lib/cn/parseSex.js.map +0 -1
  116. package/lib/cn/types.d.js.map +0 -1
  117. package/lib/consola/createStandardConsolaReporter.js.map +0 -1
  118. package/lib/consola/formatLogObject.js.map +0 -1
  119. package/lib/consola/index.js.map +0 -1
  120. package/lib/data/formatSort.js.map +0 -1
  121. package/lib/data/index.js.map +0 -1
  122. package/lib/data/maybeNumber.js.map +0 -1
  123. package/lib/data/parseSort.js.map +0 -1
  124. package/lib/data/resolvePagination.js.map +0 -1
  125. package/lib/data/types.d.js.map +0 -1
  126. package/lib/index.js.map +0 -1
  127. package/lib/jsonschema/JsonSchema.js.map +0 -1
  128. package/lib/jsonschema/index.js.map +0 -1
  129. package/lib/jsonschema/types.d.js.map +0 -1
  130. package/lib/meta/defineFileType.js.map +0 -1
  131. package/lib/meta/defineInit.js.map +0 -1
  132. package/lib/meta/defineMetadata.js.map +0 -1
  133. package/lib/meta/index.js.map +0 -1
  134. package/lib/password/PHC.js.map +0 -1
  135. package/lib/password/Password.js.map +0 -1
  136. package/lib/password/createArgon2PasswordAlgorithm.js.map +0 -1
  137. package/lib/password/createBase64PasswordAlgorithm.js.map +0 -1
  138. package/lib/password/createBcryptPasswordAlgorithm.js.map +0 -1
  139. package/lib/password/createPBKDF2PasswordAlgorithm.js.map +0 -1
  140. package/lib/password/createScryptPasswordAlgorithm.js.map +0 -1
  141. package/lib/password/index.js.map +0 -1
  142. package/lib/password/server/index.js.map +0 -1
  143. package/lib/search/AdvanceSearch.js.map +0 -1
  144. package/lib/search/formatAdvanceSearch.js.map +0 -1
  145. package/lib/search/index.js.map +0 -1
  146. package/lib/search/optimizeAdvanceSearch.js.map +0 -1
  147. package/lib/search/parseAdvanceSearch.js.map +0 -1
  148. package/lib/search/parser.d.js.map +0 -1
  149. package/lib/search/parser.js.map +0 -1
  150. package/lib/search/types.d.js.map +0 -1
  151. package/lib/tools/generateSchema.js.map +0 -1
  152. package/lib/tools/renderJsonSchemaToMarkdownDoc.js.map +0 -1
@@ -1,7 +1,59 @@
1
- import { arrayOfMaybeArray, deepEqual } from "@wener/utils";
2
- import { match } from "ts-pattern";
1
+ function _define_property(obj, key, value) {
2
+ if (key in obj) {
3
+ Object.defineProperty(obj, key, {
4
+ value: value,
5
+ enumerable: true,
6
+ configurable: true,
7
+ writable: true
8
+ });
9
+ } else {
10
+ obj[key] = value;
11
+ }
12
+ return obj;
13
+ }
14
+ function _object_spread(target) {
15
+ for(var i = 1; i < arguments.length; i++){
16
+ var source = arguments[i] != null ? arguments[i] : {};
17
+ var ownKeys = Object.keys(source);
18
+ if (typeof Object.getOwnPropertySymbols === "function") {
19
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
20
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
21
+ }));
22
+ }
23
+ ownKeys.forEach(function(key) {
24
+ _define_property(target, key, source[key]);
25
+ });
26
+ }
27
+ return target;
28
+ }
29
+ function ownKeys(object, enumerableOnly) {
30
+ var keys = Object.keys(object);
31
+ if (Object.getOwnPropertySymbols) {
32
+ var symbols = Object.getOwnPropertySymbols(object);
33
+ if (enumerableOnly) {
34
+ symbols = symbols.filter(function(sym) {
35
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
36
+ });
37
+ }
38
+ keys.push.apply(keys, symbols);
39
+ }
40
+ return keys;
41
+ }
42
+ function _object_spread_props(target, source) {
43
+ source = source != null ? source : {};
44
+ if (Object.getOwnPropertyDescriptors) {
45
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
46
+ } else {
47
+ ownKeys(Object(source)).forEach(function(key) {
48
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
49
+ });
50
+ }
51
+ return target;
52
+ }
53
+ import { arrayOfMaybeArray, deepEqual } from '@wener/utils';
54
+ import { match } from 'ts-pattern';
3
55
  export function optimizeAdvanceSearch(expr) {
4
- const NEG = {
56
+ var NEG = {
5
57
  eq: 'ne',
6
58
  ne: 'eq',
7
59
  gt: 'lte',
@@ -9,13 +61,13 @@ export function optimizeAdvanceSearch(expr) {
9
61
  gte: 'lt',
10
62
  lte: 'gt'
11
63
  };
12
- const _expr = (e)=>{
64
+ var _expr = function(e) {
13
65
  // merge Exprs to AND ?
14
66
  return match(e)// (EXPR) -> EXPR
15
67
  // TODO (EXPR EXPR) -> EXPR AND EXPR
16
68
  .with({
17
69
  type: 'parentheses'
18
- }, (expr)=>{
70
+ }, function(expr) {
19
71
  // unwrap
20
72
  if (expr.value.length < 2) {
21
73
  return expr.value[0];
@@ -24,7 +76,7 @@ export function optimizeAdvanceSearch(expr) {
24
76
  return expr;
25
77
  }).with({
26
78
  type: 'comment'
27
- }, (expr)=>{
79
+ }, function(expr) {
28
80
  // remove empty comment
29
81
  if (!expr.value.length) {
30
82
  return [];
@@ -33,8 +85,8 @@ export function optimizeAdvanceSearch(expr) {
33
85
  })// NOT
34
86
  .with({
35
87
  type: 'not'
36
- }, (expr)=>{
37
- let out = arrayOfMaybeArray(_expr(expr.value));
88
+ }, function(expr) {
89
+ var out = arrayOfMaybeArray(_expr(expr.value));
38
90
  if (!out.length) {
39
91
  return [];
40
92
  } else if (out.length === 1) {
@@ -45,28 +97,30 @@ export function optimizeAdvanceSearch(expr) {
45
97
  return match(expr.value)// NOT NOT EXPR -> EXPR
46
98
  .with({
47
99
  type: 'not'
48
- }, (expr)=>expr.value)// NOT EXPR -> -EXPR
100
+ }, function(expr) {
101
+ return expr.value;
102
+ })// NOT EXPR -> -EXPR
49
103
  .with({
50
104
  type: 'compare'
51
- }, (expr)=>{
52
- return {
53
- ...expr,
105
+ }, function(expr) {
106
+ return _object_spread_props(_object_spread({}, expr), {
54
107
  negative: !expr.negative
55
- };
108
+ });
56
109
  }).with({
57
110
  type: 'keyword'
58
- }, (expr)=>{
59
- return {
60
- ...expr,
111
+ }, function(expr) {
112
+ return _object_spread_props(_object_spread({}, expr), {
61
113
  negative: !expr.negative
62
- };
63
- }).otherwise(()=>expr);
114
+ });
115
+ }).otherwise(function() {
116
+ return expr;
117
+ });
64
118
  }).with({
65
119
  type: 'compare'
66
- }, (expr)=>{
120
+ }, function(expr) {
67
121
  // negative by swap operator
68
122
  if (expr.negative) {
69
- const ne = NEG[expr.operator];
123
+ var ne = NEG[expr.operator];
70
124
  if (ne) {
71
125
  expr.operator = ne;
72
126
  expr.negative = false;
@@ -74,16 +128,16 @@ export function optimizeAdvanceSearch(expr) {
74
128
  }
75
129
  if (expr.operator === 'range') {}
76
130
  return expr;
77
- }).otherwise((e)=>e);
131
+ }).otherwise(function(e) {
132
+ return e;
133
+ });
78
134
  };
79
- let last = expr;
135
+ var last = expr;
80
136
  while(true){
81
- let next = structuredClone(last).flatMap(_expr);
137
+ var next = structuredClone(last).flatMap(_expr);
82
138
  if (deepEqual(last, next)) {
83
139
  return last;
84
140
  }
85
141
  last = next;
86
142
  }
87
143
  }
88
-
89
- //# sourceMappingURL=optimizeAdvanceSearch.js.map
@@ -1,20 +1,20 @@
1
1
  import { parse } from "./parser.js";
2
2
  export function parseAdvanceSearch(s) {
3
- s = s?.trim();
3
+ s = s === null || s === void 0 ? void 0 : s.trim();
4
4
  if (!s) {
5
5
  return [];
6
6
  }
7
7
  // no Logical, no Compare, no Quote, no Comment
8
8
  if (!/AND|OR|NOT|[-"():]|\/\*/.test(s)) {
9
9
  // fast path
10
- return s.split(/\s+/).map((v)=>v.trim()).filter(Boolean).map((v)=>{
10
+ return s.split(/\s+/).map(function (v) {
11
+ return v.trim();
12
+ }).filter(Boolean).map(function (v) {
11
13
  return {
12
- type: 'keyword',
14
+ type: "keyword",
13
15
  value: v
14
16
  };
15
17
  });
16
18
  }
17
19
  return parse(s);
18
20
  }
19
-
20
- //# sourceMappingURL=parseAdvanceSearch.js.map
@@ -1,3 +1 @@
1
1
  export { };
2
-
3
- //# sourceMappingURL=parser.d.js.map
@@ -1,6 +1,34 @@
1
1
  // @generated by Peggy 4.2.0.
2
2
  //
3
3
  // https://peggyjs.org/
4
+ function _define_property(obj, key, value) {
5
+ if (key in obj) {
6
+ Object.defineProperty(obj, key, {
7
+ value: value,
8
+ enumerable: true,
9
+ configurable: true,
10
+ writable: true
11
+ });
12
+ } else {
13
+ obj[key] = value;
14
+ }
15
+ return obj;
16
+ }
17
+ function _object_spread(target) {
18
+ for(var i = 1; i < arguments.length; i++){
19
+ var source = arguments[i] != null ? arguments[i] : {};
20
+ var ownKeys = Object.keys(source);
21
+ if (typeof Object.getOwnPropertySymbols === "function") {
22
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
23
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
24
+ }));
25
+ }
26
+ ownKeys.forEach(function(key) {
27
+ _define_property(target, key, source[key]);
28
+ });
29
+ }
30
+ return target;
31
+ }
4
32
  function peg$subclass(child, parent) {
5
33
  function C() {
6
34
  this.constructor = child;
@@ -59,22 +87,22 @@ peg$SyntaxError.prototype.format = function(sources) {
59
87
  };
60
88
  peg$SyntaxError.buildMessage = function(expected, found) {
61
89
  var DESCRIBE_EXPECTATION_FNS = {
62
- literal: function(expectation) {
90
+ literal: function literal(expectation) {
63
91
  return "\"" + literalEscape(expectation.text) + "\"";
64
92
  },
65
- class: function(expectation) {
93
+ class: function _class(expectation) {
66
94
  var escapedParts = expectation.parts.map(function(part) {
67
95
  return Array.isArray(part) ? classEscape(part[0]) + "-" + classEscape(part[1]) : classEscape(part);
68
96
  });
69
97
  return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]";
70
98
  },
71
- any: function() {
99
+ any: function any() {
72
100
  return "any character";
73
101
  },
74
- end: function() {
102
+ end: function end() {
75
103
  return "end of input";
76
104
  },
77
- other: function(expectation) {
105
+ other: function other(expectation) {
78
106
  return expectation.description;
79
107
  }
80
108
  };
@@ -332,13 +360,13 @@ function peg$parse(input, options) {
332
360
  "\r"
333
361
  ], false, false);
334
362
  var peg$e52 = peg$anyExpectation();
335
- var peg$f0 = function(value) {
363
+ var peg$f0 = function peg$f0(value) {
336
364
  return {
337
365
  type: "comment",
338
366
  value: value.trim()
339
367
  };
340
368
  };
341
- var peg$f1 = function(head, tail) {
369
+ var peg$f1 = function peg$f1(head, tail) {
342
370
  return !tail.length ? head : {
343
371
  type: "logical",
344
372
  operator: "or",
@@ -347,7 +375,7 @@ function peg$parse(input, options) {
347
375
  ].concat(tail)
348
376
  };
349
377
  };
350
- var peg$f2 = function(head, tail) {
378
+ var peg$f2 = function peg$f2(head, tail) {
351
379
  return !tail.length ? head : {
352
380
  type: "logical",
353
381
  operator: "and",
@@ -356,177 +384,174 @@ function peg$parse(input, options) {
356
384
  ].concat(tail)
357
385
  };
358
386
  };
359
- var peg$f3 = function(value) {
387
+ var peg$f3 = function peg$f3(value) {
360
388
  return {
361
389
  type: "not",
362
- value
390
+ value: value
363
391
  };
364
392
  };
365
- var peg$f4 = function(value) {
393
+ var peg$f4 = function peg$f4(value) {
366
394
  return {
367
395
  type: "parentheses",
368
- value
396
+ value: value
369
397
  };
370
398
  };
371
- var peg$f5 = function(negative) {
399
+ var peg$f5 = function peg$f5(negative) {
372
400
  return {
373
401
  negative: true
374
402
  };
375
403
  };
376
- var peg$f6 = function() {
404
+ var peg$f6 = function peg$f6() {
377
405
  return {};
378
406
  };
379
- var peg$f7 = function(modifier, field, operator, value) {
407
+ var peg$f7 = function peg$f7(modifier, field, operator, value) {
380
408
  return {
381
409
  type: "compare",
382
- field,
410
+ field: field,
383
411
  operator: "range",
384
- value
412
+ value: value
385
413
  };
386
414
  };
387
- var peg$f8 = function(modifier, field, operator, value) {
415
+ var peg$f8 = function peg$f8(modifier, field, operator, value) {
388
416
  return {
389
417
  type: "compare",
390
- field,
418
+ field: field,
391
419
  operator: operator === ":!=" ? "ne" : "eq",
392
- value
420
+ value: value
393
421
  };
394
422
  };
395
- var peg$f9 = function(modifier, field, operator, value) {
423
+ var peg$f9 = function peg$f9(modifier, field, operator, value) {
396
424
  return {
397
425
  type: "compare",
398
- field,
426
+ field: field,
399
427
  operator: OPERATORS[operator],
400
- value
428
+ value: value
401
429
  };
402
430
  };
403
- var peg$f10 = function(modifier, expr) {
404
- return {
405
- ...expr,
406
- ...modifier
407
- };
431
+ var peg$f10 = function peg$f10(modifier, expr) {
432
+ return _object_spread({}, expr, modifier);
408
433
  };
409
- var peg$f11 = function(field, value) {
434
+ var peg$f11 = function peg$f11(field, value) {
410
435
  return {
411
436
  type: "compare",
412
- field,
437
+ field: field,
413
438
  operator: "match",
414
439
  value: {
415
- value
440
+ value: value
416
441
  },
417
442
  mention: true
418
443
  };
419
444
  };
420
- var peg$f12 = function(negative, value) {
445
+ var peg$f12 = function peg$f12(negative, value) {
421
446
  return {
422
447
  type: "keyword",
423
448
  negative: Boolean(negative),
424
- value,
449
+ value: value,
425
450
  exact: true
426
451
  };
427
452
  };
428
- var peg$f13 = function(negative, value) {
453
+ var peg$f13 = function peg$f13(negative, value) {
429
454
  return {
430
455
  type: "keyword",
431
456
  negative: Boolean(negative),
432
- value
457
+ value: value
433
458
  };
434
459
  };
435
- var peg$f14 = function() {
460
+ var peg$f14 = function peg$f14() {
436
461
  return text();
437
462
  };
438
- var peg$f15 = function(minimum, maximum) {
463
+ var peg$f15 = function peg$f15(minimum, maximum) {
439
464
  return {
440
465
  type: "range",
441
466
  minimum: minimum === "*" ? undefined : minimum,
442
467
  maximum: maximum === "*" ? undefined : maximum
443
468
  };
444
469
  };
445
- var peg$f16 = function(minimumBoundary, minimum, maximum, maximumBoundary) {
470
+ var peg$f16 = function peg$f16(minimumBoundary, minimum, maximum, maximumBoundary) {
446
471
  return {
447
472
  type: "range",
448
- minimum,
449
- maximum,
473
+ minimum: minimum,
474
+ maximum: maximum,
450
475
  minimumExclusive: minimumBoundary === "(",
451
476
  maximumExclusive: maximumBoundary === ")"
452
477
  };
453
478
  };
454
- var peg$f17 = function(value) {
479
+ var peg$f17 = function peg$f17(value) {
455
480
  return {
456
481
  format: "mention",
457
- value
482
+ value: value
458
483
  };
459
484
  };
460
- var peg$f18 = function(value) {
485
+ var peg$f18 = function peg$f18(value) {
461
486
  return {
462
487
  type: "literal",
463
- value
488
+ value: value
464
489
  };
465
490
  };
466
- var peg$f19 = function(time) {
491
+ var peg$f19 = function peg$f19(time) {
467
492
  return {
468
493
  format: time ? "date-time" : "date",
469
494
  value: text()
470
495
  };
471
496
  };
472
- var peg$f20 = function() {
497
+ var peg$f20 = function peg$f20() {
473
498
  return text();
474
499
  };
475
- var peg$f21 = function() {
500
+ var peg$f21 = function peg$f21() {
476
501
  return parseFloat(text());
477
502
  };
478
- var peg$f22 = function(v) {
503
+ var peg$f22 = function peg$f22(v) {
479
504
  return v.join("");
480
505
  };
481
- var peg$f23 = function() {
506
+ var peg$f23 = function peg$f23() {
482
507
  return "'";
483
508
  };
484
- var peg$f24 = function() {
509
+ var peg$f24 = function peg$f24() {
485
510
  return '"';
486
511
  };
487
- var peg$f25 = function() {
512
+ var peg$f25 = function peg$f25() {
488
513
  return "\\";
489
514
  };
490
- var peg$f26 = function() {
515
+ var peg$f26 = function peg$f26() {
491
516
  return "/";
492
517
  };
493
- var peg$f27 = function() {
518
+ var peg$f27 = function peg$f27() {
494
519
  return "\b";
495
520
  };
496
- var peg$f28 = function() {
521
+ var peg$f28 = function peg$f28() {
497
522
  return "\f";
498
523
  };
499
- var peg$f29 = function() {
524
+ var peg$f29 = function peg$f29() {
500
525
  return "\n";
501
526
  };
502
- var peg$f30 = function() {
527
+ var peg$f30 = function peg$f30() {
503
528
  return "\r";
504
529
  };
505
- var peg$f31 = function() {
530
+ var peg$f31 = function peg$f31() {
506
531
  return "\t";
507
532
  };
508
- var peg$f32 = function() {
533
+ var peg$f32 = function peg$f32() {
509
534
  return "'";
510
535
  };
511
- var peg$f33 = function(h1, h2, h3, h4) {
536
+ var peg$f33 = function peg$f33(h1, h2, h3, h4) {
512
537
  return String.fromCharCode(parseInt("0x" + h1 + h2 + h3 + h4));
513
538
  };
514
- var peg$f34 = function() {
539
+ var peg$f34 = function peg$f34() {
515
540
  return text().toLowerCase() === "true";
516
541
  };
517
- var peg$f35 = function() {
542
+ var peg$f35 = function peg$f35() {
518
543
  return parseInt(text());
519
544
  };
520
- var peg$f36 = function() {
545
+ var peg$f36 = function peg$f36() {
521
546
  return parseFloat(text());
522
547
  };
523
- var peg$f37 = function() {
548
+ var peg$f37 = function peg$f37() {
524
549
  return null;
525
550
  };
526
- var peg$f38 = function() {
551
+ var peg$f38 = function peg$f38() {
527
552
  return "";
528
553
  };
529
- var peg$f39 = function() {
554
+ var peg$f39 = function peg$f39() {
530
555
  return " ";
531
556
  };
532
557
  var peg$currPos = options.peg$currPos | 0;
@@ -3029,7 +3054,7 @@ function peg$parse(input, options) {
3029
3054
  }
3030
3055
  return s0;
3031
3056
  }
3032
- const OPERATORS = {
3057
+ var OPERATORS = {
3033
3058
  ":": "match",
3034
3059
  ":=": "eq",
3035
3060
  ":!=": "ne",
@@ -3041,11 +3066,11 @@ function peg$parse(input, options) {
3041
3066
  peg$result = peg$startRuleFunction();
3042
3067
  if (options.peg$library) {
3043
3068
  return /** @type {any} */ {
3044
- peg$result,
3045
- peg$currPos,
3046
- peg$FAILED,
3047
- peg$maxFailExpected,
3048
- peg$maxFailPos
3069
+ peg$result: peg$result,
3070
+ peg$currPos: peg$currPos,
3071
+ peg$FAILED: peg$FAILED,
3072
+ peg$maxFailExpected: peg$maxFailExpected,
3073
+ peg$maxFailPos: peg$maxFailPos
3049
3074
  };
3050
3075
  }
3051
3076
  if (peg$result !== peg$FAILED && peg$currPos === input.length) {
@@ -3057,9 +3082,7 @@ function peg$parse(input, options) {
3057
3082
  throw peg$buildStructuredError(peg$maxFailExpected, peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, peg$maxFailPos < input.length ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) : peg$computeLocation(peg$maxFailPos, peg$maxFailPos));
3058
3083
  }
3059
3084
  }
3060
- const peg$allowedStartRules = [
3085
+ var peg$allowedStartRules = [
3061
3086
  "Main"
3062
3087
  ];
3063
3088
  export { peg$allowedStartRules as StartRules, peg$SyntaxError as SyntaxError, peg$parse as parse };
3064
-
3065
- //# sourceMappingURL=parser.js.map
@@ -1,3 +1 @@
1
1
  export { };
2
-
3
- //# sourceMappingURL=types.d.js.map