Gathering detailed insights and metrics for is-primitive
Gathering detailed insights and metrics for is-primitive
Gathering detailed insights and metrics for is-primitive
Gathering detailed insights and metrics for is-primitive
npm install is-primitive
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
37 Stars
25 Commits
9 Forks
5 Watching
1 Branches
5 Contributors
Updated on 20 Aug 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-4.1%
805,259
Compared to previous day
Last week
5.3%
5,066,830
Compared to previous week
Last month
55.2%
17,566,035
Compared to previous month
Last year
2.1%
147,290,858
Compared to previous year
3
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 :heart: and support.
Install with npm:
1$ npm install --save is-primitive
The Mozilla docs for "Primitive values" defines specifies six data types that are primitives:
Boolean
Null
Undefined
Number
String
Symbol
(new in ECMAScript 6)1var isPrimitive = require('is-primitive');
All of the following return true
:
1console.log(isPrimitive(false));
2console.log(isPrimitive(true));
3console.log(isPrimitive(null));
4console.log(isPrimitive());
5console.log(isPrimitive(42));
6console.log(isPrimitive('abc'));
7console.log(isPrimitive(Symbol()));
8//=> true
Everything else returns false
:
1console.log(isPrimitive({})); 2console.log(isPrimitive([])); 3console.log(isPrimitive(function(){})); 4console.log(isPrimitive(new Date())); 5// et cetera... 6//=> false
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
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:
1$ npm install && npm test
(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:
1$ npm install -g verbose/verb#dev verb-generate-readme && verb
You might also be interested in these projects:
Object
constructor. | homepageCommits | Contributor |
---|---|
11 | jonschlinkert |
1 | ljharb |
1 | bttmly |
1 | hemanth |
Jon Schlinkert
Copyright © 2017, Jon Schlinkert. Released under the MIT License.
This file was generated by verb-generate-readme, v0.6.0, on November 23, 2017.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 3/25 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More