@web3r/flowerkit
Version:
Tree-shakable JavaScript and TypeScript utility library for frontend/browser apps: DOM, events, arrays, objects, strings, date, JSON, and network helpers (ESM/CJS, SSR-friendly).
14 lines (13 loc) • 439 B
text/typescript
export type TIsJSONArgs = Parameters<typeof isJSON>;
export type TIsJSONReturn = ReturnType<typeof isJSON>;
/**
* Checks if a string is a valid JSON string
* @param {string} str source String
* @returns {boolean}
* @example
* // How to check if string is a JSON?
* const str = '{ "hello": "world" }';
* const isStrJSON = isJSON(str);
* console.log(isStrJSON); // => true
*/
export declare const isJSON: (str: unknown) => boolean;