objectorarray
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -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" | ||
} | ||
} |
40
test.js
@@ -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
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
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
0
9992
1
6
23
+ Addedtape@^4.8.0
+ Added@ljharb/resumer@0.0.1(transitive)
+ Added@ljharb/through@2.3.13(transitive)
+ Addedarray-buffer-byte-length@1.0.2(transitive)
+ Addedarraybuffer.prototype.slice@1.0.4(transitive)
+ Addedavailable-typed-arrays@1.0.7(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedcall-bind@1.0.8(transitive)
+ Addedcall-bind-apply-helpers@1.0.1(transitive)
+ Addedcall-bound@1.0.3(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addeddata-view-buffer@1.0.2(transitive)
+ Addeddata-view-byte-length@1.0.2(transitive)
+ Addeddata-view-byte-offset@1.0.1(transitive)
+ Addeddeep-equal@1.1.2(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addeddefine-properties@1.2.1(transitive)
+ Addeddefined@1.0.1(transitive)
+ Addeddotignore@0.1.2(transitive)
+ Addeddunder-proto@1.0.1(transitive)
+ Addedes-abstract@1.23.7(transitive)
+ Addedes-define-property@1.0.1(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedes-object-atoms@1.0.0(transitive)
+ Addedes-set-tostringtag@2.0.3(transitive)
+ Addedes-to-primitive@1.3.0(transitive)
+ Addedfor-each@0.3.3(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedfunction.prototype.name@1.1.8(transitive)
+ Addedfunctions-have-names@1.2.3(transitive)
+ Addedget-intrinsic@1.2.6(transitive)
+ Addedget-symbol-description@1.1.0(transitive)
+ Addedglob@7.2.3(transitive)
+ Addedglobalthis@1.0.4(transitive)
+ Addedgopd@1.2.0(transitive)
+ Addedhas@1.0.4(transitive)
+ Addedhas-bigints@1.1.0(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-proto@1.2.0(transitive)
+ Addedhas-symbols@1.1.0(transitive)
+ Addedhas-tostringtag@1.0.2(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedinternal-slot@1.1.0(transitive)
+ Addedis-arguments@1.2.0(transitive)
+ Addedis-array-buffer@3.0.5(transitive)
+ Addedis-async-function@2.0.0(transitive)
+ Addedis-bigint@1.1.0(transitive)
+ Addedis-boolean-object@1.2.1(transitive)
+ Addedis-callable@1.2.7(transitive)
+ Addedis-core-module@2.16.0(transitive)
+ Addedis-data-view@1.0.2(transitive)
+ Addedis-date-object@1.1.0(transitive)
+ Addedis-finalizationregistry@1.1.1(transitive)
+ Addedis-generator-function@1.0.10(transitive)
+ Addedis-map@2.0.3(transitive)
+ Addedis-number-object@1.1.1(transitive)
+ Addedis-regex@1.1.41.2.1(transitive)
+ Addedis-set@2.0.3(transitive)
+ Addedis-shared-array-buffer@1.0.4(transitive)
+ Addedis-string@1.1.1(transitive)
+ Addedis-symbol@1.1.1(transitive)
+ Addedis-typed-array@1.1.15(transitive)
+ Addedis-weakmap@2.0.2(transitive)
+ Addedis-weakref@1.1.0(transitive)
+ Addedis-weakset@2.0.4(transitive)
+ Addedisarray@2.0.5(transitive)
+ Addedmath-intrinsics@1.1.0(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedmock-property@1.0.3(transitive)
+ Addedobject-inspect@1.12.31.13.3(transitive)
+ Addedobject-is@1.1.6(transitive)
+ Addedobject-keys@1.1.1(transitive)
+ Addedobject.assign@4.1.7(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedpath-parse@1.0.7(transitive)
+ Addedpossible-typed-array-names@1.0.0(transitive)
+ Addedreflect.getprototypeof@1.0.9(transitive)
+ Addedregexp.prototype.flags@1.5.3(transitive)
+ Addedresolve@1.22.10(transitive)
+ Addedsafe-array-concat@1.1.3(transitive)
+ Addedsafe-regex-test@1.1.0(transitive)
+ Addedset-function-length@1.2.2(transitive)
+ Addedset-function-name@2.0.2(transitive)
+ Addedside-channel@1.1.0(transitive)
+ Addedside-channel-list@1.0.0(transitive)
+ Addedside-channel-map@1.0.1(transitive)
+ Addedside-channel-weakmap@1.0.2(transitive)
+ Addedstring.prototype.trim@1.2.10(transitive)
+ Addedstring.prototype.trimend@1.0.9(transitive)
+ Addedstring.prototype.trimstart@1.0.8(transitive)
+ Addedsupports-preserve-symlinks-flag@1.0.0(transitive)
+ Addedtape@4.17.0(transitive)
+ Addedtyped-array-buffer@1.0.3(transitive)
+ Addedtyped-array-byte-length@1.0.3(transitive)
+ Addedtyped-array-byte-offset@1.0.4(transitive)
+ Addedtyped-array-length@1.0.7(transitive)
+ Addedunbox-primitive@1.1.0(transitive)
+ Addedwhich-boxed-primitive@1.1.1(transitive)
+ Addedwhich-builtin-type@1.2.1(transitive)
+ Addedwhich-collection@1.0.2(transitive)
+ Addedwhich-typed-array@1.1.18(transitive)
+ Addedwrappy@1.0.2(transitive)