@dereekb/model 9.24.31 → 9.24.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [9.24.32](https://github.com/dereekb/dbx-components/compare/v9.24.31-dev...v9.24.32) (2023-08-18)
6
+
7
+
8
+
5
9
  ## [9.24.31](https://github.com/dereekb/dbx-components/compare/v9.24.30-dev...v9.24.31) (2023-08-17)
6
10
 
7
11
 
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@dereekb/model",
3
- "version": "9.24.31",
3
+ "version": "9.24.32",
4
4
  "type": "commonjs",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
7
7
  "dependencies": {},
8
8
  "peerDependencies": {
9
9
  "class-validator": "^0.13.2",
10
- "@dereekb/util": "9.24.31",
10
+ "@dereekb/util": "9.24.32",
11
11
  "lodash.isequal": "^4.5.0",
12
12
  "make-error": "^1.3.0",
13
13
  "ts-essentials": "^9.1.2",
@@ -1,2 +1,3 @@
1
1
  export * from './date';
2
2
  export * from './phone';
3
+ export * from './url';
@@ -3,4 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./date"), exports);
5
5
  tslib_1.__exportStar(require("./phone"), exports);
6
+ tslib_1.__exportStar(require("./url"), exports);
6
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/model/src/lib/validator/index.ts"],"names":[],"mappings":";;;AAAA,iDAAuB;AACvB,kDAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/model/src/lib/validator/index.ts"],"names":[],"mappings":";;;AAAA,iDAAuB;AACvB,kDAAwB;AACxB,gDAAsB"}
@@ -0,0 +1,10 @@
1
+ import { ObjectWithConstructor } from '@dereekb/util';
2
+ import { ValidationOptions } from 'class-validator';
3
+ /**
4
+ * isWebsiteUrl validator
5
+ */
6
+ export declare function IsWebsiteUrl(validationOptions?: ValidationOptions): (object: ObjectWithConstructor, propertyName: string) => void;
7
+ /**
8
+ * isWebsiteUrlWithPrefix validator
9
+ */
10
+ export declare function IsWebsiteUrlWithPrefix(validationOptions?: ValidationOptions): (object: ObjectWithConstructor, propertyName: string) => void;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IsWebsiteUrlWithPrefix = exports.IsWebsiteUrl = void 0;
4
+ const util_1 = require("@dereekb/util");
5
+ const class_validator_1 = require("class-validator");
6
+ /**
7
+ * isWebsiteUrl validator
8
+ */
9
+ function IsWebsiteUrl(validationOptions) {
10
+ return function (object, propertyName) {
11
+ (0, class_validator_1.registerDecorator)({
12
+ name: 'isWebsiteUrl',
13
+ target: object.constructor,
14
+ propertyName: propertyName,
15
+ options: validationOptions,
16
+ validator: {
17
+ validate: util_1.isWebsiteUrl,
18
+ defaultMessage(args) {
19
+ return `"${args.value}" is not a valid website url`;
20
+ }
21
+ }
22
+ });
23
+ };
24
+ }
25
+ exports.IsWebsiteUrl = IsWebsiteUrl;
26
+ /**
27
+ * isWebsiteUrlWithPrefix validator
28
+ */
29
+ function IsWebsiteUrlWithPrefix(validationOptions) {
30
+ return function (object, propertyName) {
31
+ (0, class_validator_1.registerDecorator)({
32
+ name: 'isWebsiteUrlWithPrefix',
33
+ target: object.constructor,
34
+ propertyName: propertyName,
35
+ options: validationOptions,
36
+ validator: {
37
+ validate: util_1.isWebsiteUrlWithPrefix,
38
+ defaultMessage(args) {
39
+ return `"${args.value}" is not a valid website url with a http/https prefix.`;
40
+ }
41
+ }
42
+ });
43
+ };
44
+ }
45
+ exports.IsWebsiteUrlWithPrefix = IsWebsiteUrlWithPrefix;
46
+ //# sourceMappingURL=url.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url.js","sourceRoot":"","sources":["../../../../../../packages/model/src/lib/validator/url.ts"],"names":[],"mappings":";;;AAAA,wCAA4F;AAC5F,qDAA4F;AAE5F;;GAEG;AACH,SAAgB,YAAY,CAAC,iBAAqC;IAChE,OAAO,UAAU,MAA6B,EAAE,YAAoB;QAClE,IAAA,mCAAiB,EAAC;YAChB,IAAI,EAAE,cAAc;YACpB,MAAM,EAAE,MAAM,CAAC,WAAW;YAC1B,YAAY,EAAE,YAAY;YAC1B,OAAO,EAAE,iBAAiB;YAC1B,SAAS,EAAE;gBACT,QAAQ,EAAE,mBAAY;gBACtB,cAAc,CAAC,IAAyB;oBACtC,OAAO,IAAI,IAAI,CAAC,KAAK,8BAA8B,CAAC;gBACtD,CAAC;aACF;SACF,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAfD,oCAeC;AAED;;GAEG;AACH,SAAgB,sBAAsB,CAAC,iBAAqC;IAC1E,OAAO,UAAU,MAA6B,EAAE,YAAoB;QAClE,IAAA,mCAAiB,EAAC;YAChB,IAAI,EAAE,wBAAwB;YAC9B,MAAM,EAAE,MAAM,CAAC,WAAW;YAC1B,YAAY,EAAE,YAAY;YAC1B,OAAO,EAAE,iBAAiB;YAC1B,SAAS,EAAE;gBACT,QAAQ,EAAE,6BAAsB;gBAChC,cAAc,CAAC,IAAyB;oBACtC,OAAO,IAAI,IAAI,CAAC,KAAK,wDAAwD,CAAC;gBAChF,CAAC;aACF;SACF,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAfD,wDAeC"}