diff options
Diffstat (limited to 'ext/node')
-rw-r--r-- | ext/node/polyfills/internal/console/constructor.mjs | 13 | ||||
-rw-r--r-- | ext/node/polyfills/internal_binding/util.ts | 15 |
2 files changed, 16 insertions, 12 deletions
diff --git a/ext/node/polyfills/internal/console/constructor.mjs b/ext/node/polyfills/internal/console/constructor.mjs index 5ea9eeb3a..afa18bb97 100644 --- a/ext/node/polyfills/internal/console/constructor.mjs +++ b/ext/node/polyfills/internal/console/constructor.mjs @@ -17,17 +17,7 @@ import { validateInteger, validateObject, } from "ext:deno_node/internal/validators.mjs"; -const previewEntries = (iter, isKeyValue) => { - if (isKeyValue) { - const arr = [...iter]; - if (Array.isArray(arr[0]) && arr[0].length === 2) { - return [[].concat(...arr), true]; - } - return [arr, false]; - } else { - return [...iter]; - } -}; +import { previewEntries } from "ext:deno_node/internal_binding/util.ts"; import { Buffer } from "node:buffer"; const { isBuffer } = Buffer; import { @@ -475,7 +465,6 @@ const consoleMethods = { // https://console.spec.whatwg.org/#table table(tabularData, properties) { - console.log("tabularData", tabularData); if (properties !== undefined) { validateArray(properties, "properties"); } diff --git a/ext/node/polyfills/internal_binding/util.ts b/ext/node/polyfills/internal_binding/util.ts index 38eeebee0..651fe9a4b 100644 --- a/ext/node/polyfills/internal_binding/util.ts +++ b/ext/node/polyfills/internal_binding/util.ts @@ -129,3 +129,18 @@ export function getOwnNonIndexProperties( } return result; } + +export function previewEntries( + iter: Iterable<unknown>, + isKeyValue?: boolean, +): Array<unknown | boolean> { + if (isKeyValue) { + const arr = [...iter]; + if (Array.isArray(arr[0]) && arr[0].length === 2) { + return [([] as unknown[]).concat(...arr), true]; + } + return [arr, false]; + } else { + return [...iter]; + } +} |