Skip to content

brunolm/mirror-keys

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mirror-keys

npm version Try mirror-keys on RunKit

Example usage:

import mirrorKeys from 'mirror-keys';

mirrorKeys(undefined, { a: undefined }); // { a: 'a' };
mirrorKeys('Home.', { a: undefined }); // { a: 'Home.a' };
mirrorKeys(undefined, { a: { b: undefined } }); // { a: { b: 'b' } };
mirrorKeys('Home.', { a: { b: undefined } }); // { a: { b: 'Home.b' } };

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published