diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2023-03-06 10:27:40 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2023-03-06 10:27:40 -0400 |
commit | da4eda535893f1a26b095e5890658099e89d9457 (patch) | |
tree | 33106463203e86fd8bbedb2ac820adde99c9c47e /src/util/sugar.js | |
parent | 54509b203a2119fa66c09bef6da4a2fccf8219e8 (diff) |
data-steps: initial commit
Diffstat (limited to 'src/util/sugar.js')
-rw-r--r-- | src/util/sugar.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/util/sugar.js b/src/util/sugar.js index 0813c1d4..c60bddb6 100644 --- a/src/util/sugar.js +++ b/src/util/sugar.js @@ -150,6 +150,15 @@ export function bindOpts(fn, bind) { value: fn.name ? `(options-bound) ${fn.name}` : `(options-bound)`, }); + for (const [key, descriptor] of Object.entries(Object.getOwnPropertyDescriptors(fn))) { + if (key === 'length') continue; + if (key === 'name') continue; + if (key === 'arguments') continue; + if (key === 'caller') continue; + if (key === 'prototype') continue; + Object.defineProperty(bound, key, descriptor); + } + return bound; } |