https://github.com/brunolm/mirror-keys
Copies object keys over to values, useful to create a constant-like enum.
https://github.com/brunolm/mirror-keys
javascript npm-package typescript
Last synced: 15 days ago
JSON representation
Copies object keys over to values, useful to create a constant-like enum.
- Host: GitHub
- URL: https://github.com/brunolm/mirror-keys
- Owner: brunolm
- Created: 2017-04-01T18:37:11.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-01T19:35:23.000Z (about 8 years ago)
- Last Synced: 2025-05-08T22:32:17.274Z (about 2 months ago)
- Topics: javascript, npm-package, typescript
- Language: TypeScript
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# mirror-keys
[![npm version][npm-version-image]][npm-url]
[![Try mirror-keys on RunKit][runkit-badge]][runkit]Example usage:
```typescript
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' } };
```[npm-url]: https://www.npmjs.com/package/mirror-keys
[npm-version-image]: http://img.shields.io/npm/v/mirror-keys.svg?style=flat[runkit]: https://runkit.com/npm/mirror-keys
[runkit-badge]: https://badge.runkitcdn.com/mirror-keys.svg