How to use the @inkline/inkline/src/validators/number.number function in @inkline/inkline

To help you get started, we’ve selected a few @inkline/inkline examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github inkline / inkline / tests / unit / validators / number.spec.js View on Github external
it('should return false for characters other than 0-9', () => {
            expect(number('-a10.99', {
                allowNegative: true,
                allowDecimal: true
            })).toEqual(false);
        });
github inkline / inkline / tests / unit / validators / number.spec.js View on Github external
it('should return true if all array entries are decimal', () => {
            expect(number(['10', '10.99', '-10', '-10.99'], {
                allowNegative: true,
                allowDecimal: true
            })).toEqual(true);
        });
github inkline / inkline / tests / unit / validators / number.spec.js View on Github external
it('should return true for positive int', () => {
            expect(number('10')).toEqual(true);
        });
github inkline / inkline / tests / unit / validators / number.spec.js View on Github external
it('should return true for positive float', () => {
            expect(number('10.99', { allowDecimal: true })).toEqual(true);
        });
github inkline / inkline / tests / unit / validators / number.spec.js View on Github external
it('should return true negative int', () => {
            expect(number('-10', { allowNegative: true })).toEqual(true);
        });
github inkline / inkline / tests / unit / validators / number.spec.js View on Github external
it('should return true negative float', () => {
            expect(number('-10.99', {
                allowNegative: true,
                allowDecimal: true
            })).toEqual(true);
        });