'use strict';

const camelCase = require('camel-case');

const rPrefixUnderscore = /^(_+)/;

function getter(key) {
  return function() {
    return this[key];
  };
}

function setter(key) {
  return function(value) {
    this[key] = value;
  };
}

function camelCaseKeys(obj) {
  if (typeof obj !== 'object') throw new TypeError('obj must be an object!');

  const keys = Object.keys(obj);
  const result = {};

  for (let i = 0, len = keys.length; i < len; i++) {
    const key = keys[i];
    const value = obj[key];
    const match = key.match(rPrefixUnderscore);
    let newKey;

    if (match) {
      const underscore = match[1];
      newKey = underscore + camelCase(key.substring(underscore.length));
    } else {
      newKey = camelCase(key);
    }

    if (newKey === key) {
      result[key] = value;
    } else {
      result[newKey] = value;
      Object.defineProperty(result, key, {
        get: getter(newKey),
        set: setter(newKey),
        configurable: true,
        enumerable: true
      });
    }
  }

  return result;
}

module.exports = camelCaseKeys;

@@ -234,32 +234,305 @@
  value;%0A  %7D;%0A%7D%0A%0A
+function toCamelCase(key) %7B%0A  const match = key.match(rPrefixUnderscore);%0A  let newKey;%0A%0A  if (match) %7B%0A    const underscore = match%5B1%5D;%0A    newKey = underscore + camelCase(key.substring(underscore.length));%0A  %7D else %7B%0A    newKey = camelCase(key);%0A  %7D%0A%0A  return newKey;%0A%7D%0A%0A
 function camelCa
@@ -545,16 +545,16 @@
 (obj) %7B%0A
-
   if (ty
@@ -799,217 +799,20 @@
 nst 
-match = key.match(rPrefixUnderscore);%0A    let newKey;%0A%0A    if (match) %7B%0A      const underscore = match%5B1%5D;%0A      newKey = underscore + camelCase(key.substring(underscore.length));%0A    %7D else %7B%0A      newKey = c
+newKey = toC
 amel
@@ -821,22 +821,16 @@
 se(key);
-%0A    %7D
 %0A%0A    if

Create function: toCamelCase()