1.0.7 • Published 3 years ago

@adso-ts/map-keys-deep v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Map keys deep

Performs deep map of object's keys

Import

import { mapKeysDeep } from '@adso-ts/map-keys-deep';

How to use

const originalObject = {
  prop_a: 'value',
  prop_b: {
    prop_c: 'value'
  }
}

const iteratorFn = (key : string) => key.toUpperCase();
// flat objects
const transformedObject = mapKeysDeep(originalObject, iteratorFn);
// nested objects
const transformedObject = mapKeysDeep(originalObject, (_value: any, key: any) => iteratorFn(key));
1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago