Shared useful utils and types
npm install @rnw-community/sharedGeneric types, type guards and utilities commonly used across packages.


Convenient typescript type guards for
everyday usage.
> This type guards makes your code more explicit, readable and type-safe, both in runtime and typescript.
This package provides a set of convenient type guards for everyday usage with the following types:
- Generic:
- isObject
- isDefined
- isError
- isPromise
- Array:
- isArray
- isEmptyArray
- isNotEmptyArray
- String:
- isString
- isEmptyString
- isNotEmptyString
- Number:
- isNumber
- isPositiveNumber
Utility functions that helps with everyday tasks:
- getErrorMessage - Get typesafe Error object message.
- emptyFn - Useful default react prop callback value.
- cs - Conditional styling util.
- getDefined - Get fallback value if passed variable is not defined.
- getDefinedAsync - Get async fallback value if passed variable is not
defined.
Commonly used typescript types:
- ClassType
- Maybe
- OnEventFn
- EmptyFn
- Enum
- IsNotEmptyArray
This library is licensed under The MIT License.