mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-08 18:34:06 +08:00
25 lines
486 B
TypeScript
25 lines
486 B
TypeScript
/// <reference path="is-plain-object.d.ts" />
|
|
|
|
import * as isPlainObject from 'is-plain-object';
|
|
|
|
isPlainObject(Object.create({}));
|
|
//=> true
|
|
isPlainObject(Object.create(Object.prototype));
|
|
//=> true
|
|
isPlainObject({foo: 'bar'});
|
|
//=> true
|
|
isPlainObject({});
|
|
|
|
isPlainObject(1);
|
|
//=> false
|
|
isPlainObject(['foo', 'bar']);
|
|
//=> false
|
|
isPlainObject([]);
|
|
//=> false
|
|
class Foo {}
|
|
isPlainObject(new Foo);
|
|
//=> false
|
|
isPlainObject(null);
|
|
//=> false
|
|
isPlainObject(Object.create(null));
|
|
//=> false
|