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.


Version published
Weekly downloads
2
increased by100%
Maintainers
1
Created
Weekly downloads
 

Changelog

Source

1.0.0 - 2015-05-03

  • Release v1.0.0 / npm@v1.0.0
  • update readme, add related
  • add example usage
  • run keywords(1)
  • rethink it

Readme

Source

npm mit license 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 2, 2015

Keywords

FAQs

Last updated on 03 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