Skip to content

Commit

Permalink
Merge pull request #119 from batyshkaLenin/main
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobwgillespie authored Oct 5, 2024
2 parents a77f71d + 31c64af commit 7006583
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*.log

.vscode/
.idea/
dist/
node_modules/
18 changes: 18 additions & 0 deletions benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ const Benchmark = require('benchmark')

const humps = require('humps')
const xcase = require('xcase')
const tsCaseConvert = require('ts-case-convert')


const fastCase = require('.')

const objectBare = {
Expand Down Expand Up @@ -799,6 +802,9 @@ new Benchmark.Suite()
.add('humps#camelize', function () {
humps.camelize(getStringForCamelize())
})
.add('ts-case-convert#camelize', function () {
tsCaseConvert.toCamel(getStringForCamelize())
})
.on('cycle', onCycle)
.on('complete', onComplete)
.run()
Expand Down Expand Up @@ -827,6 +833,9 @@ new Benchmark.Suite()
.add('humps#pascalize', function () {
humps.pascalize(getStringForPascalize())
})
.add('ts-case-convert#pascalize', function () {
tsCaseConvert.toPascal(getStringForPascalize())
})
.on('cycle', onCycle)
.on('complete', onComplete)
.run()
Expand Down Expand Up @@ -855,6 +864,9 @@ new Benchmark.Suite()
.add('humps#camelizeKeys', function () {
humps.camelizeKeys(smallObject)
})
.add('ts-case-convert#camelizeKeys', function () {
tsCaseConvert.objectToCamel(smallObject)
})
.on('cycle', onCycle)
.on('complete', onComplete)
.run()
Expand Down Expand Up @@ -894,6 +906,9 @@ new Benchmark.Suite()
.add('humps#camelizeKeys (large object)', function () {
humps.camelizeKeys(objectPool.pop())
})
.add('ts-case-convert#camelizeKeys (large object)', function () {
tsCaseConvert.objectToCamel(objectPool.pop())
})
.on('cycle', onCycle)
.on('complete', onComplete)
.run()
Expand All @@ -920,6 +935,9 @@ new Benchmark.Suite()
.add('humps#pascalizeKeys (large object)', function () {
humps.pascalizeKeys(camelizedObject)
})
.add('ts-case-convert#pascalizeKeys (large object)', function () {
tsCaseConvert.objectToPascal(camelizedObject)
})
.on('cycle', onCycle)
.on('complete', onComplete)
.run()
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"microbundle": "^0.15.0",
"prettier": "^2.0.5",
"typescript": "^4.0.2",
"xcase": "^2.0.1"
"xcase": "^2.0.1",
"ts-case-convert": "^2.0.7"
}
}
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4225,6 +4225,11 @@ to-regex-range@^5.0.1:
dependencies:
is-number "^7.0.0"

ts-case-convert@^2.0.7:
version "2.0.7"
resolved "https://registry.yarnpkg.com/ts-case-convert/-/ts-case-convert-2.0.7.tgz#a92b9fb17aadde088f34329f6841cf5640c24f23"
integrity sha512-Kqj8wrkuduWsKUOUNRczrkdHCDt4ZNNd6HKjVw42EnMIGHQUABS4pqfy0acETVLwUTppc1fzo/yi11+uMTaqzw==

tslib@^2.0.3, tslib@^2.4.0:
version "2.4.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3"
Expand Down

0 comments on commit 7006583

Please sign in to comment.