
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
@types/json-schema-faker
Advanced tools
TypeScript definitions for json-schema-faker
npm install --save @types/json-schema-faker
This package contains type definitions for json-schema-faker (https://github.com/json-schema-faker/json-schema-faker).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/json-schema-faker.
import { JSONSchema4, JSONSchema6, JSONSchema7 } from "json-schema";
declare namespace jsf {
const version: string;
function format(nameOrFormatMap?: NameOrFormatMap, callback?: (schema?: Schema) => void): any;
function extend(name: string, cb: () => void): any;
function define(name: string, cb: () => void): any;
function reset(name: string): any;
function locate(name: string): any;
function generate(schema: Schema, refs?: string | Schema[]): any;
function resolve(schema: Schema, refs?: string | Schema[], cwd?: string): Promise<any[]>;
function option(option: string | OptionInputObject, value?: any): any;
// jsf.random
namespace random {
function randexp(value: string): string | number;
function pick<T>(collection: T[]): T;
function date(step: string): Date;
function shuffle<T>(collection: T[]): T[];
function number(min?: number, max?: number, defMin?: number, defMax?: number, hasPrecision?: boolean): number;
}
type Schema = JSONSchema4 | JSONSchema6 | JSONSchema7;
type OptionInputObject = Partial<
{
[option in jsfOptions]: any;
}
>;
type NameOrFormatMap = string | { name: string; callback: (schema?: Schema) => void };
// List of all valid registerable options.
type jsfOptions =
| "defaultInvalidTypeProduct"
| "defaultRandExpMax"
| "ignoreProperties"
| "ignoreMissingRefs"
| "failOnInvalidTypes"
| "failOnInvalidFormat"
| "alwaysFakeOptionals"
| "optionalsProbability"
| "fixedProbabilities"
| "useExamplesValue"
| "useDefaultValue"
| "requiredOnly"
| "minItems"
| "maxItems"
| "minLength"
| "maxLength"
| "refDepthMin"
| "refDepthMax"
| "resolveJsonPath"
| "reuseProperties"
| "fillProperties"
| "random"
| "replaceEmptyByRandomValue";
}
/** @deprecated calling JsonSchemaFaker() is deprecated, call either .generate() or .resolve()' */
declare function jsf(schema: jsf.Schema, refs?: string | jsf.Schema[]): any;
export as namespace jsf;
export = jsf;
These definitions were written by Charles Desbiens.
FAQs
TypeScript definitions for json-schema-faker
We found that @types/json-schema-faker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.