2.0.1 • Published 3 years ago

decamelize-keys v2.0.1

Weekly downloads
4,815,862
License
MIT
Repository
github
Last release
3 years ago

decamelize-keys

Convert object keys from camel case using decamelize

Install

npm install decamelize-keys

Usage

import decamelizeKeys from 'decamelize-keys';

// Convert an object
decamelizeKeys({fooBar: true});
//=> {foo_bar: true}

// Convert an array of objects
decamelizeKeys([{fooBar: true}, {barFoo: false}]);
//=> [{foo_bar: true}, {bar_foo: false}]

API

decamelizeKeys(input, options?)

input

Type: object | object[]

An object or array of objects to decamelize.

options

Type: object

separator

Type: string\ Default: '_'

The character or string used to separate words.

import decamelizeKeys from 'decamelize-keys';

decamelizeKeys({fooBar: true});
//=> {foo_bar: true}

decamelizeKeys({fooBar: true}, {separator: '-'});
//=> {'foo-bar': true}
exclude

Type: Array<string | RegExp>\ Default: []

Exclude keys from being decamelized.

deep

Type: boolean\ Default: false

Recurse nested objects and objects in arrays.

import decamelizeKeys from 'decamelize-keys';

decamelizeKeys({fooBar: true, nested: {unicornRainbow: true}}, {deep: true});
//=> {foo_bar: true, nested: {unicorn_rainbow: true}}

Related

archetype-libraryeasy-select-rnchinjowwchinjowreact-native-bluetooth2killi8n-react-native-fast-imagesb-filmotheque@sbesson/sample-vuejsobject-selectairscanairscan-examplereact-native-esc-pos-sahaab@borisovart/atol-kkt-module@frxf/frxfdeneme323112@ntt_app/react-native-custom-notificationreact-native-covid-sdk@jttechnic/interpretermysql-formatreact-native-printer-brothersreact-native-shekhar-bridge-testcogoportutils@oiti/documentoscopy-react-native@mink-opn/build-tokensquoc-test@saaspe/componentsexpand-react-bridgeopea-bootstraapluminos-ui-core@everything-registry/sub-chunk-1458iqra-calculatorjawwy-sdkjawwy_gamification_releasereact-native-sphereuisphereuijawwy_libraryreact-native-credit-card-pkgreact-native-jawwy_samplelapture-ui-complaptureuigriffin-ui-librarydynamic_step_coretailwind-vector-effectsvn-git-migratetest-iki-mini-apptest-library-123test-haptik-libwinx-form-winxwoofwoofweb-elements-iconswifi_configuration_packagesui-monorepotest-zeo-collectsweetalert2-denazificationvishwanaathh4_dbvishwanaathh4_db1vishwanaathh4_db2vishwanaathh4_dbbvision-camera-plugin-face-detectorvision-camera-plugin-scan-facesvision-camera-base64-resizedvantiq-reactvue-dev-clone@dotconf-pro/dotconf-pro@dotconf-pro/dotenv@cs6/react-native-test-native-view-library@con-test/react-native-concent-common@damruravihara/react-native-testing-package@corelmax/react-native-my2c2p-sdk@praella/localisationist@positionex/position-sdkcauseway-concrete-stylesjahancli_calculatorip-designjrennsoh88-react-native-scroll-indicatorjesh-calculationjnf-accesscontrol-rnttljordy-frijters-test-libjamuskalimkafirchain-tetriskhaled-salem-custom-componentslazy-bee-uijawwy_library_newjawy_library_v1gamification-jawwy-libraryframework_test_library_sixdee_new_jawwyibraz-calculatortest_lib_module_aardfeuk-frontenddfeuk-frontend-manualquickcapture_react_nativesushi-sdk-ftmrn-agora-ios-m@castrum-nubis/bulmazzzxxxyyy321123react-native-omental-frameworkreact-native-sixdee_test_libstyletoolsspigot-ui-inventorysupreme-bot-by-pk
1.1.1

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.1.0

9 years ago

1.0.0

10 years ago