1.0.7 • Published 3 years ago

is-string v1.0.7

Weekly downloads
10,646,284
License
MIT
Repository
github
Last release
3 years ago

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

es-abstractarray-includeses-get-iteratorarray.prototype.mapenzymewhich-boxed-primitivearchetype-libraryeasy-select-rnvuedragdropuploadimagesreact-native-bluetooth2killi8n-react-native-fast-image@masalamunch/strictify@masalamunch/promise-fs@icanpm/api-master@arisageha/react-lazyload@arisageha/react-lazyload-fixams-http-service@almeidaa/msreact-native-template-rfbaseairscanairscan-examplebb-chatreact-native-esc-pos-sahaab@borisovart/atol-kkt-module@phil8795/pecuniarius-apideneme323112@fundefund/funde_ck@ntt_app/react-native-custom-notificationreact-native-covid-sdkgql_din_modafryxiconsprecise-jsonmutasi-bca@jttechnic/interpreter@saeon/quick-formcthpb-plugin-socialbroken-link-checker-timeoutreact-native-printer-brothersreact-native-shekhar-bridge-testcogoportutils@leight-core/aiouncoded-connectwilscanner@khalitovadel/abstract-repository@oiti/documentoscopy-react-native@respondea/cordova-plugin-v-inappbrowserquoc-testreact-native-slider-kf@infinitebrahmanuniverse/nolb-is-s@saaspe/componentsnode-red-contrib-home-assistant-llatexpand-react-bridgeopea-bootstraapluminos-ui-coresklif-ui-kitsklif-api@everything-registry/sub-chunk-1935jawwy-sdkjawwy_gamification_release@deepakorg/test@deepak757/testreact-native-sphereuisphereuijawwy_libraryreact-native-credit-card-pkgp149-tablesklif-uimachinebeemrcapsreact-native-jawwy_sample@arielapaula/components@arielapaula/test@astro_z/nodejs-intership-lesson-1@aristidenf/streak-counterant-design-draggable-modal-4ant-design-draggable-modal-fixant-design-draggable-modal-fix-2angletearx12halowpoeaw@apardellass/react-native-audio-streamgulpdestgushio@aurelianoa/metadataupdatableappxgenapps-bogeg@anonybit-modules/videoreconstruction@axeptio/eslint-config-axeptioarray.prototype.concatarray.prototype.everyarray.prototype.filterarray.prototype.foreacharray.prototype.indexofarray.prototype.joinarray.prototype.lastindexofarray.prototype.reducearray.prototype.reducerightarray.prototype.slicearray.prototype.somearray.prototype.splicearray.prototype.unshift
1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

4 years ago

1.0.4

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago