All Projects → jonschlinkert → is-primitive

jonschlinkert / is-primitive

Licence: MIT license
Is the typeof value a javascript primitive?

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to is-primitive

DataTypes
Built-in data types
Stars: ✭ 34 (-2.86%)
Mutual labels:  string, number, symbol
is-symbol
Is this an ES6 Symbol value?
Stars: ✭ 16 (-54.29%)
Mutual labels:  is, symbol
rxjs-ninja
RxJS Operators for handling Observable strings, numbers, booleans and more
Stars: ✭ 68 (+94.29%)
Mutual labels:  string, number
prototyped.js
Some common Typescript prototypes
Stars: ✭ 22 (-37.14%)
Mutual labels:  string, number
checkif.js
Javascript check library
Stars: ✭ 30 (-14.29%)
Mutual labels:  is, check
common-words
Updated list of the 100 most common words in the English language. Useful for excluding these words from arrays.
Stars: ✭ 13 (-62.86%)
Mutual labels:  string, jonschlinkert
DigitText
The module allows to translate numbers into a text equivalent. This is important in the billing.
Stars: ✭ 22 (-37.14%)
Mutual labels:  string, number
Ssf
📝 Spreadsheet Number Formatter
Stars: ✭ 139 (+297.14%)
Mutual labels:  string, number
Number To Words
Number to string standalone PHP library with i18n. Drivers for numbers and currency included.
Stars: ✭ 234 (+568.57%)
Mutual labels:  string, number
pascalcase
Convert a string to pascal case (upper camel case). Used by more than 8.7 million projects on GitHub! Please follow this library's author: https://github.com/jonschlinkert
Stars: ✭ 35 (+0%)
Mutual labels:  string, jonschlinkert
es-feature-detection
ECMAScript feature and API detection
Stars: ✭ 16 (-54.29%)
Mutual labels:  check
Tau.jl
A Julia module providing the definition of the circle constant Tau (2π)
Stars: ✭ 33 (-5.71%)
Mutual labels:  number
textics
📉 JavaScript Text Statistics that counts lines, words, chars, and spaces.
Stars: ✭ 36 (+2.86%)
Mutual labels:  string
defaults-deep
Like `extend` but recursively copies only the missing properties/values to the target object.
Stars: ✭ 26 (-25.71%)
Mutual labels:  jonschlinkert
parse-git-config
Parse `.git/config` into a JavaScript object. sync or async.
Stars: ✭ 55 (+57.14%)
Mutual labels:  jonschlinkert
dobbi
An open-source NLP library: fast text cleaning and preprocessing
Stars: ✭ 21 (-40%)
Mutual labels:  string
TairString
A redis module, similar to redis string, but you can set expire and version for the value. It also provides many very useful commands, such as cas/cad, etc.
Stars: ✭ 99 (+182.86%)
Mutual labels:  string
parse-author
Parse a person, author, contributor or maintainer string into an object with name, email and url properties following NPM conventions. Useful for the `authors` property in package.json or for parsing an AUTHORS file into an array of person objects.
Stars: ✭ 23 (-34.29%)
Mutual labels:  string
snapdragon-lexer
Converts a string into an array of tokens, with useful methods for looking ahead and behind, capturing, matching, et cetera.
Stars: ✭ 19 (-45.71%)
Mutual labels:  jonschlinkert
rocPRIM
ROCm Parallel Primitives
Stars: ✭ 95 (+171.43%)
Mutual labels:  primitive

is-primitive NPM version NPM monthly downloads NPM total downloads Linux Build Status

Returns true if the value is a primitive.

Please consider following this project's author, Jon Schlinkert, and consider starring the project to show your ❤️ and support.

Install

Install with npm:

$ npm install --save is-primitive

Primitive values

The Mozilla docs for "Primitive values" defines specifies six data types that are primitives:

  • Boolean
  • Null
  • Undefined
  • Number
  • String
  • Symbol (new in ECMAScript 6)

Usage

var isPrimitive = require('is-primitive');

true

All of the following return true:

console.log(isPrimitive(false));
console.log(isPrimitive(true));
console.log(isPrimitive(null));
console.log(isPrimitive());
console.log(isPrimitive(42));
console.log(isPrimitive('abc'));
console.log(isPrimitive(Symbol()));
//=> true

false

Everything else returns false:

console.log(isPrimitive({}));
console.log(isPrimitive([]));
console.log(isPrimitive(function(){}));
console.log(isPrimitive(new Date()));
// et cetera...
//=> false

About

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Running Tests

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

$ npm install && npm test
Building docs

(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)

To generate the readme, run the following command:

$ npm install -g verbose/verb#dev verb-generate-readme && verb

Related projects

You might also be interested in these projects:

Contributors

Commits Contributor
11 jonschlinkert
1 ljharb
1 bttmly
1 hemanth

Author

Jon Schlinkert

License

Copyright © 2017, Jon Schlinkert. Released under the MIT License.


This file was generated by verb-generate-readme, v0.6.0, on November 23, 2017.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].