Skip to content
This repository was archived by the owner on Oct 20, 2021. It is now read-only.

Latest commit

 

History

History
31 lines (26 loc) · 1006 Bytes

ends-width.md

File metadata and controls

31 lines (26 loc) · 1006 Bytes

Ends With

Validates only if the value is at the end of the input.

Valid values:

validator.endsWith('foo').validate('Foo');
validator.endsWith('foo', true).validate('foo');
validator.endsWith('foo').validate('barbazFOO');
validator.endsWith('foo').validate('barbazfoo');
validator.endsWith('foo').validate('foobazfoo');
validator.endsWith('foo').validate(['bar', 'foo']);
validator.endsWith('1').validate([3, 2, 1]);
validator.endsWith('1', true).validate([3, 2, '1']);
validator.endsWith(1, true).validate([3, 2, 1]);

Invalid values:

validator.endsWith('foo').validate('');
validator.endsWith('bat').validate(['foo', 'bar']);
validator.endsWith('foo').validate('barfaabaz');
validator.endsWith('foo', true).validate('FOObarbaz');
validator.endsWith('foo').validate('faabarbaz');
validator.endsWith('foo').validate('baabazfaa');
validator.endsWith('foo').validate('baafoofaa');
validator.endsWith('1', true).validate([3, 2, 1]);
validator.endsWith(1, true).validate([3, 2, '1']);