if (typeof key === 'function') {
value = key(item)
} else if (item == null) {
value = null
} else if (Object.hasOwn(item, key)) {
value = (item as IndexableByString)[key]
} else if (key.includes('.')) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
return getNestedValues<ItemType>(key, item)
} else {
value = null
}
What you did: Used matchSorter in my project and tested it in Safari 13.1
What happened: TypeError: Object.hasOwn is not a function
Problem description:
For our music industry specific project we have to support Safari 13.1 for a little longer as a lot of music producers are stuck at older macOS versions. match-sorter relies on the Object.hasOwn function that is not available in an older browser like Safari 13.
Suggested solution:
Switch back to using the previous hasOwnProperty setup.
I understand using this newer API simplifies the code, but it does introduce a need for us to add polyfills for older browsers or consider our usage of match-sorter. In this case specifically the change is so small I wanted to raise an issue as I totally get you have to draw the line somewhere regarding browser support. Just wanted to make sure the change was intentional as I didn't see any reference of a breaking change in the commit history or release log and it seems to have been introduced in an unrelated update #148
match-sorter
version: 6.3.3node
version: 20.4.0Relevant code or config
What you did: Used matchSorter in my project and tested it in Safari 13.1 What happened:
TypeError: Object.hasOwn is not a function
Problem description: For our music industry specific project we have to support Safari 13.1 for a little longer as a lot of music producers are stuck at older macOS versions.
match-sorter
relies on theObject.hasOwn
function that is not available in an older browser like Safari 13.Suggested solution: Switch back to using the previous
hasOwnProperty
setup.I understand using this newer API simplifies the code, but it does introduce a need for us to add polyfills for older browsers or consider our usage of match-sorter. In this case specifically the change is so small I wanted to raise an issue as I totally get you have to draw the line somewhere regarding browser support. Just wanted to make sure the change was intentional as I didn't see any reference of a breaking change in the commit history or release log and it seems to have been introduced in an unrelated update #148