šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

@types/json-schema-faker

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

@types/json-schema-faker

TypeScript definitions for json-schema-faker

0.5.4
ts4.5
ts4.6
ts4.7
ts4.8
ts4.9
ts5.0
ts5.1
ts5.2
ts5.3
ts5.4
ts5.5
ts5.6
ts5.7
ts5.8
ts5.9
latest
Source
npm
Version published
Weekly downloads
5.1K
2.51%
Maintainers
1
Weekly downloads
Ā 
Created
Source

Installation

npm install --save @types/json-schema-faker

Summary

This package contains type definitions for json-schema-faker (https://github.com/json-schema-faker/json-schema-faker).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/json-schema-faker.

index.d.ts

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;

Additional Details

  • Last updated: Tue, 07 Nov 2023 03:09:37 GMT
  • Dependencies: @types/json-schema

Credits

These definitions were written by Charles Desbiens.

FAQs

Package last updated on 07 Nov 2023

Did you know?

Socket

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.

Install

Related posts