
Security News
Socket Security Analysis Is Now One Click Away on npm
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.
@types/json-schema-faker
Advanced tools
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
Stub TypeScript definitions entry for json-schema-faker, which provides its own types definitions
The npm package @types/json-schema-faker receives a total of 5,378 weekly downloads. As such, @types/json-schema-faker popularity was classified as popular.
We found that @types/json-schema-faker demonstrated a healthy version release cadence and project activity because the last version was released less than 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
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.

Security News
A compromised npm publish token was used to push a malicious postinstall script in cline@2.3.0, affecting the popular AI coding agent CLI with 90k weekly downloads.

Product
Socket is now scanning AI agent skills across multiple languages and ecosystems, detecting malicious behavior before developers install, starting with skills.sh's 60,000+ skills.