Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More

object-key-prefixer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

object-key-prefixer

Prefix all keys in an object and return a new object with updated keys


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created

object-key-prefixer

A JavaScript object key prefixer

A simple method that takes an object and returns a new object where all of the top-level keys have been prefixed by some string.

Table of Contents

Install

npm install --save object-key-prefixer

Usage

var prefixer = require('object-key-prefixer');
var obj = {
  one: 'foo',
  two: {
    bar: 'baz'
  }
}

prefixer(obj, 'awesome_')

Output:

{
  awesome_one: 'foo',
  awesome_two: {
    bar: 'baz'
  }
}

Contribute

PRs accepted. Note that code uses standard styling.

License

MIT © Dan Caddigan

FAQs

Package last updated on 07 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts