Skip to content

Commit c35e306

Browse files
authored
refactor: move isPlainObject to dependency (#159)
1 parent 3482fa2 commit c35e306

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

index.js

100644100755
+1-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const sortObjectKeys = require('sort-object-keys')
22
const detectIndent = require('detect-indent')
33
const detectNewline = require('detect-newline').graceful
44
const gitHooks = require('git-hooks-list')
5+
const isPlainObject = require('is-plain-obj')
56

67
const hasOwnProperty = (object, property) =>
78
Object.prototype.hasOwnProperty.call(object, property)
@@ -12,8 +13,6 @@ const onStringArray = fn => x =>
1213
const uniq = onStringArray(xs => xs.filter((x, i) => i === xs.indexOf(x)))
1314
const sortArray = onStringArray(array => [...array].sort())
1415
const uniqAndSortArray = pipe([uniq, sortArray])
15-
const isPlainObject = x =>
16-
x && Object.prototype.toString.call(x) === '[object Object]'
1716
const onObject = fn => x => (isPlainObject(x) ? fn(x) : x)
1817
const sortObjectBy = (comparator, deep) => {
1918
const over = onObject(object => {

package-lock.json

+11-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
"detect-newline": "3.1.0",
7676
"git-hooks-list": "1.0.2",
7777
"globby": "10.0.1",
78+
"is-plain-obj": "2.1.0",
7879
"sort-object-keys": "^1.1.3"
7980
},
8081
"devDependencies": {

0 commit comments

Comments
 (0)