is
is copied to clipboard
Type check values
https://reactjs.org/docs/jsx-in-depth.html#booleans-null-and-undefined-are-ignored Only certain types in React can be rendered. `false`, `null`, `undefined`, and `true` are valid React children. They don’t render. Here, I propose a new API and its use...
Hi and thanks for this library it is already really helpful for me. Unfortunately I’ve stumbled upon an issue for a browser-only project which uses `setTimeout()` and stored the result...
`is.assert.any`: https://runkit.com/szmarczak/5e53ec822c7e080014a4edf9 ``` TypeError: Expected value which is `predicate returns truthy for any value`, received value of type `Array`. ``` IMO it should return: ``` Expected value of type `boolean`...
What will this module export as a ESM? Will it still be a single default object like it is now or will it export `isUndefined` and the like? It could...
I don't know if this could be added to [`is`](https://github.com/sindresorhus/is), but it could be useful to infer typescript tuple type value. ```ts declare const value: unknown; if(isTuple(value, [is.number, is.string])) {...
[](https://issuehunt.io/r/sindresorhus/is/issues/81) It would be nice if this worked: ```ts const a = foo(); const b = bar(); // Both `a` and `b` is an `object`, but TS only knows they're...
I would like to propose a new function `is.propertyOf(object: unknown: key: string, predicate: Predicate): boolean` that accepts 3 values and checks: 1. wether the given object value is an object...
I'm so used to writing context-specific error messages that I wonder how others deal with this because custom messages don't seem to be supported in any of the functions. ```...
I would like to perform an assertion such as: ```ts import {assert} from '@sindresorhus/is'; assert.optionalString(foo); // `foo` is narrowed to `string | undefined` now ``` The call signature itself may...
```js const isSearchParams = is.create(URLSearchParams); is.any([is.string, isSearchParams]); ```