Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8766f43366 | |||
| 725c88b5a1 |
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@pushrocks/smartvalidator",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.4",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@pushrocks/smartvalidator",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.4",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/validator": "^13.7.4",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pushrocks/smartvalidator",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.4",
|
||||
"private": false,
|
||||
"description": "a wrapper for the validator package to perform validations",
|
||||
"main": "dist_ts/index.js",
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
|
||||
13
ts/index.ts
13
ts/index.ts
@@ -12,4 +12,17 @@ export class SmartValidator {
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user