Socket
Socket
Sign inDemoInstall

@typeonly/validator

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@typeonly/validator - npm Package Compare versions

Comparing version 0.4.0 to 0.5.0

8

dist/api.js
"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"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc