package/package.json000644 001750 001750 0000003012 12317613730013016 0ustar00000000 000000 { "name": "x-is-string", "version": "0.1.0", "description": "Simple string test", "keywords": [], "author": "Matt-Esch ", "repository": "git://github.com/Matt-Esch/x-is-string.git", "main": "index", "homepage": "https://github.com/Matt-Esch/x-is-string", "contributors": [ { "name": "Matt-Esch" } ], "bugs": { "url": "https://github.com/Matt-Esch/x-is-string/issues", "email": "matt@mattesch.info" }, "dependencies": {}, "devDependencies": { "tape": "^2.12.2" }, "licenses": [ { "type": "MIT", "url": "http://github.com/Matt-Esch/x-is-string/raw/master/LICENSE" } ], "scripts": { "test": "node ./test/index.js", "start": "node ./index.js", "watch": "nodemon -w ./index.js index.js", "travis-test": "istanbul cover ./test/index.js && ((cat coverage/lcov.info | coveralls) || exit 0)", "cover": "istanbul cover --report none --print detail ./test/index.js", "view-cover": "istanbul report html && google-chrome ./coverage/index.html", "test-browser": "testem-browser ./test/browser/index.js", "testem": "testem-both -b=./test/browser/index.js" }, "testling": { "files": "test/index.js", "browsers": [ "ie/8..latest", "firefox/16..latest", "firefox/nightly", "chrome/22..latest", "chrome/canary", "opera/12..latest", "opera/next", "safari/5.1..latest", "ipad/6.0..latest", "iphone/6.0..latest", "android-browser/4.2..latest" ] } } package/.npmignore000644 001750 001750 0000000235 12317561355012540 0ustar00000000 000000 .DS_Store .monitor .*.swp .nodemonignore releases *.log *.err fleet.json public/browserify bin/*.json .bin build compile .lock-wscript coverage node_modules package/README.md000644 001750 001750 0000000712 12317616013012010 0ustar00000000 000000 # x-is-string Simple string test ## Example ```js var isString = require("x-is-string") isString("hello") // -> true isString("") // -> true isString(new String("things")) // -> true isString(1) // -> false isString(true) // -> false isString(new Date()) // -> false isString({}) // -> false isString(null) // -> false isString(undefined) // -> false ``` ## Installation `npm install x-is-string` ## Contributors - Matt-Esch ## MIT Licencedpackage/LICENCE000644 001750 001750 0000002036 12317561355011527 0ustar00000000 000000 Copyright (c) 2014 Matt-Esch. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. package/index.js000644 001750 001750 0000000224 12317561450012200 0ustar00000000 000000 var toString = Object.prototype.toString module.exports = isString function isString(obj) { return toString.call(obj) === "[object String]" } package/.travis.yml000644 001750 001750 0000000212 12317561355012645 0ustar00000000 000000 language: node_js node_js: - 0.8 - "0.10" before_script: - npm install - npm install istanbul coveralls script: npm run travis-test package/test/index.js000644 001750 001750 0000002225 12317615007013160 0ustar00000000 000000 var test = require("tape") var isString = require("../index") test("isString is a function", function (assert) { assert.equal(typeof isString, "function") assert.end() }) test("string literal is truthy", function (assert) { assert.equal(isString("hello"), true) assert.end() }) test("empty string is truthy", function (assert) { assert.equal(isString(""), true) assert.end() }) test("string object is truthy", function (assert) { assert.equal(isString(new String("hello")), true) assert.end() }) test("number is falsey", function (assert) { assert.equal(isString(9), false) assert.end() }) test("boolean is falsey", function (assert) { assert.equal(isString(true), false) assert.end() }) test("date is falsey", function (assert) { assert.equal(isString(new Date()), false) assert.end() }) test("object is falsey", function (assert) { assert.equal(isString({}), false) assert.end() }) test("null is falsey", function (assert) { assert.equal(isString(null), false) assert.end() }) test("undefined is falsey", function (assert) { assert.equal(isString(undefined), false) assert.end() })