Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

obj-type

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

obj-type - npm Package Compare versions

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();
};

15

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc