File tree Expand file tree Collapse file tree 9 files changed +30
-21
lines changed
Expand file tree Collapse file tree 9 files changed +30
-21
lines changed Original file line number Diff line number Diff line change 2727TODO.md
2828package-lock.json
2929browser
30- index.cjs.js
31- index.es.js
30+ dist
Original file line number Diff line number Diff line change @@ -16,8 +16,14 @@ Use [isobject](https://github.com/jonschlinkert/isobject) if you only want to ch
1616
1717## Usage
1818
19+ with es modules
1920``` js
20- import isPlainObject from ' is-plain-object' ;
21+ import { isPlainObject } from ' is-plain-object' ;
22+ ```
23+
24+ or with commonjs
25+ ``` js
26+ const { isPlainObject } = require (' is-plain-object' );
2127```
2228
2329** true** when created by the ` Object ` constructor, or Object.create(null).
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ export function isPlainObject ( o : any ) : boolean ;
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ function isObject(o) {
99 return Object . prototype . toString . call ( o ) === '[object Object]' ;
1010}
1111
12- export default function isPlainObject ( o ) {
12+ export function isPlainObject ( o ) {
1313 var ctor , prot ;
1414
1515 if ( isObject ( o ) === false ) return false ;
Original file line number Diff line number Diff line change 1616 "url" : " https://github.com/jonschlinkert/is-plain-object/issues"
1717 },
1818 "license" : " MIT" ,
19- "main" : " index.cjs .js" ,
20- "module" : " index.es.js " ,
21- "types" : " index .d.ts" ,
19+ "main" : " dist/is-plain-object .js" ,
20+ "module" : " dist/is-plain-object.mjs " ,
21+ "types" : " is-plain-object .d.ts" ,
2222 "files" : [
23- " index.d.ts" ,
24- " index.es.js" ,
25- " index.cjs.js"
23+ " is-plain-object.d.ts" ,
24+ " dist"
2625 ],
26+ "exports" : {
27+ "." : {
28+ "import" : " ./dist/is-plain-object.mjs" ,
29+ "require" : " ./dist/is-plain-object.js"
30+ },
31+ "./package.json" : " ./package.json"
32+ },
2733 "engines" : {
2834 "node" : " >=0.10.0"
2935 },
Original file line number Diff line number Diff line change 11export default {
2- input : './index .js' ,
2+ input : './is-plain-object .js' ,
33 output : [
44 {
55 format : 'iife' ,
66 file : 'browser/is-plain-object.js' ,
7- name : 'isPlainObject' ,
8- exports : 'default'
7+ name : 'library' ,
98 } ,
109 {
1110 format : 'cjs' ,
12- file : 'index.cjs.js' ,
13- exports : 'default'
11+ file : 'dist/is-plain-object.js' ,
1412 } ,
1513 {
16- format : 'es ' ,
17- file : 'index.es.js '
14+ format : 'esm ' ,
15+ file : 'dist/is-plain-object.mjs '
1816 }
1917 ]
2018}
Original file line number Diff line number Diff line change 1212< div id ="mocha "> </ div >
1313< script >
1414
15+ const { isPlainObject } = library ;
16+
1517var expect = chai . expect ;
1618var iframe , iframeWindow ;
1719var testArea = document . getElementById ( 'mocha' ) ;
Original file line number Diff line number Diff line change 66 */
77
88import assert from 'assert' ;
9- import isPlainObject from '../index .js' ;
9+ import { isPlainObject } from '../is-plain-object .js' ;
1010
1111describe ( 'Same-Realm Server Tests' , function ( ) {
1212 it ( 'should return `true` if the object is created by the `Object` constructor.' , function ( ) {
You can’t perform that action at this time.
0 commit comments