lib/utils/identifierMapping.js
function keyMapper(mapper) {
  return obj => {
    if (!isObject(obj) || Array.isArray(obj)) {
      return obj;
    }

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

    for (let i = 0, l = keys.length; i < l; ++i) {
      const key = keys[i];
      out[mapper(key)] = obj[key];
    }

    return out;
  };
}
function keyMapper(mapper) {
  return obj => {
    if (!isObject(obj) || Array.isArray(obj)) {
      return obj;
    }

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

    for (let i = 0, l = keys.length; i < l; ++i) {
      const key = keys[i];
      out[mapper(key)] = obj[key];
    }

    return out;
  };
}
function keyMapper ( mapper ) { return obj => { if ( ! isObject ( obj ) || Array . isArray ( obj ) ) { return obj ; } const keys = Object . keys ( obj ) ; const out = { } ; for ( let i = 0 , l = keys . length ; i < l ; ++ i ) { const key = keys [ i ] ; out [ mapper ( key ) ] = obj [ key ] ; } return out ; } ; }
Returns a function that takes an object as an input and maps the object's keys using `mapper`. If the input is not an object, the input is returned unchanged.
Returns a function that takes an object as an input and maps the object s keys using mapper . If the input is not an object the input is returned unchanged .