@atscript/typescript 0.1.104 → 0.1.105

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.
package/dist/cli.cjs CHANGED
@@ -1014,6 +1014,9 @@ function _define_property$4(obj, key, value) {
1014
1014
  get path() {
1015
1015
  return this.buildPath();
1016
1016
  }
1017
+ /** The type this validator was created for (see {@link TValidatorPluginContext.root}). */ get root() {
1018
+ return this.def;
1019
+ }
1017
1020
  validateAnnotatedType(def, value) {
1018
1021
  switch (def.type.kind) {
1019
1022
  case "":
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
- const require_plugin = require('./plugin-gpq_ji-_.cjs');
2
+ const require_plugin = require('./plugin-91-z7KE-.cjs');
3
3
 
4
4
  exports.default = require_plugin.tsPlugin;
5
5
  exports.tsPlugin = require_plugin.tsPlugin;
package/dist/index.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { t as tsPlugin } from "./plugin-Crcxc9aq.mjs";
1
+ import { t as tsPlugin } from "./plugin-GvSLmYJb.mjs";
2
2
 
3
3
  export { tsPlugin as default, tsPlugin };
@@ -346,6 +346,9 @@ function _define_property(obj, key, value) {
346
346
  get path() {
347
347
  return this.buildPath();
348
348
  }
349
+ /** The type this validator was created for (see {@link TValidatorPluginContext.root}). */ get root() {
350
+ return this.def;
351
+ }
349
352
  validateAnnotatedType(def, value) {
350
353
  switch (def.type.kind) {
351
354
  case "":
@@ -345,6 +345,9 @@ function _define_property(obj, key, value) {
345
345
  get path() {
346
346
  return this.buildPath();
347
347
  }
348
+ /** The type this validator was created for (see {@link TValidatorPluginContext.root}). */ get root() {
349
+ return this.def;
350
+ }
348
351
  validateAnnotatedType(def, value) {
349
352
  switch (def.type.kind) {
350
353
  case "":
@@ -25,7 +25,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
25
25
  }) : target, mod));
26
26
 
27
27
  //#endregion
28
- const require_json_schema = require('./json-schema-L8xJQiLc.cjs');
28
+ const require_json_schema = require('./json-schema-BN0B-fMO.cjs');
29
29
  let path = require("path");
30
30
  path = __toESM(path);
31
31
  let _atscript_core = require("@atscript/core");
@@ -1,4 +1,4 @@
1
- import { l as defineAnnotatedType, t as buildJsonSchema } from "./json-schema-BGYiqs-J.mjs";
1
+ import { l as defineAnnotatedType, t as buildJsonSchema } from "./json-schema-DKgNpLpU.mjs";
2
2
  import path from "path";
3
3
  import { DEFAULT_FORMAT, flattenInterfaceNode, getRelPath, hasNavPropAnnotation, isArray, isBareId, isBareSpecifier, isConst, isDbEntityNode, isGroup, isInterface, isPrimitive, isProp, isQueryLogical, isRef, isStructure } from "@atscript/core";
4
4
 
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_plugin = require('./plugin-gpq_ji-_.cjs');
2
+ const require_plugin = require('./plugin-91-z7KE-.cjs');
3
3
  let path = require("path");
4
4
  path = require_plugin.__toESM(path);
5
5
  let _atscript_core = require("@atscript/core");
@@ -1,4 +1,4 @@
1
- import { t as tsPlugin } from "./plugin-Crcxc9aq.mjs";
1
+ import { t as tsPlugin } from "./plugin-GvSLmYJb.mjs";
2
2
  import path from "path";
3
3
  import { build } from "@atscript/core";
4
4
  import { readFileSync, writeFileSync } from "fs";
package/dist/utils.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_json_schema = require('./json-schema-L8xJQiLc.cjs');
2
+ const require_json_schema = require('./json-schema-BN0B-fMO.cjs');
3
3
 
4
4
  //#region packages/typescript/src/runtime/coerce.ts
5
5
  /**
package/dist/utils.d.ts CHANGED
@@ -25,6 +25,11 @@ interface TValidatorPluginContext {
25
25
  validateAnnotatedType: Validator<any>['validateAnnotatedType'];
26
26
  error: Validator<any>['error'];
27
27
  path: Validator<any>['path'];
28
+ /**
29
+ * The type the validator was created for — the root of the walk, as passed to the
30
+ * constructor (before `replace`). The plugin's `def` argument is the node visited now.
31
+ */
32
+ readonly root: TAtscriptAnnotatedType;
28
33
  context: unknown;
29
34
  }
30
35
  /**
@@ -89,6 +94,8 @@ declare class Validator<T extends TAtscriptAnnotatedType = TAtscriptAnnotatedTyp
89
94
  private get shortcuts();
90
95
  protected validateSafe(def: TAtscriptAnnotatedType, value: any): boolean;
91
96
  protected get path(): string;
97
+ /** The type this validator was created for (see {@link TValidatorPluginContext.root}). */
98
+ protected get root(): T;
92
99
  protected validateAnnotatedType(def: TAtscriptAnnotatedType, value: any): boolean;
93
100
  protected validateUnion(def: TAtscriptAnnotatedType<TAtscriptTypeComplex>, value: any): boolean;
94
101
  /**
package/dist/utils.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as forAnnotatedType, c as createAnnotatedTypeNode, d as isAnnotatedTypeOfPrimitive, f as isPhantomType, i as mergeJsonSchemas, l as defineAnnotatedType, m as ValidatorError, n as detectDiscriminator, o as annotate, p as Validator, r as fromJsonSchema, s as cloneRefProp, t as buildJsonSchema, u as isAnnotatedType } from "./json-schema-BGYiqs-J.mjs";
1
+ import { a as forAnnotatedType, c as createAnnotatedTypeNode, d as isAnnotatedTypeOfPrimitive, f as isPhantomType, i as mergeJsonSchemas, l as defineAnnotatedType, m as ValidatorError, n as detectDiscriminator, o as annotate, p as Validator, r as fromJsonSchema, s as cloneRefProp, t as buildJsonSchema, u as isAnnotatedType } from "./json-schema-DKgNpLpU.mjs";
2
2
 
3
3
  //#region packages/typescript/src/runtime/coerce.ts
4
4
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atscript/typescript",
3
- "version": "0.1.104",
3
+ "version": "0.1.105",
4
4
  "description": "Atscript: typescript-gen support.",
5
5
  "keywords": [
6
6
  "annotations",
@@ -73,7 +73,7 @@
73
73
  },
74
74
  "peerDependencies": {
75
75
  "@atscript/db": "^0.1.97",
76
- "@atscript/core": "^0.1.104"
76
+ "@atscript/core": "^0.1.105"
77
77
  },
78
78
  "peerDependenciesMeta": {
79
79
  "@atscript/db": {