Giter VIP home page Giter VIP logo

huynhsamha / js-convert-case Goto Github PK

View Code? Open in Web Editor NEW
45.0 3.0 6.0 474 KB

⛹️‍♂️ JavaScript Convert Cases Package 🏌️‍♀️ Use for both Node.JS and Browser 🎯🎯

Home Page: https://huynhsamha.github.io/js-convert-case/

License: GNU General Public License v3.0

JavaScript 85.98% HTML 0.22% TypeScript 12.86% Shell 0.95%
js-convert-case jsconvert js-camelcase js-dotcase js-headercase js-pascalcase js-pathcase js-sentencecase js-snakecase js-textcase

js-convert-case's Introduction

js-convert-case

NPM version NPM downloads GitHub tag File size MIT license

⛹️‍♂️ JavaScript Convert Cases Package 🏌️‍♀️ Use for both Node.JS and Browser 🎯🎯

Convert String and Keys of Object between cases (camelCase, snake_case, PascalCase, dot.case, path/case, text case, Sentence case, Header Case, UPPERCASE, lowercase, kebab-case).

View Demo on GitHub here.

Installation

Node.JS

npm install --save js-convert-case
# or
yarn add js-convert-case

Browser

Download file js-convert-case.min.js at here or we can use CDN for NPM such as unpkg or jsDelivr.

<!-- Use CDN -->
<!-- use jsDelivr -->
<script src="https://cdn.jsdelivr.net/js-convert-case/dist/js-convert-case.min.js"></script>
<!-- or use unpkg -->
<script src="https://unpkg.com/js-convert-case/dist/js-convert-case.min.js"></script>

<!-- or download file directly -->
<script src="[path/to/dist]/js-convert-case.min.js"></script>

Usage

Node.JS

Syntax require

const jsConvert = require('js-convert-case');
// or
const { toCamelCase, toDotCase, upperKeys, snakeKeys } = require('js-convert-case');

Syntax import

import js-convert-case from 'js-convert-case';
// or
import { toPascalCase, toPathCase, lowerKeys, camelKeys } from 'js-convert-case';

Example

// Convert String
console.log(jsConvert.toCamelCase('param-case')); // paramCase
console.log(jsConvert.toSnakeCase('param-case')); // param_case
console.log(jsConvert.toPascalCase('param-case')); // ParamCase
console.log(jsConvert.toDotCase('param-case')); // param.case
console.log(jsConvert.toPathCase('param-case')); // param/case
console.log(jsConvert.toTextCase('param-case')); // param case
console.log(jsConvert.toSentenceCase('param-case')); // Param case
console.log(jsConvert.toHeaderCase('param-case')); // Param Case
console.log(jsConvert.toLowerCase('param-case')); // param-case
console.log(jsConvert.toUpperCase('param-case')); // PARAM-CASE
console.log(jsConvert.toKebabCase('param-case')); // param-case

// Convert Keys of Object
const obj = {
	camelCase: 1,
	UPPERCASE: 2,
	lowercase: 3,
	snake_case: 4,
	PascalCase: 5,
	'Title Case': 6,
	'dot.case': 7,
	'param-case': 8,
	'Sentence case': 9,
	'path/case': 10,
	'Header-Case': 11
};

console.log(jsConvert.lowerKeys(obj));
console.log(jsConvert.upperKeys(obj));
console.log(jsConvert.camelKeys(obj));
console.log(jsConvert.snakeKeys(obj));
console.log(jsConvert.pascalKeys(obj));
console.log(jsConvert.kebabKeys(obj));

Browser

After file js-convert-case.min.js is loaded, object jsConvert will be exported globally into window object.

<script>
	console.log(window.jsConvert);
	console.log(jsConvert);

	// Convert String cases
	console.log(jsConvert.toCamelCase('param-case')); // paramCase
	console.log(jsConvert.toSnakeCase('param-case')); // param_case
	console.log(jsConvert.toPascalCase('param-case')); // ParamCase
	console.log(jsConvert.toDotCase('param-case')); // param.case
	console.log(jsConvert.toPathCase('param-case')); // param/case
	console.log(jsConvert.toTextCase('param-case')); // param case
	console.log(jsConvert.toSentenceCase('param-case')); // Param case
	console.log(jsConvert.toHeaderCase('param-case')); // Param Case
	console.log(jsConvert.toLowerCase('param-case')); // param-case
	console.log(jsConvert.toUpperCase('param-case')); // PARAM-CASE
	console.log(jsConvert.toKebabCase('param-case')); // param-case

	// Convert Keys of Object case
	const obj = {
		camelCase: 1,
		UPPERCASE: 2,
		lowercase: 3,
		snake_case: 4,
		PascalCase: 5,
		'Title Case': 6,
		'dot.case': 7,
		'param-case': 8,
		'Sentence case': 9,
		'path/case': 10,
		'Header-Case': 11
	};

	console.log(jsConvert.lowerKeys(obj));
	console.log(jsConvert.upperKeys(obj));
	console.log(jsConvert.camelKeys(obj));
	console.log(jsConvert.snakeKeys(obj));
	console.log(jsConvert.pascalKeys(obj));
	console.log(jsConvert.kebabKeys(obj));
</script>

More examples

You can see more examples in directory ./test/browser

API

jsConvert

jsConvert is an object containing function which converts cases. On browser, jsConvert is exported globally to window object, you can access by jsConvert or window.jsConvert.

Available Methods

Convert String

Convert Keys of Object

toCamelCase

Return as a string with the separators denoted by having the next letter capitalized.

console.log(jsConvert.toCamelCase('param-case')); // paramCase

toSnakeCase

Return as a lower case, underscore separated string.

console.log(jsConvert.toSnakeCase('camelCase')); // camel_case

toPascalCase

Return as a string denoted in the same fashion as camelCase, but with the first letter also capitalized.

console.log(jsConvert.toPascalCase('param-case')); // ParamCase

toDotCase

Return as a lower case, period separated string.

console.log(jsConvert.toDotCase('Title Case')); // title.case

toPathCase

Return as a lower case, slash separated string.

console.log(jsConvert.toPathCase('camelCase')); // camel/case

toTextCase

Return the string without any casing (lower case, space separated).

console.log(jsConvert.toTextCase('camelCase')); // camel case

toSentenceCase

Return as a lower case, space separated string with the first letter upper case.

console.log(jsConvert.toSentenceCase('camelCase')); // Camel case

toHeaderCase

Return as a space separated string with the first character of every word upper cased.

console.log(jsConvert.toHeaderCase('param-case')); // Param Case

toKebabCase

Return as a lower case, hyphen separated string.

console.log(jsConvert.toKebabCase('Title Case')); // title-case

toLowerCase

Similar to String.prototype.toLowerCase()

console.log(jsConvert.toLowerCase('Title Case')); // title case

toUpperCase

Similar to String.prototype.toUpperCase()

console.log(jsConvert.toUpperCase('param-case')); // PARAM-CASE

lowerKeys

const lowerKeys(obj: any, { 
	recursive: boolean = false, 
	recursiveInArray: boolean = false, 
	keepTypesOnRecursion: any[] = [] // example: Date
}): object | null

Return a new object which keys is lowercase format. Support lowerKeys recursively. Default is false.

console.log(jsConvert.lowerKeys(obj));
// or recursive
console.log(jsConvert.lowerKeys(obj, { recursive: true }));
// or recursive in sub-keys with value is an array
console.log(jsConvert.lowerKeys(obj, { recursive: true, recursiveInArray: true }));

/**
{ camelcase: 1,
  uppercase: 2,
  lowercase: 3,
  snake_case: 4,
  pascalcase: 5,
  'title case': 6,
  'dot.case': 7,
  'param-case': 8,
  'sentence case': 9,
  'path/case': 10,
  'header-case': 11 }
**/

// All output are `null`
console.log(jsConvert.lowerKeys(undefined));
console.log(jsConvert.lowerKeys(null));
console.log(jsConvert.lowerKeys(1));
console.log(jsConvert.lowerKeys('abc'));
console.log(jsConvert.lowerKeys([1, 2, 3]));

upperKeys

const upperKeys(obj: any, { 
	recursive: boolean = false, 
	recursiveInArray: boolean = false, 
	keepTypesOnRecursion: any[] = [] // example: Date 
}): object | null

Return a new object which keys is UPPERCASE format. Support upperKeys recursively. Default is false

console.log(jsConvert.upperKeys(obj));
// or recursive
console.log(jsConvert.upperKeys(obj, { recursive: true }));
// or recursive in sub-keys with value is an array
console.log(jsConvert.upperKeys(obj, { recursive: true, recursiveInArray: true }));

/**
{ CAMELCASE: 1,
  UPPERCASE: 2,
  LOWERCASE: 3,
  SNAKE_CASE: 4,
  PASCALCASE: 5,
  'TITLE CASE': 6,
  'DOT.CASE': 7,
  'PARAM-CASE': 8,
  'SENTENCE CASE': 9,
  'PATH/CASE': 10,
  'HEADER-CASE': 11 }
**/

// All output are `null`
console.log(jsConvert.upperKeys(undefined));
console.log(jsConvert.upperKeys(null));
console.log(jsConvert.upperKeys(1));
console.log(jsConvert.upperKeys('abc'));
console.log(jsConvert.upperKeys([1, 2, 3]));

camelKeys

const camelKeys(obj: any, { 
	recursive: boolean = false, 
	recursiveInArray: boolean = false, 
	keepTypesOnRecursion: any[] = [] // example: Date 
}): object | null

Return a new object which keys is camelCase format. Support camelKeys recursively. Default is false.

console.log(jsConvert.camelKeys(obj));
// or recursive
console.log(jsConvert.camelKeys(obj, { recursive: true }));
// or recursive in sub-keys with value is an array
console.log(jsConvert.camelKeys(obj, { recursive: true, recursiveInArray: true }));

/**
{ camelCase: 1,
  uppercase: 2,
  lowercase: 3,
  snakeCase: 4,
  pascalCase: 5,
  titleCase: 6,
  dotCase: 7,
  paramCase: 8,
  sentenceCase: 9,
  pathCase: 10,
  headerCase: 11 }
**/

// All output are `null`
console.log(jsConvert.camelKeys(undefined));
console.log(jsConvert.camelKeys(null));
console.log(jsConvert.camelKeys(1));
console.log(jsConvert.camelKeys('abc'));
console.log(jsConvert.camelKeys([1, 2, 3]));

snakeKeys

const snakeKeys(obj: any, { 
	recursive: boolean = false, 
	recursiveInArray: boolean = false, 
	keepTypesOnRecursion: any[] = [] // example: Date 
}): object | null

Return a new object which keys is snake_case format. Support snakeKeys recursively. Default is false.

console.log(jsConvert.snakeKeys(obj));
// or recursive
console.log(jsConvert.snakeKeys(obj, { recursive: true }));
// or recursive in sub-keys with value is an array
console.log(jsConvert.snakeKeys(obj, { recursive: true, recursiveInArray: true }));

/**
{ camel_case: 1,
  uppercase: 2,
  lowercase: 3,
  snake_case: 4,
  pascal_case: 5,
  title_case: 6,
  dot_case: 7,
  param_case: 8,
  sentence_case: 9,
  path_case: 10,
  header_case: 11 }
**/

// All output are `null`
console.log(jsConvert.snakeKeys(undefined));
console.log(jsConvert.snakeKeys(null));
console.log(jsConvert.snakeKeys(1));
console.log(jsConvert.snakeKeys('abc'));
console.log(jsConvert.snakeKeys([1, 2, 3]));

pascalKeys

const pascalKeys(obj: any, { 
	recursive: boolean = false, 
	recursiveInArray: boolean = false, 
	keepTypesOnRecursion: any[] = [] // example: Date 
}): object | null

Return a new object which keys is PascalCase format. Support pascalKeys recursively. Default is false.

console.log(jsConvert.pascalKeys(obj));
// or recursive
console.log(jsConvert.pascalKeys(obj, { recursive: true }));
// or recursive in sub-keys with value is an array
console.log(jsConvert.pascalKeys(obj, { recursive: true, recursiveInArray: true }));

/**
{ CamelCase: 1,
  Uppercase: 2,
  Lowercase: 3,
  SnakeCase: 4,
  PascalCase: 5,
  TitleCase: 6,
  DotCase: 7,
  ParamCase: 8,
  SentenceCase: 9,
  PathCase: 10,
  HeaderCase: 11 }
**/

// All output are `null`
console.log(jsConvert.pascalKeys(undefined));
console.log(jsConvert.pascalKeys(null));
console.log(jsConvert.pascalKeys(1));
console.log(jsConvert.pascalKeys('abc'));
console.log(jsConvert.pascalKeys([1, 2, 3]));

kebabKeys

const kebabKeys(obj: any, { 
	recursive: boolean = false, 
	recursiveInArray: boolean = false, 
	keepTypesOnRecursion: any[] = [] // example: Date 
}): object | null

Return a new object which keys is kebab-case format. Support kebabKeys recursively. Default is false.

console.log(jsConvert.kebabKeys(obj));
// or recursive
console.log(jsConvert.kebabKeys(obj, { recursive: true }));
// or recursive in sub-keys with value is an array
console.log(jsConvert.kebabKeys(obj, { recursive: true, recursiveInArray: true }));

/**
{ 'camel-case': 1,
  uppercase: 2,
  lowercase: 3,
  'snake-case': 4,
  'pascal-case': 5,
  'title-case': 6,
  'dot-case': 7,
  'param-case': 8,
  'sentence-case': 9,
  'path-case': 10,
  'header-case': 11 }
**/

// All output are `null`
console.log(jsConvert.kebabKeys(undefined));
console.log(jsConvert.kebabKeys(null));
console.log(jsConvert.kebabKeys(1));
console.log(jsConvert.kebabKeys('abc'));
console.log(jsConvert.kebabKeys([1, 2, 3]));

Examples

Convert string between cases

console.log(jsConvert.toCamelCase('param-case')); // paramCase
console.log(jsConvert.toCamelCase('camelCase')); // camelCase
console.log(jsConvert.toCamelCase('Title Case')); // titleCase

console.log(jsConvert.toSnakeCase('param-case')); // param_case
console.log(jsConvert.toSnakeCase('camelCase')); // camel_case
console.log(jsConvert.toSnakeCase('Title Case')); // title_case

console.log(jsConvert.toPascalCase('param-case')); // ParamCase
console.log(jsConvert.toPascalCase('camelCase')); // CamelCase
console.log(jsConvert.toPascalCase('Title Case')); // TitleCase

console.log(jsConvert.toDotCase('param-case')); // param.case
console.log(jsConvert.toDotCase('camelCase')); // camel.case
console.log(jsConvert.toDotCase('Title Case')); // title.case

console.log(jsConvert.toPathCase('param-case')); // param/case
console.log(jsConvert.toPathCase('camelCase')); // camel/case
console.log(jsConvert.toPathCase('Title Case')); // title/case

console.log(jsConvert.toTextCase('param-case')); // param case
console.log(jsConvert.toTextCase('camelCase')); // camel case
console.log(jsConvert.toTextCase('Title Case')); // title case

console.log(jsConvert.toSentenceCase('param-case')); // Param case
console.log(jsConvert.toSentenceCase('camelCase')); // Camel case
console.log(jsConvert.toSentenceCase('Title Case')); // Title case

console.log(jsConvert.toHeaderCase('param-case')); // Param Case
console.log(jsConvert.toHeaderCase('camelCase')); // Camel Case
console.log(jsConvert.toHeaderCase('Title Case')); // Title Case

console.log(jsConvert.toLowerCase('param-case')); // param-case
console.log(jsConvert.toLowerCase('Title Case')); // title case
console.log(jsConvert.toUpperCase('param-case')); // PARAM-CASE
console.log(jsConvert.toUpperCase('Title Case')); // TITLE CASE

console.log(jsConvert.toKebabCase('param-case')); // param-case
console.log(jsConvert.toKebabCase('Title Case')); // title-case
console.log(jsConvert.toKebabCase('param-case')); // PARAM-CASE
console.log(jsConvert.toKebabCase('Title Case')); // TITLE-CASE

Speical values

console.log(jsConvert.toCamelCase('')); // => ''
console.log(jsConvert.toSnakeCase(null)); // => ''
console.log(jsConvert.toPascalCase(undefined)); // => ''

Complicated values

const str =
	'!@#$  	-- Hello___world ..<>| \\ 123_ _456 &l sn_ca - cmCa - PcCa - dot.ca - txt ca - Sen ca - Hd Ca %^$^%&';
console.log(jsConvert.toCamelCase(str)); // => 'helloWorld123456LSnCaCmCaPcCaDotCaTxtCaSenCaHdCa'
console.log(jsConvert.toPascalCase(str)); // => 'HelloWorld123456LSnCaCmCaPcCaDotCaTxtCaSenCaHdCa'
console.log(jsConvert.toSnakeCase(str)); // => 'hello_world_123_456_l_sn_ca_cm_ca_pc_ca_dot_ca_txt_ca_sen_ca_hd_ca'
console.log(jsConvert.toDotCase(str)); // => 'hello.world.123.456.l.sn.ca.cm.ca.pc.ca.dot.ca.txt.ca.sen.ca.hd.ca'
console.log(jsConvert.toPathCase(str)); // => 'hello/world/123/456/l/sn/ca/cm/ca/pc/ca/dot/ca/txt/ca/sen/ca/hd/ca'
console.log(jsConvert.toTextCase(str)); // => 'hello world 123 456 l sn ca cm ca pc ca dot ca txt ca sen ca hd ca'
console.log(jsConvert.toSentenceCase(str)); // => 'Hello world 123 456 l sn ca cm ca pc ca dot ca txt ca sen ca hd ca'
console.log(jsConvert.toHeaderCase(str)); // => 'Hello World 123 456 L Sn Ca Cm Ca Pc Ca Dot Ca Txt Ca Sen Ca Hd Ca'
console.log(jsConvert.toKebabCase(str)); // => 'hello-world-123-456-l-sn-ca-cm-ca-pc-ca-dot-ca-txt-ca-sen-ca-hd-ca'

Recursive convert in object

Multi-leveled object

const core = {
	camelCase: 1,
	UPPERCASE: 2,
	lowercase: 3,
	snake_case: 4,
	PascalCase: 5,
	'Title Case': 6,
	'dot.case': 7,
	'param-case': 8,
	'Sentence case': 9,
	'path/case': 10,
	'Header-Case': 11
};

const obj = {
	...core,
	lv1: {
		...core,
		lv2: {
			...core
		}
	}
};

Example with upperKeys

const res = jsConvert.upperKeys(obj, { recursive: true });
console.log(JSON.stringify(res));

Output

{
	"CAMELCASE": 1,
	"UPPERCASE": 2,
	"LOWERCASE": 3,
	"SNAKE_CASE": 4,
	"PASCALCASE": 5,
	"TITLE CASE": 6,
	"DOT.CASE": 7,
	"PARAM-CASE": 8,
	"SENTENCE CASE": 9,
	"PATH/CASE": 10,
	"HEADER-CASE": 11,
	"LV1": {
		"CAMELCASE": 1,
		"UPPERCASE": 2,
		"LOWERCASE": 3,
		"SNAKE_CASE": 4,
		"PASCALCASE": 5,
		"TITLE CASE": 6,
		"DOT.CASE": 7,
		"PARAM-CASE": 8,
		"SENTENCE CASE": 9,
		"PATH/CASE": 10,
		"HEADER-CASE": 11,
		"LV2": {
			"CAMELCASE": 1,
			"UPPERCASE": 2,
			"LOWERCASE": 3,
			"SNAKE_CASE": 4,
			"PASCALCASE": 5,
			"TITLE CASE": 6,
			"DOT.CASE": 7,
			"PARAM-CASE": 8,
			"SENTENCE CASE": 9,
			"PATH/CASE": 10,
			"HEADER-CASE": 11
		}
	}
}

Example with pascalKeys

const res = jsConvert.pascalKeys(obj, { recursive: true });
console.log(JSON.stringify(res));

Output

{
	"CamelCase": 1,
	"Uppercase": 2,
	"Lowercase": 3,
	"SnakeCase": 4,
	"PascalCase": 5,
	"TitleCase": 6,
	"DotCase": 7,
	"ParamCase": 8,
	"SentenceCase": 9,
	"PathCase": 10,
	"HeaderCase": 11,
	"Lv1": {
		"CamelCase": 1,
		"Uppercase": 2,
		"Lowercase": 3,
		"SnakeCase": 4,
		"PascalCase": 5,
		"TitleCase": 6,
		"DotCase": 7,
		"ParamCase": 8,
		"SentenceCase": 9,
		"PathCase": 10,
		"HeaderCase": 11,
		"Lv2": {
			"CamelCase": 1,
			"Uppercase": 2,
			"Lowercase": 3,
			"SnakeCase": 4,
			"PascalCase": 5,
			"TitleCase": 6,
			"DotCase": 7,
			"ParamCase": 8,
			"SentenceCase": 9,
			"PathCase": 10,
			"HeaderCase": 11
		}
	}
}

Example with snakeKeys use recursive in array-sub-keys

const obj = {
	camelCase: 1,
	PascalCase: {
		camelCase: [1, 'a', null, { PascalCase: 1 }, undefined],
		PascalCase: [{ PascalCase: [1] }, [1, { PascalCase: 2 }]],
		snake_case: { camelCase: [{ PascalCase: 1 }] }
	}
};

const res = jsConvert.snakeKeys(obj, { recursive: true, recursiveInArray: true });
console.log(JSON.stringify(res));

Output

{
	"camel_case": 1,
	"pascal_case": {
		"camel_case": [1, "a", null, { "pascal_case": 1 }, null],
		"pascal_case": [{ "pascal_case": [1] }, [1, { "pascal_case": 2 }]],
		"snake_case": { "camel_case": [{ "pascal_case": 1 }] }
	}
}

Note: You can browse more examples at folder ./test/example.

Dependencies

No dependencies

Development

Quickstart

  • Clone the repository and enter the project
git clone https://github.com/huynhsamha/js-convert-case.git
cd js-convert-case
  • Install dependencies
yarn
  • Lint and format source (directory src)
yarn format # defined in package.json
yarn lint   # defined in package.json
  • Build package for Node
yarn dist:node  # defined in package.json

Output directory is dist (defined in file tsconfig.json)

  • Build package for Browser
yarn dist:browser  # defined in package.json and rollup.config.js
  • Build dist (both Node and Browser)
yarn dist  # defined in package.json
  • Build release files
yarn build:release:binary

Testing

In directory test, we can test the package in environments NodeJS, Browser, pre-published NPM package and the released package.

Buy me a coffee

Donate to my paypal

js-convert-case's People

Contributors

bobbiegoede avatar huynhsamha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

js-convert-case's Issues

Objects that have a property of type 'Date' have their values changed to be an empty object

I am using this in conjunction with Prisma

Console logging the result from Prisma results in:

{
  Id: '77ec59b4-d7c8-4907-8f61-dc468cdd11ff',
  StartDateTime: 2021-04-16T12:30:00.000Z,
}

And if I log out the typeof for StartDateTime I get

StartDateTime: object

So I know that it is a Date object.

After running the data through the camelKeys function:

  const source = camelKeys(raw, { recursive: true, recursiveInArray: true })

I end up with this

{
  "id": "77ec59b4-d7c8-4907-8f61-dc468cdd11ff",
  "startDateTime": {},
}

I am guessing that this is because it is recursively looping through the nested object that I am converting, and the Date object counts as an object, but I think you should consider handling this object in a special way and returning either the Date object or at least it's .toString() result.

Possible to convert an array directly?

Just discovered that I'm unable to convert an array unfortunately.

const data = [
  { id: 1, user_id: 1, created_at: '2021-07-20T15:40:20.170121+00:00'}, 
  {id: 2, user_id: 2, created_at: '2021-07-20T15:40:20.170121+00:00'},
];

const response = camelKeys(data, {
  recursive: true,
  recursiveInArray: true,
});
console.log(response); // returns null

Are there any plans to allow for this feature?

Adding kebab-case?

It's impressive work, thank you first of all.

Do you think to add add kebab-case ?

License clarity re MIT vs GPL

In package.json the license is listed as MIT (and this is shown on npmjs.com) but the LICENSE file actually contains the text of the GPL license (and this is what is shown on the Github page).

Is the intention dual licenses? It would be great if this could be cleared up.

Thanks!

Nested array properties are not converted

Your code is amazing. But when a nested property is an array of objects the properties of these objects are not converted. I created a fork to handle it but i guess you use TS it'll better if you can add this functionnality. And maybe convert an array of objects directly cause now if i pass an array of objects to snakeKeys for example, the properties of these objects are not converted.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.