_prepResources()
and ResourceNamespace
iterate all properties, but don't check hasOwnProperty
#2114
Labels
_prepResources()
and ResourceNamespace
iterate all properties, but don't check hasOwnProperty
#2114
Describe the bug
Hi there, when including the scope-extensions-js package in my project, Stripe errors out with the following on startup:
This is a
ts-node
project, but not sure if that's important.The issues appears to be these couple loops, which iterate
resources
, but pick up unexpected things on the prototype chain:I believe that we want an
Object.hasOwnProperty()
check inside those loops, to avoid this issue.Here is a patch file (using
patch-package
) that fixes the issue for me:To Reproduce
Use the following
package.json
:And
index.ts
:Run
yarn && yarn start
(or the npm equivalent). See error.Expected behavior
Project should startup without error.
Code snippets
No response
OS
MacOS Sonoma 14.5
Node version
v20.12.1
Library version
v15.12.0
API version
2024-04-10
Additional context
No response
The text was updated successfully, but these errors were encountered: