@@ -2,6 +2,9 @@ const Benchmark = require('benchmark')
2
2
3
3
const humps = require ( 'humps' )
4
4
const xcase = require ( 'xcase' )
5
+ const tsCaseConvert = require ( 'ts-case-convert' )
6
+
7
+
5
8
const fastCase = require ( '.' )
6
9
7
10
const objectBare = {
@@ -799,6 +802,9 @@ new Benchmark.Suite()
799
802
. add ( 'humps#camelize' , function ( ) {
800
803
humps . camelize ( getStringForCamelize ( ) )
801
804
} )
805
+ . add ( 'ts-case-convert#camelize' , function ( ) {
806
+ tsCaseConvert . toCamel ( getStringForCamelize ( ) )
807
+ } )
802
808
. on ( 'cycle' , onCycle )
803
809
. on ( 'complete' , onComplete )
804
810
. run ( )
@@ -827,6 +833,9 @@ new Benchmark.Suite()
827
833
. add ( 'humps#pascalize' , function ( ) {
828
834
humps . pascalize ( getStringForPascalize ( ) )
829
835
} )
836
+ . add ( 'ts-case-convert#pascalize' , function ( ) {
837
+ tsCaseConvert . toPascal ( getStringForPascalize ( ) )
838
+ } )
830
839
. on ( 'cycle' , onCycle )
831
840
. on ( 'complete' , onComplete )
832
841
. run ( )
@@ -855,6 +864,9 @@ new Benchmark.Suite()
855
864
. add ( 'humps#camelizeKeys' , function ( ) {
856
865
humps . camelizeKeys ( smallObject )
857
866
} )
867
+ . add ( 'ts-case-convert#camelizeKeys' , function ( ) {
868
+ tsCaseConvert . objectToCamel ( smallObject )
869
+ } )
858
870
. on ( 'cycle' , onCycle )
859
871
. on ( 'complete' , onComplete )
860
872
. run ( )
@@ -894,6 +906,9 @@ new Benchmark.Suite()
894
906
. add ( 'humps#camelizeKeys (large object)' , function ( ) {
895
907
humps . camelizeKeys ( objectPool . pop ( ) )
896
908
} )
909
+ . add ( 'ts-case-convert#camelizeKeys (large object)' , function ( ) {
910
+ tsCaseConvert . objectToCamel ( objectPool . pop ( ) )
911
+ } )
897
912
. on ( 'cycle' , onCycle )
898
913
. on ( 'complete' , onComplete )
899
914
. run ( )
@@ -920,6 +935,9 @@ new Benchmark.Suite()
920
935
. add ( 'humps#pascalizeKeys (large object)' , function ( ) {
921
936
humps . pascalizeKeys ( camelizedObject )
922
937
} )
938
+ . add ( 'ts-case-convert#pascalizeKeys (large object)' , function ( ) {
939
+ tsCaseConvert . objectToPascal ( camelizedObject )
940
+ } )
923
941
. on ( 'cycle' , onCycle )
924
942
. on ( 'complete' , onComplete )
925
943
. run ( )
0 commit comments