@typeonly/validator
Advanced tools
Comparing version 0.4.0 to 0.5.0
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createValidatorFromModules = exports.createValidator = void 0; | ||
const reader_1 = require("@typeonly/reader"); | ||
const loader_1 = require("@typeonly/loader"); | ||
const Validator_1 = require("./Validator"); | ||
function createValidator(options) { | ||
if (reader_1.isSyncReadModulesOptions(options)) | ||
if (loader_1.isSyncReadModulesOptions(options)) | ||
return createValidatorSync(options); | ||
@@ -14,6 +14,6 @@ else | ||
function createValidatorSync(options) { | ||
return createValidatorFromModules(reader_1.readModules(options), options); | ||
return createValidatorFromModules(loader_1.readModules(options), options); | ||
} | ||
async function createValidatorAsync(options) { | ||
return createValidatorFromModules(await reader_1.readModules(options), options); | ||
return createValidatorFromModules(await loader_1.readModules(options), options); | ||
} | ||
@@ -20,0 +20,0 @@ function createValidatorFromModules(modules, options) { |
// -- API Definitions -- | ||
import { AsyncReadModulesOptions, Modules, SyncReadModulesOptions } from "@typeonly/reader" | ||
import { AsyncReadModulesOptions, Modules, SyncReadModulesOptions } from "@typeonly/loader" | ||
export interface ValidatorOptions { | ||
@@ -5,0 +5,0 @@ acceptAdditionalProperties?: boolean |
{ | ||
"name": "@typeonly/validator", | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"description": "An API to validate JSON data or JavaScript objects, using TypeScript typing definitions.", | ||
@@ -18,3 +18,3 @@ "author": "Paroi", | ||
"dependencies": { | ||
"@typeonly/reader": "^0.4.0" | ||
"@typeonly/loader": "^0.5.0" | ||
}, | ||
@@ -21,0 +21,0 @@ "devDependencies": { |
@@ -1,2 +0,2 @@ | ||
import { AsyncReadModulesOptions, isSyncReadModulesOptions, Modules, readModules, SyncReadModulesOptions } from "@typeonly/reader" | ||
import { AsyncReadModulesOptions, isSyncReadModulesOptions, Modules, readModules, SyncReadModulesOptions } from "@typeonly/loader" | ||
import Validator from "./Validator" | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { Type } from "@typeonly/reader" | ||
import { Type } from "@typeonly/loader" | ||
import { Unmatch } from "./Validator" | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { ArrayType, CompositeType, FunctionType, GenericInstance, GenericParameterName, ImportedTypeRef, IndexSignature, Interface, KeyofType, LiteralType, LocalTypeRef, MemberNameLiteral, MemberType, Modules, Properties, Property, TupleType, Type, TypeName } from "@typeonly/reader" | ||
import { ArrayType, CompositeType, FunctionType, GenericInstance, GenericParameterName, ImportedTypeRef, IndexSignature, Interface, KeyofType, LiteralType, LocalTypeRef, MemberNameLiteral, MemberType, Modules, Properties, Property, TupleType, Type, TypeName } from "@typeonly/loader" | ||
import { ValidatorOptions } from "./api" | ||
@@ -3,0 +3,0 @@ import { makeErrorMessage, typeAsString } from "./error-message" |
@@ -1,2 +0,2 @@ | ||
import { readModules } from "@typeonly/reader" | ||
import { readModules } from "@typeonly/loader" | ||
import { createStandaloneRtoModule, parseTypeOnly } from "typeonly" | ||
@@ -3,0 +3,0 @@ import { createValidator, createValidatorFromModules } from "../src/api" |
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
+ Added@typeonly/loader@^0.5.0
+ Added@typeonly/loader@0.5.4(transitive)
- Removed@typeonly/reader@^0.4.0
- Removed@typeonly/reader@0.4.1(transitive)