Comparing version 5.0.0-alpha.2 to 5.0.0-alpha.3
@@ -10,5 +10,5 @@ import { Blueprint, DeepPartial, SchemaValidateOptions } from './types'; | ||
configure: (options: OptimalOptions) => void; | ||
validate: (struct: DeepPartial<T>, options?: SchemaValidateOptions) => T; | ||
validate: (struct: DeepPartial<T>, options?: SchemaValidateOptions) => Required<T>; | ||
} | ||
export declare function optimal<Schemas extends object>(blueprint: Blueprint<Schemas>, baseOpts?: OptimalOptions): Optimal<Schemas>; | ||
//# sourceMappingURL=optimal.d.ts.map |
import { AnySchema, DefaultValue } from '../types'; | ||
export declare function blueprint(defaultValue?: DefaultValue<Record<string, AnySchema>>): import("./object").ObjectSchema<Record<string, AnySchema>>; | ||
export declare function blueprint(defaultValue?: DefaultValue<Record<string, AnySchema>>): import("./object").ObjectSchema<Record<string, Required<AnySchema>>>; | ||
//# sourceMappingURL=blueprint.d.ts.map |
import { Blueprint, CommonCriterias, Schema, ShapeCriterias } from '../types'; | ||
export interface ShapeSchema<T> extends Schema<T>, ShapeCriterias<ShapeSchema<T>>, CommonCriterias<ShapeSchema<T>> { | ||
export interface ShapeSchema<T> extends Schema<Required<T>>, ShapeCriterias<ShapeSchema<T>>, CommonCriterias<ShapeSchema<T>> { | ||
never: () => ShapeSchema<never>; | ||
@@ -4,0 +4,0 @@ notNullable: () => ShapeSchema<NonNullable<T>>; |
import { InferTupleItems } from '../criteria/tuples'; | ||
import { CommonCriterias, Schema } from '../types'; | ||
export interface TupleSchema<T> extends Schema<T>, CommonCriterias<TupleSchema<T>> { | ||
export interface TupleSchema<T> extends Schema<Required<T>>, CommonCriterias<TupleSchema<T>> { | ||
never: () => TupleSchema<never>; | ||
@@ -5,0 +5,0 @@ notNullable: () => TupleSchema<NonNullable<T>>; |
@@ -111,5 +111,5 @@ export declare type Primitive = bigint | boolean | number | string | symbol | null | undefined; | ||
[K in keyof T]?: DeepPartial<T[K]>; | ||
} : never; | ||
} : T; | ||
export declare type AnySchema = Schema<any>; | ||
export declare type AnyFunction = (...args: any[]) => any; | ||
//# sourceMappingURL=types.d.ts.map |
{ | ||
"name": "optimal", | ||
"type": "module", | ||
"version": "5.0.0-alpha.2", | ||
"version": "5.0.0-alpha.3", | ||
"description": "A system for building and validating defined object structures with schemas.", | ||
"main": "./mjs/index.mjs", | ||
"main": "./lib/node/index.js", | ||
"browser": "./lib/browser/index.js", | ||
"module": "./esm/index.js", | ||
@@ -34,4 +35,3 @@ "types": "./dts/index.d.ts", | ||
"esm/**/*.{js,map}", | ||
"mjs/**/*.{js,map}", | ||
"mjs/**/*.{mjs,map}", | ||
"lib/**/*.{js,map}", | ||
"src/**/*.{ts,tsx,json}" | ||
@@ -50,3 +50,3 @@ ], | ||
"format": [ | ||
"mjs", | ||
"lib", | ||
"esm" | ||
@@ -59,18 +59,3 @@ ], | ||
}, | ||
"devDependencies": { | ||
"@jest/globals": "*" | ||
}, | ||
"exports": { | ||
"./package.json": "./package.json", | ||
".": { | ||
"browser": { | ||
"import": "./esm/index.js", | ||
"module": "./esm/index.js" | ||
}, | ||
"node": { | ||
"import": "./mjs/index.mjs" | ||
}, | ||
"types": "./dts/index.d.ts" | ||
} | ||
} | ||
"gitHead": "ff5624c9e6327990d91ad2d69797a6cebaeca67d" | ||
} |
@@ -16,3 +16,3 @@ import { isObject } from './helpers'; | ||
configure: (options: OptimalOptions) => void; | ||
validate: (struct: DeepPartial<T>, options?: SchemaValidateOptions) => T; | ||
validate: (struct: DeepPartial<T>, options?: SchemaValidateOptions) => Required<T>; | ||
} | ||
@@ -19,0 +19,0 @@ |
@@ -7,3 +7,3 @@ import { createSchema } from '../createSchema'; | ||
export interface ShapeSchema<T> | ||
extends Schema<T>, | ||
extends Schema<Required<T>>, | ||
ShapeCriterias<ShapeSchema<T>>, | ||
@@ -10,0 +10,0 @@ CommonCriterias<ShapeSchema<T>> { |
@@ -7,3 +7,3 @@ import { createSchema } from '../createSchema'; | ||
export interface TupleSchema<T> extends Schema<T>, CommonCriterias<TupleSchema<T>> { | ||
export interface TupleSchema<T> extends Schema<Required<T>>, CommonCriterias<TupleSchema<T>> { | ||
never: () => TupleSchema<never>; | ||
@@ -10,0 +10,0 @@ notNullable: () => TupleSchema<NonNullable<T>>; |
@@ -179,3 +179,3 @@ export type Primitive = bigint | boolean | number | string | symbol | null | undefined; | ||
? { [K in keyof T]?: DeepPartial<T[K]> } | ||
: never; | ||
: T; | ||
@@ -182,0 +182,0 @@ // Any is required for generics to be typed correctly for consumers |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
349930
0
83
6802