Skip to content

Commit 8e4a1f3

Browse files
committed
removed dep on object-get
1 parent 07849ea commit 8e4a1f3

File tree

5 files changed

+252
-24
lines changed

5 files changed

+252
-24
lines changed

index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
'use strict'
21
const arrayify = require('array-back')
32
const t = require('typical')
4-
const objectGet = require('object-get')
53

64
/**
75
* Sort an array of objects by any property value, at any depth, in any custom order.
@@ -101,8 +99,8 @@ function sortByFunc (properties, customOrder) {
10199
let property = props.shift()
102100
return function sorter (a, b) {
103101
let result
104-
const x = objectGet(a, property)
105-
const y = objectGet(b, property)
102+
const x = a[property]
103+
const y = b[property]
106104

107105
if (customOrder && customOrder[property]) {
108106
result = customOrder[property].indexOf(x) - customOrder[property].indexOf(y)

0 commit comments

Comments
 (0)