arktype 0.1.3 → 0.2.0

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 (74) hide show
  1. package/README.md +1 -1
  2. package/dist/api.cjs +4 -3
  3. package/dist/api.d.ts +3 -2
  4. package/dist/api.mjs +2 -1
  5. package/dist/cjs/nodes/node.js +20 -2
  6. package/dist/cjs/nodes/predicate.js +2 -0
  7. package/dist/cjs/nodes/rules/regex.js +4 -42
  8. package/dist/cjs/nodes/rules/rules.js +16 -12
  9. package/dist/cjs/parse/definition.js +2 -2
  10. package/dist/cjs/parse/string/ast.js +1 -1
  11. package/dist/cjs/parse/tuple/keyof.js +6 -7
  12. package/dist/cjs/parse/tuple/morph.js +7 -6
  13. package/dist/cjs/scopes/cache.js +39 -0
  14. package/dist/cjs/scopes/jsObjects.js +133 -0
  15. package/dist/cjs/scopes/scope.js +244 -0
  16. package/dist/cjs/scopes/standard.js +44 -0
  17. package/dist/cjs/scopes/tsKeywords.js +113 -0
  18. package/dist/cjs/scopes/type.js +70 -0
  19. package/dist/cjs/scopes/validation.js +64 -0
  20. package/dist/cjs/traverse/problems.js +50 -74
  21. package/dist/cjs/traverse/traverse.js +25 -3
  22. package/dist/cjs/utils/numericLiterals.js +1 -0
  23. package/dist/mjs/nodes/node.js +20 -2
  24. package/dist/mjs/nodes/predicate.js +1 -0
  25. package/dist/mjs/nodes/rules/regex.js +3 -41
  26. package/dist/mjs/nodes/rules/rules.js +17 -13
  27. package/dist/mjs/parse/definition.js +1 -1
  28. package/dist/mjs/parse/string/ast.js +1 -1
  29. package/dist/mjs/parse/tuple/keyof.js +6 -7
  30. package/dist/mjs/parse/tuple/morph.js +7 -6
  31. package/dist/mjs/scopes/cache.js +25 -0
  32. package/dist/mjs/scopes/jsObjects.js +119 -0
  33. package/dist/mjs/{main.js → scopes/scope.js} +23 -349
  34. package/dist/mjs/scopes/standard.js +27 -0
  35. package/dist/mjs/scopes/tsKeywords.js +99 -0
  36. package/dist/mjs/scopes/type.js +56 -0
  37. package/dist/mjs/scopes/validation.js +51 -0
  38. package/dist/mjs/traverse/problems.js +49 -73
  39. package/dist/mjs/traverse/traverse.js +26 -4
  40. package/dist/mjs/utils/numericLiterals.js +1 -1
  41. package/dist/tsconfig.temp.tsbuildinfo +1 -1
  42. package/dist/types/nodes/compose.d.ts +1 -1
  43. package/dist/types/nodes/infer.d.ts +4 -4
  44. package/dist/types/nodes/node.d.ts +11 -7
  45. package/dist/types/nodes/predicate.d.ts +43 -54
  46. package/dist/types/nodes/rules/range.d.ts +1 -1
  47. package/dist/types/nodes/rules/regex.d.ts +1 -11
  48. package/dist/types/nodes/rules/rules.d.ts +2 -10
  49. package/dist/types/parse/definition.d.ts +1 -1
  50. package/dist/types/parse/record.d.ts +2 -2
  51. package/dist/types/parse/string/ast.d.ts +5 -4
  52. package/dist/types/parse/string/reduce/dynamic.d.ts +1 -1
  53. package/dist/types/parse/string/reduce/shared.d.ts +1 -1
  54. package/dist/types/parse/string/reduce/static.d.ts +1 -1
  55. package/dist/types/parse/string/shift/operand/unenclosed.d.ts +1 -1
  56. package/dist/types/parse/string/shift/operator/bounds.d.ts +1 -1
  57. package/dist/types/parse/tuple/keyof.d.ts +8 -0
  58. package/dist/types/parse/tuple/morph.d.ts +1 -1
  59. package/dist/types/parse/tuple/narrow.d.ts +1 -1
  60. package/dist/types/parse/tuple/tuple.d.ts +7 -13
  61. package/dist/types/scopes/cache.d.ts +14 -0
  62. package/dist/types/scopes/jsObjects.d.ts +36 -0
  63. package/dist/types/scopes/scope.d.ts +76 -0
  64. package/dist/types/scopes/standard.d.ts +280 -0
  65. package/dist/types/scopes/tsKeywords.d.ts +32 -0
  66. package/dist/types/scopes/type.d.ts +53 -0
  67. package/dist/types/scopes/validation.d.ts +21 -0
  68. package/dist/types/traverse/problems.d.ts +29 -32
  69. package/dist/types/traverse/traverse.d.ts +10 -8
  70. package/dist/types/utils/generics.d.ts +2 -1
  71. package/dist/types/utils/numericLiterals.d.ts +1 -0
  72. package/package.json +2 -2
  73. package/dist/cjs/main.js +0 -574
  74. package/dist/types/main.d.ts +0 -321
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  </div>
5
5
  <div align="center">
6
6
 
7
- Isomorphic type syntax for TS/JS
7
+ Isomorphic types for TS/JS
8
8
 
9
9
  </div>
10
10
 
package/dist/api.cjs CHANGED
@@ -9,10 +9,11 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- scope: ()=>_mainTs.scope,
13
- type: ()=>_mainTs.type,
12
+ scope: ()=>_scopeTs.scope,
13
+ type: ()=>_standardTs.type,
14
14
  Problems: ()=>_problemsTs.Problems,
15
15
  Problem: ()=>_problemsTs.Problem
16
16
  });
17
- const _mainTs = require("./cjs/main.js");
17
+ const _scopeTs = require("./cjs/scopes/scope.js");
18
+ const _standardTs = require("./cjs/scopes/standard.js");
18
19
  const _problemsTs = require("./cjs/traverse/problems.js");
package/dist/api.d.ts CHANGED
@@ -1,3 +1,4 @@
1
- export { scope, type } from "./types/main.js"
2
- export type { Type } from "./types/main.js"
1
+ export { scope } from "./types/scopes/scope.js"
2
+ export { type } from "./types/scopes/standard.js"
3
+ export type { Type } from "./types/scopes/type.js"
3
4
  export { Problems, Problem } from "./types/traverse/problems.js"
package/dist/api.mjs CHANGED
@@ -1,2 +1,3 @@
1
- export { scope, type } from "./mjs/main.js";
1
+ export { scope } from "./mjs/scopes/scope.js";
2
+ export { type } from "./mjs/scopes/standard.js";
2
3
  export { Problems, Problem } from "./mjs/traverse/problems.js";
@@ -68,11 +68,29 @@ const flattenType = (type)=>{
68
68
  path: new _pathsTs.Path(),
69
69
  lastDomain: "undefined"
70
70
  };
71
- return flattenNode(type.node, ctx);
71
+ return type.meta.config ? [
72
+ [
73
+ "config",
74
+ {
75
+ config: type.meta.config,
76
+ node: flattenNode(type.node, ctx)
77
+ }
78
+ ]
79
+ ] : flattenNode(type.node, ctx);
72
80
  };
73
81
  const flattenNode = (node, ctx)=>{
74
82
  if (typeof node === "string") {
75
- return ctx.type.meta.scope.resolve(node).flat;
83
+ const resolution = ctx.type.meta.scope.resolve(node);
84
+ const updatedScopeConfig = resolution.meta.scope !== ctx.type.meta.scope && resolution.meta.scope.config;
85
+ return updatedScopeConfig ? [
86
+ [
87
+ "config",
88
+ {
89
+ config: updatedScopeConfig,
90
+ node: resolution.flat
91
+ }
92
+ ]
93
+ ] : resolution.flat;
76
94
  }
77
95
  const domains = (0, _genericsTs.keysOf)(node);
78
96
  if (domains.length === 1) {
@@ -9,6 +9,7 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
+ branchIsTransformation: ()=>branchIsTransformation,
12
13
  comparePredicates: ()=>comparePredicates,
13
14
  predicateIntersection: ()=>predicateIntersection,
14
15
  predicateUnion: ()=>predicateUnion,
@@ -22,6 +23,7 @@ const _branchesTs = require("./branches.js");
22
23
  const _composeTs = require("./compose.js");
23
24
  const _discriminateTs = require("./discriminate.js");
24
25
  const _rulesTs = require("./rules/rules.js");
26
+ const branchIsTransformation = (branch)=>"rules" in branch;
25
27
  const emptyRulesIfTrue = (predicate)=>predicate === true ? {} : predicate;
26
28
  const comparePredicates = (l, r, context)=>{
27
29
  if (l === true && r === true) {
@@ -9,60 +9,22 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- sources: ()=>sources,
13
12
  getRegex: ()=>getRegex,
14
13
  checkRegex: ()=>checkRegex,
15
- regexIntersection: ()=>regexIntersection,
16
- isLuhnValid: ()=>isLuhnValid
14
+ regexIntersection: ()=>regexIntersection
17
15
  });
18
16
  const _composeTs = require("../compose.js");
19
17
  const _collapsibleSetTs = require("./collapsibleSet.js");
20
18
  const regexCache = {};
21
- const sources = {
22
- // Character sets
23
- alpha: /^[A-Z]*$/i,
24
- alphanumeric: /^[A-Z\d]*$/i,
25
- lowercase: /^[a-z]*$/,
26
- uppercase: /^[A-Z]*$/,
27
- // https://github.com/validatorjs/validator.js
28
- creditCard: /^(?:4[0-9]{12}(?:[0-9]{3,6})?|5[1-5][0-9]{14}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12,15}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11}|6[27][0-9]{14}|^(81[0-9]{14,17}))$/,
29
- // https://www.regular-expressions.info
30
- email: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,
31
- // https://github.com/validatorjs/validator.js
32
- uuid: /^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i
33
- };
34
19
  const getRegex = (source)=>{
35
20
  if (!regexCache[source]) {
36
21
  regexCache[source] = new RegExp(source);
37
22
  }
38
23
  return regexCache[source];
39
24
  };
40
- const checkRegex = (data, regex, state)=>{
41
- if (!regex.test(data)) {
42
- state.problems.add("regex", data, regex);
25
+ const checkRegex = (data, source, state)=>{
26
+ if (!getRegex(source).test(data)) {
27
+ state.problems.add("regex", data, state.path.length === 0 && state.type.name !== "type" ? state.type.name : `/${source}/`);
43
28
  }
44
29
  };
45
30
  const regexIntersection = (0, _composeTs.composeIntersection)(_collapsibleSetTs.collapsibleListUnion);
46
- const isLuhnValid = (creditCardInput)=>{
47
- const sanitized = creditCardInput.replace(/[- ]+/g, "");
48
- let sum = 0;
49
- let digit;
50
- let tmpNum;
51
- let shouldDouble;
52
- for(let i = sanitized.length - 1; i >= 0; i--){
53
- digit = sanitized.substring(i, i + 1);
54
- tmpNum = parseInt(digit, 10);
55
- if (shouldDouble) {
56
- tmpNum *= 2;
57
- if (tmpNum >= 10) {
58
- sum += tmpNum % 10 + 1;
59
- } else {
60
- sum += tmpNum;
61
- }
62
- } else {
63
- sum += tmpNum;
64
- }
65
- shouldDouble = !shouldDouble;
66
- }
67
- return !!(sum % 10 === 0 ? sanitized : false);
68
- };
@@ -20,6 +20,7 @@ const _astTs = require("../../parse/string/ast.js");
20
20
  const _errorsTs = require("../../utils/errors.js");
21
21
  const _genericsTs = require("../../utils/generics.js");
22
22
  const _composeTs = require("../compose.js");
23
+ const _predicateTs = require("../predicate.js");
23
24
  const _classTs = require("./class.js");
24
25
  const _collapsibleSetTs = require("./collapsibleSet.js");
25
26
  const _divisorTs = require("./divisor.js");
@@ -27,7 +28,7 @@ const _objectKindTs = require("./objectKind.js");
27
28
  const _propsTs = require("./props.js");
28
29
  const _rangeTs = require("./range.js");
29
30
  const _regexTs = require("./regex.js");
30
- const rulesOf = (branch)=>branch.input ?? branch;
31
+ const rulesOf = (branch)=>branch.rules ?? branch;
31
32
  const branchIntersection = (l, r, state)=>{
32
33
  const lRules = rulesOf(l);
33
34
  const rRules = rulesOf(r);
@@ -36,20 +37,20 @@ const branchIntersection = (l, r, state)=>{
36
37
  if ("morph" in r) {
37
38
  if (l.morph === r.morph) {
38
39
  return (0, _composeTs.isEquality)(rulesResult) || (0, _composeTs.isDisjoint)(rulesResult) ? rulesResult : {
39
- input: rulesResult,
40
+ rules: rulesResult,
40
41
  morph: l.morph
41
42
  };
42
43
  }
43
- return state.lastOperator === "&" ? (0, _errorsTs.throwParseError)((0, _astTs.writeImplicitNeverMessage)(state.path, "of morphs")) : {};
44
+ return state.lastOperator === "&" ? (0, _errorsTs.throwParseError)((0, _astTs.writeImplicitNeverMessage)(state.path, "Intersection", "of morphs")) : {};
44
45
  }
45
46
  return (0, _composeTs.isDisjoint)(rulesResult) ? rulesResult : {
46
- input: (0, _composeTs.isEquality)(rulesResult) ? l.input : rulesResult,
47
+ rules: (0, _composeTs.isEquality)(rulesResult) ? l.rules : rulesResult,
47
48
  morph: l.morph
48
49
  };
49
50
  }
50
51
  if ("morph" in r) {
51
52
  return (0, _composeTs.isDisjoint)(rulesResult) ? rulesResult : {
52
- input: (0, _composeTs.isEquality)(rulesResult) ? r.input : rulesResult,
53
+ rules: (0, _composeTs.isEquality)(rulesResult) ? r.rules : rulesResult,
53
54
  morph: r.morph
54
55
  };
55
56
  }
@@ -74,7 +75,7 @@ const ruleFlatteners = {
74
75
  for (const source of (0, _genericsTs.listFrom)(rule)){
75
76
  entries.push([
76
77
  "regex",
77
- (0, _regexTs.getRegex)(source)
78
+ source
78
79
  ]);
79
80
  }
80
81
  },
@@ -109,6 +110,7 @@ const ruleFlatteners = {
109
110
  };
110
111
  const precedenceMap = {
111
112
  // Critical: No other checks are performed if these fail
113
+ config: 0,
112
114
  domain: 0,
113
115
  value: 0,
114
116
  domains: 0,
@@ -130,12 +132,14 @@ const precedenceMap = {
130
132
  morph: 4
131
133
  };
132
134
  const flattenBranch = (branch, ctx)=>{
133
- if ("morph" in branch) {
134
- const result = flattenRules(branch.input, ctx);
135
- result.push([
136
- "morph",
137
- branch.morph
138
- ]);
135
+ if ((0, _predicateTs.branchIsTransformation)(branch)) {
136
+ const result = flattenRules(branch.rules, ctx);
137
+ if (branch.morph) {
138
+ result.push([
139
+ "morph",
140
+ branch.morph
141
+ ]);
142
+ }
139
143
  return result;
140
144
  }
141
145
  return flattenRules(branch, ctx);
@@ -14,7 +14,7 @@ _export(exports, {
14
14
  unknownDefinitionMessage: ()=>unknownDefinitionMessage,
15
15
  writeBadDefinitionTypeMessage: ()=>writeBadDefinitionTypeMessage
16
16
  });
17
- const _mainTs = require("../main.js");
17
+ const _typeTs = require("../scopes/type.js");
18
18
  const _domainsTs = require("../utils/domains.js");
19
19
  const _errorsTs = require("../utils/errors.js");
20
20
  const _objectKindsTs = require("../utils/objectKinds.js");
@@ -43,7 +43,7 @@ const parseDefinition = (def, ctx)=>{
43
43
  }
44
44
  };
45
45
  case "Function":
46
- return (0, _mainTs.isType)(def) ? def.node : (0, _errorsTs.throwParseError)(writeBadDefinitionTypeMessage("Function"));
46
+ return (0, _typeTs.isType)(def) ? def.node : (0, _errorsTs.throwParseError)(writeBadDefinitionTypeMessage("Function"));
47
47
  default:
48
48
  return (0, _errorsTs.throwParseError)(writeBadDefinitionTypeMessage(objectKind ?? (0, _serializeTs.stringify)(def)));
49
49
  }
@@ -30,7 +30,7 @@ const compileDisjointReasonsMessage = (disjoints)=>{
30
30
  }
31
31
  return message;
32
32
  };
33
- const writeImplicitNeverMessage = (path, description)=>`${path.length ? `At ${path}: ` : ""}Intersection ${description ? `${description} ` : ""}results in an unsatisfiable type`;
33
+ const writeImplicitNeverMessage = (path, operator, description)=>`${path.length ? `At ${path}: ` : ""}${operator} ${description ? `${description} ` : ""}results in an unsatisfiable type`;
34
34
  const writeUndiscriminatableMorphUnionMessage = (path)=>`${path === "/" ? "A" : `At ${path}, a`} union including one or more morphs must be discriminatable`;
35
35
  const writeIndivisibleMessage = (root)=>`Divisibility operand ${root} must be a number`;
36
36
  const writeUnboundableMessage = (root)=>`Bounded expression ${root} must be a number, string or array`;
@@ -10,15 +10,14 @@ const _predicateTs = require("../../nodes/predicate.js");
10
10
  const _errorsTs = require("../../utils/errors.js");
11
11
  const _genericsTs = require("../../utils/generics.js");
12
12
  const _definitionTs = require("../definition.js");
13
+ const _astTs = require("../string/ast.js");
13
14
  const parseKeyOfTuple = (def, ctx)=>{
14
15
  const resolution = ctx.type.meta.scope.resolveNode((0, _definitionTs.parseDefinition)(def[1], ctx));
15
16
  if (!(0, _predicateTs.resolutionExtendsDomain)(resolution, "object")) {
16
- return (0, _errorsTs.throwParseError)("never");
17
+ return (0, _errorsTs.throwParseError)((0, _astTs.writeImplicitNeverMessage)(ctx.path, "keyof"));
17
18
  }
18
19
  if (resolution.object === true) {
19
- return {
20
- string: true
21
- };
20
+ return (0, _astTs.writeImplicitNeverMessage)(ctx.path, "keyof");
22
21
  }
23
22
  const branchKeys = [];
24
23
  const objectBranches = (0, _genericsTs.listFrom)(resolution.object);
@@ -26,7 +25,7 @@ const parseKeyOfTuple = (def, ctx)=>{
26
25
  for(let i = 1; i < objectBranches.length; i++){
27
26
  const keys = getPropsFromBranch(objectBranches[i]);
28
27
  if (!keys.length) {
29
- return (0, _errorsTs.throwParseError)("never");
28
+ return (0, _astTs.writeImplicitNeverMessage)(ctx.path, "keyof");
30
29
  }
31
30
  branchKeys.push(keys);
32
31
  }
@@ -39,8 +38,8 @@ const parseKeyOfTuple = (def, ctx)=>{
39
38
  });
40
39
  }
41
40
  });
42
- return {
41
+ return result.length ? {
43
42
  string: result
44
- };
43
+ } : (0, _astTs.writeImplicitNeverMessage)(ctx.path, "keyof");
45
44
  };
46
45
  const getPropsFromBranch = (branch)=>(0, _genericsTs.hasKey)(branch, "props") ? Object.keys(branch.props) : [];
@@ -12,6 +12,7 @@ _export(exports, {
12
12
  parseMorphTuple: ()=>parseMorphTuple,
13
13
  writeMalformedMorphExpressionMessage: ()=>writeMalformedMorphExpressionMessage
14
14
  });
15
+ const _predicateTs = require("../../nodes/predicate.js");
15
16
  const _errorsTs = require("../../utils/errors.js");
16
17
  const _objectKindsTs = require("../../utils/objectKinds.js");
17
18
  const _serializeTs = require("../../utils/serialize.js");
@@ -29,7 +30,7 @@ const parseMorphTuple = (def, ctx)=>{
29
30
  const predicate = resolution[domain];
30
31
  if (predicate === true) {
31
32
  result[domain] = {
32
- input: {},
33
+ rules: {},
33
34
  morph
34
35
  };
35
36
  } else if (typeof predicate === "object") {
@@ -40,17 +41,17 @@ const parseMorphTuple = (def, ctx)=>{
40
41
  }
41
42
  return result;
42
43
  };
43
- const applyMorph = (branch, morph)=>branch.morph ? {
44
- input: branch.input,
45
- morph: Array.isArray(branch.morph) ? [
44
+ const applyMorph = (branch, morph)=>(0, _predicateTs.branchIsTransformation)(branch) ? {
45
+ ...branch,
46
+ morph: branch.morph ? Array.isArray(branch.morph) ? [
46
47
  ...branch.morph,
47
48
  morph
48
49
  ] : [
49
50
  branch.morph,
50
51
  morph
51
- ]
52
+ ] : morph
52
53
  } : {
53
- input: branch,
54
+ rules: branch,
54
55
  morph
55
56
  };
56
57
  const writeMalformedMorphExpressionMessage = (value)=>`Morph expression requires a function following '=>' (was ${typeof value})`;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ Cache: ()=>Cache,
13
+ FreezingCache: ()=>FreezingCache
14
+ });
15
+ const _freezeTs = require("../utils/freeze.js");
16
+ class Cache {
17
+ get root() {
18
+ return this.cache;
19
+ }
20
+ has(name) {
21
+ return name in this.cache;
22
+ }
23
+ get(name) {
24
+ return this.cache[name];
25
+ }
26
+ set(name, item) {
27
+ this.cache[name] = item;
28
+ return item;
29
+ }
30
+ constructor(){
31
+ this.cache = {};
32
+ }
33
+ }
34
+ class FreezingCache extends Cache {
35
+ set(name, item) {
36
+ this.cache[name] = (0, _freezeTs.deepFreeze)(item);
37
+ return item;
38
+ }
39
+ }
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ jsObjectsScope: ()=>jsObjectsScope,
13
+ jsObjects: ()=>jsObjects
14
+ });
15
+ const _scopeTs = require("./scope.js");
16
+ const jsObjectsScope = (0, _scopeTs.scope)({
17
+ Function: [
18
+ "node",
19
+ {
20
+ object: {
21
+ objectKind: "Function"
22
+ }
23
+ }
24
+ ],
25
+ Array: [
26
+ "node",
27
+ {
28
+ object: {
29
+ objectKind: "Array"
30
+ }
31
+ }
32
+ ],
33
+ Date: [
34
+ "node",
35
+ {
36
+ object: {
37
+ objectKind: "Date"
38
+ }
39
+ }
40
+ ],
41
+ Error: [
42
+ "node",
43
+ {
44
+ object: {
45
+ objectKind: "Error"
46
+ }
47
+ }
48
+ ],
49
+ Map: [
50
+ "node",
51
+ {
52
+ object: {
53
+ objectKind: "Map"
54
+ }
55
+ }
56
+ ],
57
+ RegExp: [
58
+ "node",
59
+ {
60
+ object: {
61
+ objectKind: "RegExp"
62
+ }
63
+ }
64
+ ],
65
+ Set: [
66
+ "node",
67
+ {
68
+ object: {
69
+ objectKind: "Set"
70
+ }
71
+ }
72
+ ],
73
+ Object: [
74
+ "node",
75
+ {
76
+ object: {
77
+ objectKind: "Object"
78
+ }
79
+ }
80
+ ],
81
+ String: [
82
+ "node",
83
+ {
84
+ object: {
85
+ objectKind: "String"
86
+ }
87
+ }
88
+ ],
89
+ Number: [
90
+ "node",
91
+ {
92
+ object: {
93
+ objectKind: "Number"
94
+ }
95
+ }
96
+ ],
97
+ Boolean: [
98
+ "node",
99
+ {
100
+ object: {
101
+ objectKind: "Boolean"
102
+ }
103
+ }
104
+ ],
105
+ WeakMap: [
106
+ "node",
107
+ {
108
+ object: {
109
+ objectKind: "WeakMap"
110
+ }
111
+ }
112
+ ],
113
+ WeakSet: [
114
+ "node",
115
+ {
116
+ object: {
117
+ objectKind: "WeakSet"
118
+ }
119
+ }
120
+ ],
121
+ Promise: [
122
+ "node",
123
+ {
124
+ object: {
125
+ objectKind: "Promise"
126
+ }
127
+ }
128
+ ]
129
+ }, {
130
+ name: "jsObjects",
131
+ standard: false
132
+ });
133
+ const jsObjects = jsObjectsScope.compile();