4 Commits

Author SHA1 Message Date
8766f43366 1.0.4 2022-08-03 22:06:35 +02:00
725c88b5a1 fix(core): update 2022-08-03 22:06:34 +02:00
0c0a6f61d6 1.0.3 2022-07-08 12:31:44 +02:00
5d78b27eed fix(core): update 2022-07-08 12:31:44 +02:00
5 changed files with 27 additions and 5 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@pushrocks/smartvalidator",
"version": "1.0.2",
"version": "1.0.4",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@pushrocks/smartvalidator",
"version": "1.0.2",
"version": "1.0.4",
"license": "MIT",
"dependencies": {
"@types/validator": "^13.7.4",

View File

@@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartvalidator",
"version": "1.0.2",
"version": "1.0.4",
"private": false,
"description": "a wrapper for the validator package to perform validations",
"main": "dist_ts/index.js",

View File

@@ -10,6 +10,11 @@ tap.test('first test', async () => {
tap.test('should check an IBAN', async () => {
expect(testValidator.isIban('AT95 0100 0000 0555 4915')).toBeTrue();
});
tap.test('escape email', async () => {
const escapedEmail = testValidator.escape('test@example.com');
console.log(escapedEmail);
})
tap.start();

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@pushrocks/smartvalidator',
version: '1.0.2',
version: '1.0.4',
description: 'a wrapper for the validator package to perform validations'
}

View File

@@ -8,4 +8,21 @@ export class SmartValidator {
public isIban(stringArg: string) {
return plugins.validator.isIBAN(stringArg);
}
}
public escape(stringArg: string) {
return plugins.validator.escape(stringArg);
}
public isUrl(stringArg: string) {
return plugins.validator.isURL(stringArg);
}
/**
* might be buggy. TODO: Improve.
* @param stringArg
* @returns
*/
public isCsv(stringArg: string) {
return stringArg.split(',').length > 4 || stringArg.split(';').length > 4;
}
}