@types/json-mask
TypeScript icon, indicating that this package has built-in type declarations

2.0.3 • Public • Published

Installation

npm install --save @types/json-mask

Summary

This package contains type definitions for json-mask (https://github.com/nemtsov/json-mask#readme).

Details

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

index.d.ts

type DeepPartial<T> = T extends any[] ? Array<T[number]>
    : T extends Record<string, any> ? {
            [P in keyof T]?: DeepPartial<T[P]>;
        }
    : T;

interface Prop {
    type: "array" | "object" | undefined;
    isWildcard: true | undefined;
    properties: Props;
}

interface Props {
    [value: string]: Prop;
}

type Mask = (<T>(obj: T, mask: string | undefined | null) => DeepPartial<T> | null) & {
    compile: (text: string | undefined | null) => Props | null;
    filter: <T>(obj: T, compiledMask: Props | undefined | null) => DeepPartial<T> | null;
};

declare const mask: Mask;

export = mask;

Additional Details

  • Last updated: Tue, 07 Nov 2023 03:09:37 GMT
  • Dependencies: none

Credits

These definitions were written by Simon Dean.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/json-mask

Weekly Downloads

5,007

Version

2.0.3

License

MIT

Unpacked Size

3.78 kB

Total Files

5

Last publish

Collaborators

  • types