Socket
Socket
Sign inDemoInstall

abbrev-kindof

Package Overview
Dependencies
2
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    abbrev-kindof

`kind-of` with single letter abbreviations to javascript native types, like `kindof(val, 'soa')` will return true if `val` is string, object or array. useful for DB/Schema/Object validations


Version published
Weekly downloads
1
Maintainers
1
Install size
25.8 kB
Created
Weekly downloads
 

Changelog

Source

1.0.2 - 2015-05-10

  • Release v1.0.2 / npm@v1.0.2
  • fix package.json
  • update repo template

Readme

Source

abbrev-kindof npmjs.com The MIT License

kind-of with single letter abbreviations to javascript native types, like kindof(val, 'soa') will return true if val is string, object or array. useful for DB/Schema/Object validations

code climate standard code style travis build status coverage status dependency status

Install

npm i abbrev-kindof --save
npm test

Usage

For more use-cases see the tests


abbrevKindof(123, 'soa');
//=> false

abbrevKindof(['foo', 'bar'], 'soa');
//=> true

abbrevKindof('foo bar', 'soa');
//=> true

abbrevKindof({foo: 'bar'}, 'soa');
//=> true

Possible abbreviations

  • a for array
  • b for boolean
  • f for function
  • n for number
  • o for object
  • r for regexp
  • s for string
  • y for symbol
  • assert-kindof: Check native type of the given value and throw TypeError if not okey. Expressive, elegant, behavior-driven API, good descriptive default error messages, simple and clean syntax.
  • is-kindof: Thin wrapper around kind-of and in bonus functional api.
  • kind-of: Get the native type of a value.
  • map-types: Map single letter abbreviations to javascript native types. Useful as a shorthand for pseudo-argument destructuring when debugging.

Charlike Make Reagent new message to charlike freenode #charlike

tunnckocore.tk keybase tunnckocore tunnckoCore npm tunnckoCore twitter tunnckoCore github

Keywords

FAQs

Last updated on 11 May 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc