7.18.0 • Published 6 months ago

typechecker v7.18.0

Weekly downloads
457,259
License
MIT
Repository
github
Last release
6 months ago

Utilities to get and check variable types (isString, isPlainObject, isRegExp, etc)

Why?

Why should I use this instead of say instanceof?

Under certain circumstances instanceof may not return the correct results. This occurs with node's vm module especially, and circumstances where an object's prototype has been dereferenced from the original. As such, for basic == and === checks (like a === null), you're fine not using this, but for checks when you would have done instanceof (like err instanceof Error), you should try to use this instead. Plus things like isPlainObject are darn useful!

Usage

Complete API Documentation.

npm

Skypack

<script type="module">
    import * as pkg from '//cdn.skypack.dev/typechecker@^7.18.0'
</script>

unpkg

<script type="module">
    import * as pkg from '//unpkg.com/typechecker@^7.18.0'
</script>

jspm

<script type="module">
    import * as pkg from '//dev.jspm.io/typechecker@7.18.0'
</script>

Discover the release history by heading on over to the HISTORY.md file.

Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

These amazing people are maintaining this project:

No sponsors yet! Will you be the first?

These amazing people have contributed code to this project:

Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

Unless stated otherwise all works are:

and licensed under:

arrayassertassertionasyncasync functionasync-functionasyncFunctionboolbooleanbrowsercheckcheck-typecheckingclassclass-identifierclass-instancecompareconventional classconventional-classconventionalClassdatedefine-typeemptyempty arrayempty keysempty mapempty plain objectempty-arrayempty-keysempty-mapempty-plain-objectemptyArrayemptyKeysemptyMapemptyPlainObjecterrores2019functionget object typeget typeget-object-typeget-typegetObjectTypegetTypeinstanceofisis argumentsis arrayis asyncis async functionis boolis booleanis classis conventional classis dateis empty arrayis empty keysis empty mapis empty plain objectis empty weak mapis erroris functionis mapis native classis nullis nullishis numberis objectis plain objectis regexpis stringis syncis sync functionis undefinedis weak mapis-argumentsis-arrayis-asyncis-async-functionis-boolis-booleanis-classis-conventional-classis-dateis-empty-arrayis-empty-keysis-empty-mapis-empty-plain-objectis-empty-weak-mapis-erroris-functionis-mapis-native-classis-nullis-nullishis-numberis-objectis-plain-objis-plain-objectis-regexpis-stringis-syncis-sync-functionis-undefinedis-weak-mapisArgumentsisArrayisAsyncFunctionisBoolisBooleanisClassisConventionalClassisDateisEmptyArrayisEmptyKeysisEmptyMapisEmptyPlainObjectisEmptyWeakMapisErrorisFunctionisMapisNativeClassisNullisNullishisNumberisObjectisRegExpisStringisSyncisSyncFunctionisUndefinedisWeakMapjavascriptjavascript-typekeyskindmapmodulenativenative classnative-classnativeClassnodenullnumberobjectplainplain objectplain objectsplain-objectplain-objectsplainObjectprimitiveprimitive-typespureregexregexpregular expressionsimplestringsyncsyncFunctiontesttypetype-checktype-checkertype-checkingtypecheckertypedtypeguardstypeoftypestypescriptundefinedutilutilityvalidatevalidationvanillaverifyweak mapweak-mapweakMapwhat-type
7.18.0

6 months ago

7.17.0

1 year ago

7.16.0

1 year ago

7.15.0

1 year ago

7.14.0

1 year ago

7.13.0

1 year ago

7.12.0

2 years ago

7.11.0

2 years ago

7.10.0

2 years ago

7.9.0

2 years ago

7.8.0

2 years ago

7.7.0

2 years ago

7.6.0

2 years ago

7.5.0

2 years ago

7.3.0

2 years ago

7.4.0

2 years ago

7.2.0

2 years ago

7.1.0

2 years ago

7.0.0

2 years ago

6.4.0

2 years ago

6.3.0

2 years ago

6.2.0

2 years ago

6.1.0

2 years ago

6.0.0

2 years ago

5.2.0

2 years ago

5.1.0

2 years ago

5.0.0

2 years ago

4.11.0

2 years ago

4.10.0

2 years ago

4.9.0

2 years ago

4.8.0

2 years ago

4.7.0

3 years ago

4.6.0

3 years ago

4.5.0

4 years ago

4.4.1

5 years ago

4.4.0

5 years ago

4.3.0

6 years ago

4.2.1

6 years ago

4.2.0

6 years ago

4.1.0

6 years ago

4.0.1

6 years ago

4.0.0

6 years ago

3.0.0

6 years ago

2.1.0

6 years ago

2.0.8

8 years ago

2.0.7

8 years ago

2.0.6

8 years ago

2.0.5

8 years ago

2.0.4

8 years ago

2.0.3

8 years ago

2.0.2

8 years ago

2.0.1

9 years ago

2.0.0

9 years ago