p5-analysis
Version:
API to find, create, and analyze p5.js sketch files.
13 lines (12 loc) • 605 B
TypeScript
/** Check whether a value is defined (non-nullable), meaning it is neither
* `null` or `undefined`.
*
* This function is copied from https://github.com/sindresorhus/ts-extras.
*
* It is here so that I don't have to debug why esbuild-jest produces an error
* (`SyntaxError: Unexpected token 'export'`) when it tries to compile a file
* that imports the ts-extras package. (Possibly something that could be fixed
* via `transformIgnorePatterns`, but the standard "node_modules/(?!(@etc."
* value did not fix this.)
*/
export declare function isDefined<T>(value: T | null | undefined): value is T;