10 Matching Annotations
  1. Dec 2023
  2. Nov 2023
  3. Mar 2023
  4. Mar 2021
    1. // A general key transform method. Pass it a function that accepts the old key and returns // the new key. // // @example // obj = transformKeys(obj, (key) => ( // key.replace(/\b(big)\b/g, 'little') // )) export function transformKeys(source, f) { return Object.entries(source).reduce((o, [key, value]) => { o[f(key) || key] = value return o }, {}) } // Provide an object that maps from old key to new key export function rekeyObject(source, keyMap) { transformKeys(source, key => keyMap[key]) }
  5. Oct 2020
  6. Sep 2020
  7. May 2020
  8. Apr 2020
  9. Mar 2020