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

objectorarray

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

objectorarray - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

2

index.js

@@ -1,3 +0,3 @@

export default (val) => {
module.exports = (val) => {
return val != null && typeof val === 'object' && val.constructor !== RegExp
}
{
"name": "objectorarray",
"version": "1.0.2",
"version": "1.0.3",
"description": "Is the value an object or an array but not null?",
"main": "dist/index.js",
"scripts": {
"build": "babel index.js --out-file dist/index.js",
"test": "jest"
"test": "tape test.js"
},

@@ -26,7 +25,5 @@ "repository": {

"homepage": "https://github.com/ZhouHansen/objectnotnull#readme",
"devDependencies": {
"babel-cli": "^6.22.2",
"babel-preset-es2015": "^6.22.0",
"jest": "^21.2.1"
"dependencies": {
"tape": "^4.8.0"
}
}

@@ -1,25 +0,23 @@

import objectorarray from './'
var test = require('tape')
var objectorarray = require('./')
describe('objectorarray', () => {
it('Those should be true', () => {
expect(objectorarray({})).toBe(true)
expect(objectorarray([])).toBe(true)
expect(objectorarray(Object.create({}))).toBe(true)
expect(objectorarray(Object.create(Object.prototype))).toBe(true)
expect(objectorarray(Object.create(null))).toBe(true)
expect(objectorarray(new Foo)).toBe(true)
test('objectorarray', t => {
t.plan(12)
function Foo (bar) {
this.bar = bar
}
})
t.ok(objectorarray({}))
t.ok(objectorarray([]))
t.ok(objectorarray(Object.create({})))
t.ok(objectorarray(Object.create(Object.prototype)))
t.ok(objectorarray(Object.create(null)))
t.ok(objectorarray(new Foo))
function Foo (bar) {
this.bar = bar
}
it('Those should be false', () => {
expect(objectorarray()).toBe(false)
expect(objectorarray(function () {})).toBe(false)
expect(objectorarray(1)).toBe(false)
expect(objectorarray(/foo/)).toBe(false)
expect(objectorarray(null)).toBe(false)
expect(objectorarray(undefined)).toBe(false)
})
t.notOk(objectorarray())
t.notOk(objectorarray(function () {}))
t.notOk(objectorarray(1))
t.notOk(objectorarray(/foo/))
t.notOk(objectorarray(null))
t.notOk(objectorarray(undefined))
})

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