Skip to content

Commit

Permalink
Refine assignHidden
Browse files Browse the repository at this point in the history
  • Loading branch information
MatAtBread committed Jun 26, 2024
1 parent 08c2220 commit 07b7294
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 54 deletions.
11 changes: 5 additions & 6 deletions module/dist/ai-ui.cjs

Large diffs are not rendered by default.

11 changes: 5 additions & 6 deletions module/dist/ai-ui.js

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions module/dist/ai-ui.min.cjs

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions module/dist/ai-ui.min.js

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions module/dist/ai-ui.min.mjs

Large diffs are not rendered by default.

11 changes: 5 additions & 6 deletions module/dist/ai-ui.mjs

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions module/esm/iterators.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,10 @@ const asyncExtras = {
};
const extraKeys = [...Object.getOwnPropertySymbols(asyncExtras), ...Object.keys(asyncExtras)];
// Like Object.assign, but the assigned properties are not enumerable
function assignHidden(d, ...srcs) {
for (const s of srcs) {
for (const [k, pd] of Object.entries(Object.getOwnPropertyDescriptors(s))) {
Object.defineProperty(d, k, { ...pd, enumerable: false });
}
function assignHidden(d, s) {
const keys = [...Object.getOwnPropertyNames(s), ...Object.getOwnPropertySymbols(s)];
for (const k of keys) {
Object.defineProperty(d, k, { ...Object.getOwnPropertyDescriptor(s, k), enumerable: false });
}
return d;
}
Expand Down
11 changes: 5 additions & 6 deletions module/src/iterators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,12 @@ const asyncExtras = {
const extraKeys = [...Object.getOwnPropertySymbols(asyncExtras), ...Object.keys(asyncExtras)] as (keyof typeof asyncExtras)[];

// Like Object.assign, but the assigned properties are not enumerable
function assignHidden<D extends {}, S extends {}>(d: D, ...srcs: S[]) {
for (const s of srcs) {
for (const [k,pd] of Object.entries(Object.getOwnPropertyDescriptors(s))) {
Object.defineProperty(d, k, {...pd, enumerable: false});
}
function assignHidden<D extends {}, S extends {}>(d: D, s: S) {
const keys = [...Object.getOwnPropertyNames(s), ...Object.getOwnPropertySymbols(s)];
for (const k of keys) {
Object.defineProperty(d, k, { ...Object.getOwnPropertyDescriptor(s, k), enumerable: false});
}
return d as D & S;
return d as D & S;
}

const queue_pending = Symbol('pending');
Expand Down

0 comments on commit 07b7294

Please sign in to comment.