@nmtjs/type 0.13.0 → 0.14.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.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import * as zod from 'zod/v4-mini';
1
+ import * as zod from 'zod/mini';
2
2
  import * as type from "./types/type.js";
3
3
  zod.config(zod.core.locales.en());
4
4
  export * from "./types/base.js";
@@ -1,4 +1,4 @@
1
- import * as zod from 'zod/v4-mini';
1
+ import * as zod from 'zod/mini';
2
2
  import { BaseType } from './base.ts';
3
3
  export declare class AnyType extends BaseType<zod.ZodMiniAny> {
4
4
  static factory(): AnyType;
package/dist/types/any.js CHANGED
@@ -1,10 +1,8 @@
1
- import * as zod from 'zod/v4-mini';
1
+ import * as zod from 'zod/mini';
2
2
  import { BaseType } from "./base.js";
3
3
  export class AnyType extends BaseType {
4
4
  static factory() {
5
- return new AnyType({
6
- encodedZodType: zod.any(),
7
- });
5
+ return new AnyType({ encodedZodType: zod.any() });
8
6
  }
9
7
  }
10
8
  export const any = AnyType.factory;
@@ -1,4 +1,4 @@
1
- import * as zod from 'zod/v4-mini';
1
+ import * as zod from 'zod/mini';
2
2
  import { BaseType } from './base.ts';
3
3
  type Check = zod.core.CheckFn<any[]> | zod.core.$ZodCheck<any[]>;
4
4
  export declare class ArrayType<T extends BaseType = BaseType> extends BaseType<zod.ZodMiniArray<T['encodedZodType']>, zod.ZodMiniArray<T['decodedZodType']>, {
@@ -1,4 +1,4 @@
1
- import * as zod from 'zod/v4-mini';
1
+ import * as zod from 'zod/mini';
2
2
  import { BaseType } from "./base.js";
3
3
  export class ArrayType extends BaseType {
4
4
  static factory(element, ...checks) {
@@ -1,4 +1,4 @@
1
- import * as zod from 'zod/v4-mini';
1
+ import * as zod from 'zod/mini';
2
2
  export type PrimitiveValueType = string | number | boolean | null;
3
3
  export type PrimitiveZodType = zod.ZodMiniNever | zod.ZodMiniDefault | zod.ZodMiniNullable | zod.ZodMiniOptional | zod.ZodMiniString | zod.ZodMiniObject | zod.ZodMiniAny | zod.ZodMiniArray | zod.ZodMiniBoolean | zod.ZodMiniNumber | zod.ZodMiniEnum<any> | zod.ZodMiniLiteral<PrimitiveValueType> | zod.ZodMiniUnion | zod.ZodMiniIntersection | zod.ZodMiniRecord;
4
4
  export type SimpleZodType = zod.ZodMiniType;
@@ -1,4 +1,4 @@
1
- import * as zod from 'zod/v4-mini';
1
+ import * as zod from 'zod/mini';
2
2
  export const typesRegistry = zod.registry();
3
3
  export const NeemataTypeError = zod.core.$ZodError;
4
4
  export class BaseType {
@@ -1,4 +1,4 @@
1
- import * as zod from 'zod/v4-mini';
1
+ import * as zod from 'zod/mini';
2
2
  import { BaseType } from './base.ts';
3
3
  export declare class BooleanType extends BaseType<zod.ZodMiniBoolean<boolean>> {
4
4
  static factory(): BooleanType;
@@ -1,10 +1,8 @@
1
- import * as zod from 'zod/v4-mini';
1
+ import * as zod from 'zod/mini';
2
2
  import { BaseType } from "./base.js";
3
3
  export class BooleanType extends BaseType {
4
4
  static factory() {
5
- return new BooleanType({
6
- encodedZodType: zod.boolean(),
7
- });
5
+ return new BooleanType({ encodedZodType: zod.boolean() });
8
6
  }
9
7
  }
10
8
  export const boolean = BooleanType.factory;
@@ -1,5 +1,6 @@
1
- import * as zod from 'zod/v4-mini';
2
- import { BaseType, type SimpleZodType, type ZodType } from './base.ts';
1
+ import * as zod from 'zod/mini';
2
+ import type { SimpleZodType, ZodType } from './base.ts';
3
+ import { BaseType } from './base.ts';
3
4
  export type CustomTransformFn<I, O> = (value: I) => O;
4
5
  export declare abstract class TransformType<Type, EncodedType extends SimpleZodType = zod.ZodMiniType<Type, Type>, DecodedType extends ZodType = zod.ZodMiniType<Type, Type>> extends BaseType<zod.ZodMiniPipe<zod.ZodMiniType<DecodedType['_zod']['output'], DecodedType['_zod']['input']>, EncodedType>, zod.ZodMiniPipe<EncodedType, zod.ZodMiniType<DecodedType['_zod']['output'], DecodedType['_zod']['input']>>> {
5
6
  }
@@ -1,4 +1,4 @@
1
- import * as zod from 'zod/v4-mini';
1
+ import * as zod from 'zod/mini';
2
2
  import { BaseType } from "./base.js";
3
3
  export class TransformType extends BaseType {
4
4
  }
@@ -1,4 +1,4 @@
1
- import * as zod from 'zod/v4-mini';
1
+ import * as zod from 'zod/mini';
2
2
  import { CustomType, TransformType } from './custom.ts';
3
3
  export declare class DateType extends TransformType<Date, zod.ZodMiniUnion<[zod.iso.ZodMiniISODate, zod.iso.ZodMiniISODateTime]>> {
4
4
  static factory(): CustomType<Date, zod.ZodMiniUnion<[zod.z.iso.ZodMiniISODate, zod.z.iso.ZodMiniISODateTime]>, zod.ZodMiniType<Date, Date, zod.z.core.$ZodTypeInternals<Date, Date>>>;
@@ -1,4 +1,4 @@
1
- import * as zod from 'zod/v4-mini';
1
+ import * as zod from 'zod/mini';
2
2
  import { CustomType, TransformType } from "./custom.js";
3
3
  export class DateType extends TransformType {
4
4
  static factory() {
@@ -1,4 +1,4 @@
1
- import * as zod from 'zod/v4-mini';
1
+ import * as zod from 'zod/mini';
2
2
  import { BaseType } from './base.ts';
3
3
  export declare class EnumType<T extends zod.core.util.EnumLike = zod.core.util.EnumLike> extends BaseType<zod.ZodMiniEnum<T>, zod.ZodMiniEnum<T>, {
4
4
  values: T;
@@ -1,4 +1,4 @@
1
- import * as zod from 'zod/v4-mini';
1
+ import * as zod from 'zod/mini';
2
2
  import { BaseType } from "./base.js";
3
3
  export class EnumType extends BaseType {
4
4
  static factory(values) {
@@ -1,5 +1,6 @@
1
- import * as zod from 'zod/v4-mini';
2
- import { BaseType, type PrimitiveValueType } from './base.ts';
1
+ import * as zod from 'zod/mini';
2
+ import type { PrimitiveValueType } from './base.ts';
3
+ import { BaseType } from './base.ts';
3
4
  export declare class LiteralType<T extends PrimitiveValueType = PrimitiveValueType> extends BaseType<zod.ZodMiniLiteral<T>, zod.ZodMiniLiteral<T>, {
4
5
  value: T;
5
6
  }> {
@@ -1,4 +1,4 @@
1
- import * as zod from 'zod/v4-mini';
1
+ import * as zod from 'zod/mini';
2
2
  import { BaseType } from "./base.js";
3
3
  export class LiteralType extends BaseType {
4
4
  static factory(value) {
@@ -1,4 +1,4 @@
1
- import * as zod from 'zod/v4-mini';
1
+ import * as zod from 'zod/mini';
2
2
  import { BaseType } from './base.ts';
3
3
  export declare class NeverType extends BaseType<zod.ZodMiniNever> {
4
4
  static factory(): NeverType;
@@ -1,10 +1,8 @@
1
- import * as zod from 'zod/v4-mini';
1
+ import * as zod from 'zod/mini';
2
2
  import { BaseType } from "./base.js";
3
3
  export class NeverType extends BaseType {
4
4
  static factory() {
5
- return new NeverType({
6
- encodedZodType: zod.never(),
7
- });
5
+ return new NeverType({ encodedZodType: zod.never() });
8
6
  }
9
7
  }
10
8
  export const never = NeverType.factory;
@@ -1,4 +1,4 @@
1
- import * as zod from 'zod/v4-mini';
1
+ import * as zod from 'zod/mini';
2
2
  import { BaseType } from './base.ts';
3
3
  import { CustomType, TransformType } from './custom.ts';
4
4
  type Check = zod.core.CheckFn<number> | zod.core.$ZodCheck<number>;
@@ -1,4 +1,4 @@
1
- import * as zod from 'zod/v4-mini';
1
+ import * as zod from 'zod/mini';
2
2
  import { BaseType } from "./base.js";
3
3
  import { CustomType, TransformType } from "./custom.js";
4
4
  export class NumberType extends BaseType {
@@ -1,8 +1,9 @@
1
- import * as zod from 'zod/v4-mini';
2
- import { BaseType, type BaseTypeAny, type OptionalType } from './base.ts';
3
- import { EnumType } from './enum.ts';
1
+ import * as zod from 'zod/mini';
2
+ import type { BaseTypeAny, OptionalType } from './base.ts';
4
3
  import type { LiteralType } from './literal.ts';
5
4
  import type { StringType } from './string.ts';
5
+ import { BaseType } from './base.ts';
6
+ import { EnumType } from './enum.ts';
6
7
  export type ObjectTypeProps = {
7
8
  [k: string]: BaseTypeAny;
8
9
  };
@@ -1,4 +1,4 @@
1
- import * as zod from 'zod/v4-mini';
1
+ import * as zod from 'zod/mini';
2
2
  import { BaseType } from "./base.js";
3
3
  import { EnumType } from "./enum.js";
4
4
  export class ObjectType extends BaseType {
@@ -1,4 +1,4 @@
1
- import * as zod from 'zod/v4-mini';
1
+ import * as zod from 'zod/mini';
2
2
  import { BaseType } from './base.ts';
3
3
  type Check = zod.core.CheckFn<string> | zod.core.$ZodCheck<string>;
4
4
  export declare class StringType extends BaseType<zod.ZodMiniString<string>, zod.ZodMiniString<string>> {
@@ -1,4 +1,4 @@
1
- import * as zod from 'zod/v4-mini';
1
+ import * as zod from 'zod/mini';
2
2
  import { BaseType } from "./base.js";
3
3
  export class StringType extends BaseType {
4
4
  static factory(...checks) {
@@ -1,5 +1,5 @@
1
+ import type { ZodMiniString } from 'zod/mini';
1
2
  import { Temporal } from 'temporal-polyfill';
2
- import { type ZodMiniString } from 'zod/v4-mini';
3
3
  import { CustomType, TransformType } from './custom.ts';
4
4
  type Types = Exclude<keyof typeof Temporal, 'Now' | 'Instant' | 'Calendar' | 'TimeZone'>;
5
5
  type TemporalTransformer<T extends Types> = {
@@ -9,31 +9,31 @@ type TemporalTransformer<T extends Types> = {
9
9
  type EncodedType = ZodMiniString<string>;
10
10
  export declare class PlainDateType extends TransformType<Temporal.PlainDate, EncodedType> {
11
11
  static transformer: TemporalTransformer<"PlainDate">;
12
- static factory(): CustomType<Temporal.PlainDate, EncodedType, import("zod/v4-mini").ZodMiniType<Temporal.PlainDate, Temporal.PlainDate, import("zod/v4/core").$ZodTypeInternals<Temporal.PlainDate, Temporal.PlainDate>>>;
12
+ static factory(): CustomType<Temporal.PlainDate, EncodedType, import("zod/mini").ZodMiniType<Temporal.PlainDate, Temporal.PlainDate, import("zod/v4/core").$ZodTypeInternals<Temporal.PlainDate, Temporal.PlainDate>>>;
13
13
  }
14
14
  export declare class PlainDateTimeType extends TransformType<Temporal.PlainDateTime, EncodedType> {
15
15
  static transformer: TemporalTransformer<"PlainDateTime">;
16
- static factory(): CustomType<Temporal.PlainDateTime, EncodedType, import("zod/v4-mini").ZodMiniType<Temporal.PlainDateTime, Temporal.PlainDateTime, import("zod/v4/core").$ZodTypeInternals<Temporal.PlainDateTime, Temporal.PlainDateTime>>>;
16
+ static factory(): CustomType<Temporal.PlainDateTime, EncodedType, import("zod/mini").ZodMiniType<Temporal.PlainDateTime, Temporal.PlainDateTime, import("zod/v4/core").$ZodTypeInternals<Temporal.PlainDateTime, Temporal.PlainDateTime>>>;
17
17
  }
18
18
  export declare class ZonedDateTimeType extends TransformType<Temporal.ZonedDateTime, EncodedType> {
19
19
  static transformer: TemporalTransformer<"ZonedDateTime">;
20
- static factory(): CustomType<Temporal.ZonedDateTime, EncodedType, import("zod/v4-mini").ZodMiniType<Temporal.ZonedDateTime, Temporal.ZonedDateTime, import("zod/v4/core").$ZodTypeInternals<Temporal.ZonedDateTime, Temporal.ZonedDateTime>>>;
20
+ static factory(): CustomType<Temporal.ZonedDateTime, EncodedType, import("zod/mini").ZodMiniType<Temporal.ZonedDateTime, Temporal.ZonedDateTime, import("zod/v4/core").$ZodTypeInternals<Temporal.ZonedDateTime, Temporal.ZonedDateTime>>>;
21
21
  }
22
22
  export declare class PlainTimeType extends TransformType<Temporal.PlainTime, EncodedType> {
23
23
  static transformer: TemporalTransformer<"PlainTime">;
24
- static factory(): CustomType<Temporal.PlainTime, EncodedType, import("zod/v4-mini").ZodMiniType<Temporal.PlainTime, Temporal.PlainTime, import("zod/v4/core").$ZodTypeInternals<Temporal.PlainTime, Temporal.PlainTime>>>;
24
+ static factory(): CustomType<Temporal.PlainTime, EncodedType, import("zod/mini").ZodMiniType<Temporal.PlainTime, Temporal.PlainTime, import("zod/v4/core").$ZodTypeInternals<Temporal.PlainTime, Temporal.PlainTime>>>;
25
25
  }
26
26
  export declare class DurationType extends TransformType<Temporal.Duration, EncodedType> {
27
27
  static transformer: TemporalTransformer<"Duration">;
28
- static factory(): CustomType<Temporal.Duration, EncodedType, import("zod/v4-mini").ZodMiniType<Temporal.Duration, Temporal.Duration, import("zod/v4/core").$ZodTypeInternals<Temporal.Duration, Temporal.Duration>>>;
28
+ static factory(): CustomType<Temporal.Duration, EncodedType, import("zod/mini").ZodMiniType<Temporal.Duration, Temporal.Duration, import("zod/v4/core").$ZodTypeInternals<Temporal.Duration, Temporal.Duration>>>;
29
29
  }
30
30
  export declare class PlainYearMonthType extends TransformType<Temporal.PlainYearMonth, EncodedType> {
31
31
  static transformer: TemporalTransformer<"PlainYearMonth">;
32
- static factory(): CustomType<Temporal.PlainYearMonth, EncodedType, import("zod/v4-mini").ZodMiniType<Temporal.PlainYearMonth, Temporal.PlainYearMonth, import("zod/v4/core").$ZodTypeInternals<Temporal.PlainYearMonth, Temporal.PlainYearMonth>>>;
32
+ static factory(): CustomType<Temporal.PlainYearMonth, EncodedType, import("zod/mini").ZodMiniType<Temporal.PlainYearMonth, Temporal.PlainYearMonth, import("zod/v4/core").$ZodTypeInternals<Temporal.PlainYearMonth, Temporal.PlainYearMonth>>>;
33
33
  }
34
34
  export declare class PlainMonthDayType extends TransformType<Temporal.PlainMonthDay, EncodedType> {
35
35
  static transformer: TemporalTransformer<"PlainMonthDay">;
36
- static factory(): CustomType<Temporal.PlainMonthDay, EncodedType, import("zod/v4-mini").ZodMiniType<Temporal.PlainMonthDay, Temporal.PlainMonthDay, import("zod/v4/core").$ZodTypeInternals<Temporal.PlainMonthDay, Temporal.PlainMonthDay>>>;
36
+ static factory(): CustomType<Temporal.PlainMonthDay, EncodedType, import("zod/mini").ZodMiniType<Temporal.PlainMonthDay, Temporal.PlainMonthDay, import("zod/v4/core").$ZodTypeInternals<Temporal.PlainMonthDay, Temporal.PlainMonthDay>>>;
37
37
  }
38
38
  export declare const plainDate: typeof PlainDateType.factory;
39
39
  export declare const plainDatetime: typeof PlainDateTimeType.factory;
@@ -1,5 +1,5 @@
1
1
  import { Temporal } from 'temporal-polyfill';
2
- import { iso, regex, string } from 'zod/v4-mini';
2
+ import { iso, regex, string } from 'zod/mini';
3
3
  import { CustomType, TransformType } from "./custom.js";
4
4
  const createTemporalTransformer = (type, decode = (value) => Temporal[type].from(value)) => {
5
5
  const encode = (value) => value.toString({
@@ -7,10 +7,7 @@ const createTemporalTransformer = (type, decode = (value) => Temporal[type].from
7
7
  smallestUnit: 'microsecond',
8
8
  timeZoneName: 'never',
9
9
  });
10
- return {
11
- decode,
12
- encode,
13
- };
10
+ return { decode, encode };
14
11
  };
15
12
  export class PlainDateType extends TransformType {
16
13
  static transformer = createTemporalTransformer('PlainDate');
@@ -1,5 +1,5 @@
1
1
  import type { ArrayMap } from '@nmtjs/common';
2
- import * as zod from 'zod/v4-mini';
2
+ import * as zod from 'zod/mini';
3
3
  import { BaseType } from './base.ts';
4
4
  export declare class TupleType<T extends readonly [BaseType, ...BaseType[]] = readonly [
5
5
  BaseType,
@@ -1,4 +1,4 @@
1
- import * as zod from 'zod/v4-mini';
1
+ import * as zod from 'zod/mini';
2
2
  import { BaseType } from "./base.js";
3
3
  export class TupleType extends BaseType {
4
4
  static factory(elements, rest = null) {
@@ -1,8 +1,9 @@
1
1
  import type { ArrayMap } from '@nmtjs/common';
2
- import * as zod from 'zod/v4-mini';
3
- import { BaseType, type BaseTypeAny } from './base.ts';
2
+ import * as zod from 'zod/mini';
3
+ import type { BaseTypeAny } from './base.ts';
4
4
  import type { LiteralType } from './literal.ts';
5
5
  import type { ObjectType, ObjectTypeProps } from './object.ts';
6
+ import { BaseType } from './base.ts';
6
7
  export declare class UnionType<T extends readonly [BaseType, ...BaseType[]] = readonly [
7
8
  BaseType,
8
9
  ...BaseType[]
@@ -1,4 +1,4 @@
1
- import * as zod from 'zod/v4-mini';
1
+ import * as zod from 'zod/mini';
2
2
  import { BaseType } from "./base.js";
3
3
  export class UnionType extends BaseType {
4
4
  static factory(...options) {
package/package.json CHANGED
@@ -7,6 +7,11 @@
7
7
  "import": "./dist/index.js",
8
8
  "module-sync": "./dist/index.js"
9
9
  },
10
+ "./*": {
11
+ "types": "./dist/types/*.d.ts",
12
+ "import": "./dist/types/*.js",
13
+ "module-sync": "./dist/types/*.js"
14
+ },
10
15
  "./temporal": {
11
16
  "types": "./dist/temporal.d.ts",
12
17
  "import": "./dist/temporal.js",
@@ -15,20 +20,20 @@
15
20
  },
16
21
  "peerDependencies": {
17
22
  "temporal-polyfill": "^0.3.0",
18
- "zod": "^3.25.0",
19
- "@nmtjs/common": "0.13.0"
23
+ "zod": "^4.0.0",
24
+ "@nmtjs/common": "0.14.0"
20
25
  },
21
26
  "devDependencies": {
22
27
  "temporal-polyfill": "^0.3.0",
23
- "zod": "^3.25.0",
24
- "@nmtjs/common": "0.13.0"
28
+ "zod": "^4.0.0",
29
+ "@nmtjs/common": "0.14.0"
25
30
  },
26
31
  "files": [
27
32
  "dist",
28
33
  "LICENSE.md",
29
34
  "README.md"
30
35
  ],
31
- "version": "0.13.0",
36
+ "version": "0.14.0",
32
37
  "scripts": {
33
38
  "build": "tsc",
34
39
  "type-check": "tsc --noEmit"