diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index e72808f..dd64c25 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@pushrocks/smartvalidator', - version: '1.0.3', + version: '1.0.4', description: 'a wrapper for the validator package to perform validations' } diff --git a/ts/index.ts b/ts/index.ts index 88cd01c..24b265b 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -12,4 +12,17 @@ export class SmartValidator { public escape(stringArg: string) { return plugins.validator.escape(stringArg); } -} \ No newline at end of file + + 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; + } +}