typs.js
// checks if obj matches the provided regex
checks if obj matches the provided regex
checks if obj matches the provided regex
regex (regex) {
		if (!typs(regex).instanceOf(RegExp)) {
			throw new Error('typs().regex() expects a RegExp object as its first parameter');
		}
		return this.string().add((obj) => {
			return regex.test(obj);
		});
	}
regex ( regex ) { if ( ! typs ( regex ) . instanceOf ( RegExp ) ) { throw new Error ( 'typs().regex() expects a RegExp object as its first parameter' ) ; } return this . string ( ) . add ( ( obj ) => { return regex . test ( obj ) ; } ) ; }
checks if obj matches the provided regex
checks if obj matches the provided regex