@@ -2,6 +2,9 @@ const Benchmark = require('benchmark')
22
33const humps = require ( 'humps' )
44const xcase = require ( 'xcase' )
5+ const tsCaseConvert = require ( 'ts-case-convert' )
6+
7+
58const fastCase = require ( '.' )
69
710const objectBare = {
@@ -799,6 +802,9 @@ new Benchmark.Suite()
799802 . add ( 'humps#camelize' , function ( ) {
800803 humps . camelize ( getStringForCamelize ( ) )
801804 } )
805+ . add ( 'ts-case-convert#camelize' , function ( ) {
806+ tsCaseConvert . toCamel ( getStringForCamelize ( ) )
807+ } )
802808 . on ( 'cycle' , onCycle )
803809 . on ( 'complete' , onComplete )
804810 . run ( )
@@ -827,6 +833,9 @@ new Benchmark.Suite()
827833 . add ( 'humps#pascalize' , function ( ) {
828834 humps . pascalize ( getStringForPascalize ( ) )
829835 } )
836+ . add ( 'ts-case-convert#pascalize' , function ( ) {
837+ tsCaseConvert . toPascal ( getStringForPascalize ( ) )
838+ } )
830839 . on ( 'cycle' , onCycle )
831840 . on ( 'complete' , onComplete )
832841 . run ( )
@@ -855,6 +864,9 @@ new Benchmark.Suite()
855864 . add ( 'humps#camelizeKeys' , function ( ) {
856865 humps . camelizeKeys ( smallObject )
857866 } )
867+ . add ( 'ts-case-convert#camelizeKeys' , function ( ) {
868+ tsCaseConvert . objectToCamel ( smallObject )
869+ } )
858870 . on ( 'cycle' , onCycle )
859871 . on ( 'complete' , onComplete )
860872 . run ( )
@@ -894,6 +906,9 @@ new Benchmark.Suite()
894906 . add ( 'humps#camelizeKeys (large object)' , function ( ) {
895907 humps . camelizeKeys ( objectPool . pop ( ) )
896908 } )
909+ . add ( 'ts-case-convert#camelizeKeys (large object)' , function ( ) {
910+ tsCaseConvert . objectToCamel ( objectPool . pop ( ) )
911+ } )
897912 . on ( 'cycle' , onCycle )
898913 . on ( 'complete' , onComplete )
899914 . run ( )
@@ -920,6 +935,9 @@ new Benchmark.Suite()
920935 . add ( 'humps#pascalizeKeys (large object)' , function ( ) {
921936 humps . pascalizeKeys ( camelizedObject )
922937 } )
938+ . add ( 'ts-case-convert#pascalizeKeys (large object)' , function ( ) {
939+ tsCaseConvert . objectToPascal ( camelizedObject )
940+ } )
923941 . on ( 'cycle' , onCycle )
924942 . on ( 'complete' , onComplete )
925943 . run ( )
0 commit comments