assert-is-object-x
If IsObject(value) is false, throw a TypeError exception.
Last updated 9 years ago by xotic750 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install assert-is-object-x 
SYNC missed versions from official npm registry.

Travis status Dependency status devDependency status npm version jsDelivr hits bettercodehub score Coverage Status

assert-is-object-x

If IsObject(value) is false, throw a TypeError exception.

module.exports(value)*

Tests value to see if it is an object, throws a TypeError if it is not. Otherwise returns the value.

Kind: Exported function
Returns: * - Returns value if it is an object.
Throws:

  • TypeError Throws if value is not an object.
Param Type Description
value * The argument to be tested.
[message] string Optional alternative message.

Example

import assertIsObject from 'assert-is-object-x';

const primitive = true;
const mySymbol = Symbol('mySymbol');
const symObj = Object(mySymbol);
const object = {};
const fn = function fn() {};

assertIsObject(primitive); // TypeError 'true is not an object'
assertIsObject(mySymbol); // TypeError 'Symbol(mySymbol) is not an object'
assertIsObject(symObj); // Returns symObj.
assertIsObject(object); // Returns object.
assertIsObject(fn); // Returns fn.

Current Tags

  • 3.1.2                                ...           latest (5 years ago)

42 Versions

  • 3.1.2                                ...           5 years ago
  • 3.1.1                                ...           5 years ago
  • 3.1.0                                ...           5 years ago
  • 3.0.18                                ...           5 years ago
  • 3.0.17                                ...           5 years ago
  • 3.0.16                                ...           5 years ago
  • 3.0.15                                ...           5 years ago
  • 3.0.14                                ...           5 years ago
  • 3.0.13                                ...           5 years ago
  • 3.0.11                                ...           5 years ago
  • 3.0.10                                ...           5 years ago
  • 3.0.9                                ...           5 years ago
  • 3.0.8                                ...           5 years ago
  • 3.0.7                                ...           5 years ago
  • 3.0.6                                ...           5 years ago
  • 3.0.5                                ...           5 years ago
  • 3.0.4                                ...           5 years ago
  • 3.0.3                                ...           5 years ago
  • 3.0.2                                ...           5 years ago
  • 3.0.1                                ...           5 years ago
  • 3.0.0                                ...           5 years ago
  • 2.1.0                                ...           7 years ago
  • 2.0.1                                ...           7 years ago
  • 2.0.0                                ...           7 years ago
  • 1.3.0                                ...           7 years ago
  • 1.1.1                                ...           8 years ago
  • 1.1.0                                ...           8 years ago
  • 1.0.14                                ...           9 years ago
  • 1.0.13                                ...           9 years ago
  • 1.0.12                                ...           9 years ago
  • 1.0.11                                ...           9 years ago
  • 1.0.10                                ...           9 years ago
  • 1.0.9                                ...           9 years ago
  • 1.0.8                                ...           9 years ago
  • 1.0.7                                ...           9 years ago
  • 1.0.6                                ...           9 years ago
  • 1.0.5                                ...           9 years ago
  • 1.0.4                                ...           9 years ago
  • 1.0.3                                ...           9 years ago
  • 1.0.2                                ...           9 years ago
  • 1.0.1                                ...           9 years ago
  • 1.0.0                                ...           9 years ago
Maintainers (1)
Downloads
Total 1
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (6)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE