feat: add objectorarray to replacements - #1049
Conversation
|
the package checks if something is an object or an array, but this checks if its an object and not a RegExp. shouldn't this be |
The package does that https://main.npmx.dev/package-code/objectorarray/v/1.0.5/index.js |
|
Yeah, I guess it's just because it's old. |
|
I think like this const isPlainObjectOrArray = (val) => {
if (val === null || typeof val !== 'object') return false
return Array.isArray(val) || Object.getPrototypeOf(val) === Object.prototype
} |
|
it isn't actually checking that it is a plain object it seems. so it may be even simpler... |
|
I think we should keep the snippet as is then, even though the package name is wrong, that's what it does |
|
i think it is just poorly named and old, it should be checking if something is an object or an array. it is trying to do that by checking if it is a non-RegExp object, probably before but this seems as simple as |
|
The package is used in https://npmx.dev/package/endent made by the same person All downloads come from there |

🔗 Linked issue
Closes #1021
📚 Description
add
objectorarrayto replacements