Big news!Introducing Socket AI - ChatGPT-Powered Threat Analysis.Learn more
Socket
Socket

is-string

Package Overview
Dependencies
1
Maintainers
1
Versions
7
Issues
File Explorer

Advanced tools

is-string

Is this value a JS String object or primitive? This module works cross-realm/iframe, and despite ES6 @@toStringTag.

    1.0.7latest
    GitHub
    npm

Version published
Maintainers
1
Weekly downloads
27,258,134
increased by7.12%

Weekly downloads

Changelog

Source

v1.0.7 - 2021-08-05

Commits

  • [Refactor] use has-tostringtag to behave correctly in the presence of symbol shams d973ffd
  • [Dev Deps] update auto-changelog, core-js, eslint, tape 4bfaabf

Readme

Source

is-string Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

Is this value a JS String object or primitive? This module works cross-realm/iframe, and despite ES6 @@toStringTag.

Example

var isString = require('is-string'); var assert = require('assert'); assert.notOk(isString(undefined)); assert.notOk(isString(null)); assert.notOk(isString(false)); assert.notOk(isString(true)); assert.notOk(isString(function () {})); assert.notOk(isString([])); assert.notOk(isString({})); assert.notOk(isString(/a/g)); assert.notOk(isString(new RegExp('a', 'g'))); assert.notOk(isString(new Date())); assert.notOk(isString(42)); assert.notOk(isString(NaN)); assert.notOk(isString(Infinity)); assert.notOk(isString(new Number(42))); assert.ok(isString('foo')); assert.ok(isString(Object('foo')));

Tests

Simply clone the repo, npm install, and run npm test

Keywords

FAQs

Last updated on 06 Aug 2021

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket
Socket SOC 2 Logo

Product

  • Package Issues
  • 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