better-type-of
Advanced tools
Comparing version 0.0.1 to 0.0.2
13
index.js
@@ -1,7 +0,8 @@ | ||
export const isCapital = (c) => /[A-Z]/.test(c) | ||
function isCapital(c) { return /[A-Z]/.test(c); } | ||
export const toLowerCase = (s) => { | ||
// handles strings with acronyms: 'HTMLDocument' => 'html document' | ||
function toLowerCase(s) { | ||
return s | ||
.split('') | ||
.map((c, i) => { | ||
.map(function(c, i) { | ||
if (!isCapital(c)) { | ||
@@ -21,4 +22,8 @@ return c; | ||
export default function typeOf(value) { | ||
module.exports = function typeOf(value) { | ||
return toLowerCase(Object.prototype.toString.call(value).slice(8, -1)); | ||
} | ||
module.exports.isCapital = isCapital; | ||
module.exports.toLowerCase = toLowerCase; |
{ | ||
"name": "better-type-of", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "A better type of", | ||
@@ -28,4 +28,3 @@ "keywords": [ | ||
"babel-preset-es2015-node6": "^0.2.0", | ||
"babel-preset-stage-0": "^6.5.0", | ||
"webpack": "^1.13.0" | ||
"babel-preset-stage-0": "^6.5.0" | ||
}, | ||
@@ -32,0 +31,0 @@ "ava": { |
4769
5
105