Comparing version 0.0.0 to 1.0.0
10
index.js
'use strict'; | ||
module.exports = function (str, opts) { | ||
if (typeof str !== 'string') { | ||
throw new TypeError('Expected a string'); | ||
} | ||
opts = opts || {}; | ||
return str + ' & ' + (opts.postfix || 'rainbows'); | ||
module.exports = function (obj) { | ||
return Object.prototype.toString.call(obj).replace(/^\[object (.+)\]$/, "$1").toLowerCase(); | ||
}; |
{ | ||
"name": "obj-type", | ||
"version": "0.0.0", | ||
"description": "My perfect module", | ||
"version": "1.0.0", | ||
"description": "Returns any kind of object's type.", | ||
"license": "MIT", | ||
"repository": "gillstrom/obj-type", | ||
"author": { | ||
"name": "gillstrom", | ||
"email": "andreasgillstrom@gmail.com", | ||
"name": "Andreas Gillström", | ||
"url": "github.com/gillstrom" | ||
@@ -22,5 +22,10 @@ }, | ||
"keywords": [ | ||
"" | ||
"check", | ||
"is", | ||
"obj", | ||
"object", | ||
"test", | ||
"type", | ||
"typeof" | ||
], | ||
"dependencies": {}, | ||
"devDependencies": { | ||
@@ -27,0 +32,0 @@ "mocha": "*" |
# obj-type [![Build Status](https://travis-ci.org/gillstrom/obj-type.svg?branch=master)](https://travis-ci.org/gillstrom/obj-type) | ||
> My perfect module | ||
> Returns any kind of object's type. | ||
*Regexp, array, etc. are objects in JavaScript.* | ||
@@ -18,30 +20,21 @@ ## Install | ||
objType('unicorns'); | ||
//=> unicorns & rainbows | ||
``` | ||
objType({foo: 'bar'}); | ||
//=> 'object' | ||
objType(/foo/); | ||
//=> 'regexp' | ||
## API | ||
objType(['foo', 'bar']); | ||
//=> 'array' | ||
### objType(input, [options]) | ||
objType(new Date()); | ||
//=> 'date' | ||
#### input | ||
objType(null); | ||
//=> 'null' | ||
``` | ||
*Required* | ||
Type: `string` | ||
Lorem ipsum. | ||
#### options | ||
##### foo | ||
Type: `boolean` | ||
Default: `false` | ||
Lorem ipsum. | ||
## License | ||
MIT © [gillstrom](http://github.com/gillstrom) | ||
MIT © [Andreas Gillström](http://github.com/gillstrom) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
2404
1
4
40