File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -37,14 +37,15 @@ export default async function singleFeatureProcess(data) {
3737 ] )
3838
3939 if ( answers . feature == answers . label ) {
40- print ( chalk . bgMagenta ( ' Feature and label can not be same') )
40+ print ( chalk . redBright ( '\n[!] Feature and label can not be same') )
4141
4242 if ( await confirm ( { message : 'Back?' } ) ) return ;
4343 }
4444
4545
46+ const numberPattern = / ^ [ + - ] ? \d + ( \. \d + ) ? $ /
4647 for ( const item of data ) {
47- if ( ! Number . isNaN ( item [ answers . feature ] ) || ! Number . isNaN ( item [ answers . label ] ) ) {
48+ if ( ! numberPattern . test ( item [ answers . feature ] ) || ! numberPattern . test ( item [ answers . label ] ) ) {
4849 print ( chalk . redBright ( '\n[!] Some data is not a number! Unable to process further!' ) )
4950 await confirm ( { message : 'Continue?' } )
5051 return ;
You can’t perform that action at this time.
0 commit comments