Socket
Socket
Sign inDemoInstall

abbrev-kindof

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

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
2
decreased by-33.33%
Maintainers
1
Weekly downloads
 
Created
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.

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, pleas that read the CONTRIBUTING.md guidelines.

Charlike Make Reagent new message to charlike freenode #charlike

tunnckocore.tk keybase tunnckocore tunnckoCore npm tunnckoCore twitter tunnckoCore github

Keywords

FAQs

Package last updated on 11 May 2015

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc