-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Code:
const sort = require('deep-sort');
const emptyStringTestArray = [
{ title: 'b' },
{ title: '' },
{ title: 'a' }
]
const nullTestArray = [
{ title: 'b' },
{ title: null },
{ title: 'a' }
]
console.log(sort(emptyStringTestArray, 'title'))
console.log(sort(nullTestArray, 'title'))Output:
[
{ title: '' },
{ title: 'a' },
{ title: 'b' }
]
[
{ title: 'b' },
{ title: null },
{ title: 'a' }
]Expected output:
[
{ title: 'a' },
{ title: 'b' },
{ title: '' }
]
[
{ title: 'a' },
{ title: 'b' },
{ title: null }
]Since it's sorting by string alphabetically, I'd expect to see empty string or null values at the end of the array.
Metadata
Metadata
Assignees
Labels
No labels