Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including mirror-keys with all npm packages installed. Try it out:

// import mirrorKeys from 'mirror-keys'; // const mirrorKeys = require('mirror-keys').default; const { default: mirrorKeys } = require('mirror-keys'); const ex1 = mirrorKeys(undefined, { a: undefined }); const ex2 = mirrorKeys('Home.', { a: undefined }); const ex3 = mirrorKeys(undefined, { a: { b: undefined } }); const ex4 = mirrorKeys('Home.', { a: { b: undefined } }); console.log(ex1); console.log(ex2); console.log(ex3); console.log(ex4);

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

mirror-keys v1.0.1

Copies object keys over to values, useful to create a constant like enum.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free