-
noop(): void
- A no-operation function that does nothing -
ignorePromise(promise: Promise<any>): void
- Helps to suppress unhandled promise rejections -
chunk<T>(array: T[], size: number): T[][]
- Splits array into chunks of the specified size -
isObjectEmpty(obj: object): boolean
- Checks if the given object is empty (contains no own properties) -
wait(ms: number): Promise<void>
- Returns a promise that resolves after the specified amount of time in milliseconds -
getValidatedJSON(json: string|Jsonifiable, schema: ZodSchema)
- Parses and validates a JSON string or an object against a specified Zod schema. Returns error as a third member of a returned tuple
jsn-utils
1.0.3 • Public • Published Package Sidebar
Install
npm i jsn-utils
Repository
Weekly Downloads
8
Version
1.0.3
License
MIT
Unpacked Size
13.6 kB
Total Files
26