@martendebruijn/types
Personal common used types, type guards and other to quickly jumpstart a new project or experiment.
Get started
npm install @martendebruijn/types
Usage
Type guards
-
isDefined(x)
- Is x defined? -
isString(x)
- Is x a string? -
isNumber(x)
- Is x a number? -
isBigInt(x)
- Is x a bigint? -
isBool(x)
- Is x a boolean? -
isSymbol(x)
- Is x a symbol? -
isNull(x)
- Is x null? -
isArray(x)
- Is x an array? -
isObject(x)
- Is x an object?
Types
-
Tuple
- Tuple type -
JsonValue
- A valid JSON value -
JsonPatchOperations
- All possible JSON patch operations -
JsonPatch
- A valid JSON patch
Utility
-
generateError(error)
- Make sure an error is an actual error
Framework specific
Vue
-
PropsOf<VueComponent>
- Get the types of the properties of a Vue component
Releases
For a complete list of releases, please see the changelog.
Contributing
Please do contribute! See the contributing document for how to contribute.
Authors and acknowledgment
Inspired by the Types library made by Mike North and the TypeScript courses he teaches.
- @martendebruijn - Owner
For a full list of contributors, please see the contributors list.
License
MIT license
Copyright (c) 2023 Marten de Bruijn