File tree 3 files changed +15
-1
lines changed
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) => {
19
19
return '' + value ;
20
20
}
21
21
22
+ if ( isNumber ( value ) ) {
23
+ return '' + value ;
24
+ }
25
+
22
26
if ( Array . isArray ( value ) ) {
23
27
option . seperator = option . seperator || ',' ;
24
28
return option . braces === "true" ? '[' + value . map ( ( val ) => {
@@ -68,6 +72,10 @@ const isDate = (value) => {
68
72
return ( value != undefined && typeof value === 'object' && Object . prototype . toString . call ( value ) === '[object Date]' )
69
73
}
70
74
75
+ const isNumber = ( value ) => {
76
+ return ( value != undefined && typeof value === 'number' )
77
+ }
78
+
71
79
const makeString = ( value , option ) => {
72
80
if ( option && option . quotes === 'no' ) {
73
81
return createString ( value , option ) . replace ( / [ " " ] / g, "" ) ;
Original file line number Diff line number Diff line change @@ -37,7 +37,6 @@ describe("test toString method", () => {
37
37
38
38
it ( "test number to string" , ( ) => {
39
39
const str = makeString ( 25 ) ;
40
- console . log ( JSON . stringify ( 25 ) ) ;
41
40
expect ( str ) . to . be . a ( 'string' ) ;
42
41
expect ( str ) . to . equal ( JSON . stringify ( 25 ) ) ;
43
42
} ) ;
You can’t perform that action at this time.
0 commit comments