File tree Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 1+ # OS Generate Files #
2+ # #####################
3+ .DS_Store
4+ .DS_Store ?
5+ .travis.yml
6+
7+ /node_modules
Original file line number Diff line number Diff line change @@ -19,6 +19,10 @@ const createString = (value, option) => {
1919 return '' + value ;
2020 }
2121
22+ if ( isNumber ( value ) ) {
23+ return '' + value ;
24+ }
25+
2226 if ( Array . isArray ( value ) ) {
2327 option . seperator = option . seperator || ',' ;
2428 return option . braces === "true" ? '[' + value . map ( ( val ) => {
@@ -68,6 +72,10 @@ const isDate = (value) => {
6872 return ( value != undefined && typeof value === 'object' && Object . prototype . toString . call ( value ) === '[object Date]' )
6973}
7074
75+ const isNumber = ( value ) => {
76+ return ( value != undefined && typeof value === 'number' )
77+ }
78+
7179const makeString = ( value , option ) => {
7280 if ( option && option . quotes === 'no' ) {
7381 return createString ( value , option ) . replace ( / [ " " ] / g, "" ) ;
Original file line number Diff line number Diff line change @@ -37,7 +37,6 @@ describe("test toString method", () => {
3737
3838 it ( "test number to string" , ( ) => {
3939 const str = makeString ( 25 ) ;
40- console . log ( JSON . stringify ( 25 ) ) ;
4140 expect ( str ) . to . be . a ( 'string' ) ;
4241 expect ( str ) . to . equal ( JSON . stringify ( 25 ) ) ;
4342 } ) ;
You can’t perform that action at this time.
0 commit comments