mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
Merge pull request #11114 from zengfenfei/is-plain-object
Create typings for is-plain-object
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
/// <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
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
// Type definitions for is-plain-object
|
||||
// Project: https://github.com/jonschlinkert/is-plain-object
|
||||
// Definitions by: Kevin Zeng <https://github.com/zengfenfei/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module "is-plain-object" {
|
||||
namespace isPlainObject {}
|
||||
function isPlainObject(obj: any): boolean;
|
||||
export = isPlainObject;
|
||||
}
|
||||
Reference in New Issue
Block a user