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.


Version published
Weekly downloads
2
decreased by-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

npm standard style build status coverage status deps status

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

Install

npm i --save abbrev-kindof
npm test

Usage

For more use-cases see the tests

var abbrevKindof = require('abbrev-kindof');

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.

Author

Charlike Mike Reagent

License MIT license

Copyright (c) 2015 Charlike Mike Reagent, contributors.
Released under the MIT license.


Proudly generated by docks(1), May 4, 2015

Keywords

FAQs

Package last updated on 04 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