JSPM

@stdlib/assert-is-plain-object-array

0.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 33
  • Score
    100M100P100Q77474F
  • License Apache-2.0

Test if a value is an array-like object containing only plain objects.

Package Exports

  • @stdlib/assert-is-plain-object-array

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@stdlib/assert-is-plain-object-array) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

isPlainObjectArray

NPM version Build Status Coverage Status dependencies

Test if a value is an array-like object containing only plain objects.

Installation

npm install @stdlib/assert-is-plain-object-array

Usage

var isPlainObjectArray = require( '@stdlib/assert-is-plain-object-array' );

isPlainObjectArray( value )

Tests if a value is an array-like object containing only plain objects.

var Number = require( '@stdlib/number-ctor' );

var bool = isPlainObjectArray( [ {}, { 'beep': 'boop' } ] );
// returns true

bool = isPlainObjectArray( [ {}, new Number(3.0) ] );
// returns false

bool = isPlainObjectArray( [ {}, '3.0' ] );
// returns false

bool = isPlainObjectArray( [] );
// returns false

bool = isPlainObjectArray( [ null, {} ] );
// returns false

Examples

var Number = require( '@stdlib/number-ctor' );
var isPlainObjectArray = require( '@stdlib/assert-is-plain-object-array' );

var bool = isPlainObjectArray( [ { 'beep': 'boop' }, {}, {} ] );
// returns true

bool = isPlainObjectArray( [ new Date(), new Number( 3 ) ] );
// returns false

bool = isPlainObjectArray( [ {}, new String( 'abc' ), {} ] );
// returns false

bool = isPlainObjectArray( [ [], {} ] );
// returns false

bool = isPlainObjectArray( [ 'a', 'b' ] );
// returns false

bool = isPlainObjectArray( [] );
// returns false

Notice

This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.

For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.


License

See LICENSE.

Copyright © 2016-2021. The Stdlib Authors.