ant-design-vue/components/_util/_cssinjs/linters/NaNLinter.ts

11 lines
318 B
TypeScript

import type { Linter } from './interface';
import { lintWarning } from './utils';
const linter: Linter = (key, value, info) => {
if ((typeof value === 'string' && /NaN/g.test(value)) || Number.isNaN(value)) {
lintWarning(`Unexpected 'NaN' in property '${key}: ${value}'.`, info);
}
};
export default linter;