Skip to content

Commit

Permalink
Merge pull request #6 from 14f3v/feature
Browse files Browse the repository at this point in the history
Feature
  • Loading branch information
14f3v committed Mar 21, 2024
2 parents eb7e800 + 6a688ee commit f046b5f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"keywords": [
"typescript"
],
"module": "./dist/index..mjs",
"module": "./dist/index.mjs",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default function ObjectConvertionKeysToCamelCase<T>(obj: T): CamelCase<T>
for (const key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
const camelKey = key.toLowerCase().replace(/_([a-z])/g, (match, letter) => letter.toUpperCase());
if (typeof obj[key] == 'object') {
if (obj[key] instanceof Object && !(obj[key] instanceof Date)) {
if (!obj[key]) camelObj[camelKey.charAt(0).toLowerCase() + camelKey.slice(1)] = obj[key]
else camelObj[camelKey.charAt(0).toLowerCase() + camelKey.slice(1)] = ObjectConvertionKeysToCamelCase(obj[key]);
}
Expand Down

0 comments on commit f046b5f

Please sign in to comment.