Skip to content

Support structuredClone #177

@SimenB

Description

@SimenB

Ships in Node 17

https://nodejs.org/api/globals.html#structuredclonevalue-options
https://developer.mozilla.org/en-US/docs/Web/API/structuredClone

it is also used by e.g. worker_threads, which ships from node 10

const envalid = require('envalid');

const config = envalid.cleanEnv({ HELLO: 'foobar' }, { HELLO: envalid.str() });

structuredClone(config);

throws

Uncaught:
DOMException [DataCloneError]: #<Object> could not be cloned.
    at structuredClone (node:internal/structured_clone:15:17)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions