We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 350c3df commit a889ebaCopy full SHA for a889eba
1 file changed
src/cli/single-feature.js
@@ -37,14 +37,15 @@ export default async function singleFeatureProcess(data) {
37
])
38
39
if (answers.feature == answers.label) {
40
- print(chalk.bgMagenta('Feature and label can not be same'))
+ print(chalk.redBright('\n[!] Feature and label can not be same'))
41
42
if (await confirm({ message: 'Back?'})) return;
43
}
44
45
46
+ const numberPattern = /^[+-]?\d+(\.\d+)?$/
47
for (const item of data) {
- if (!Number.isNaN(item[answers.feature]) || !Number.isNaN(item[answers.label])) {
48
+ if (!numberPattern.test(item[answers.feature]) || !numberPattern.test(item[answers.label])) {
49
print(chalk.redBright('\n[!] Some data is not a number! Unable to process further!'))
50
await confirm({ message: 'Continue?'})
51
return;
0 commit comments