@opra/common 1.25.3 → 1.25.5
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/browser.js +4 -4
- package/document/data-type/extended-types/index.d.ts +2 -0
- package/document/data-type/extended-types/index.js +2 -0
- package/document/data-type/extended-types/mobile-phone.type.d.ts +1 -0
- package/document/data-type/extended-types/mobile-phone.type.js +11 -2
- package/package.json +1 -1
- package/document/data-type/extended-types/passport-number.type.d.ts +0 -8
- package/document/data-type/extended-types/passport-number.type.js +0 -39
- package/document/data-type/extended-types/vat-number.type.d.ts +0 -8
- package/document/data-type/extended-types/vat-number.type.js +0 -39
|
@@ -3,11 +3,13 @@ export * from './credit-card.type.js';
|
|
|
3
3
|
export * from './date.type.js';
|
|
4
4
|
export * from './date-time.type.js';
|
|
5
5
|
export * from './date-time-tz.type.js';
|
|
6
|
+
export * from './ean.type.js';
|
|
6
7
|
export * from './email.type.js';
|
|
7
8
|
export * from './field-path.type.js';
|
|
8
9
|
export * from './filter.type.js';
|
|
9
10
|
export * from './iban.type.js';
|
|
10
11
|
export * from './ip.type.js';
|
|
12
|
+
export * from './mobile-phone.type.js';
|
|
11
13
|
export * from './object-id.type.js';
|
|
12
14
|
export * from './operation-result.type.js';
|
|
13
15
|
export * from './time.type.js';
|
|
@@ -3,11 +3,13 @@ export * from './credit-card.type.js';
|
|
|
3
3
|
export * from './date.type.js';
|
|
4
4
|
export * from './date-time.type.js';
|
|
5
5
|
export * from './date-time-tz.type.js';
|
|
6
|
+
export * from './ean.type.js';
|
|
6
7
|
export * from './email.type.js';
|
|
7
8
|
export * from './field-path.type.js';
|
|
8
9
|
export * from './filter.type.js';
|
|
9
10
|
export * from './iban.type.js';
|
|
10
11
|
export * from './ip.type.js';
|
|
12
|
+
export * from './mobile-phone.type.js';
|
|
11
13
|
export * from './object-id.type.js';
|
|
12
14
|
export * from './operation-result.type.js';
|
|
13
15
|
export * from './time.type.js';
|
|
@@ -3,6 +3,7 @@ import { DECODER, ENCODER } from '../../constants.js';
|
|
|
3
3
|
export declare class MobilePhoneType {
|
|
4
4
|
constructor(attributes?: Partial<MobilePhoneType>);
|
|
5
5
|
locale?: vg.isMobilePhone.MobilePhoneLocale;
|
|
6
|
+
strictMode?: boolean;
|
|
6
7
|
protected [DECODER](properties?: Partial<this>): Validator;
|
|
7
8
|
protected [ENCODER](properties?: Partial<this>): Validator;
|
|
8
9
|
}
|
|
@@ -8,16 +8,19 @@ let MobilePhoneType = class MobilePhoneType {
|
|
|
8
8
|
Object.assign(this, attributes);
|
|
9
9
|
}
|
|
10
10
|
locale;
|
|
11
|
+
strictMode;
|
|
11
12
|
[DECODER](properties) {
|
|
12
13
|
return vg.isMobilePhone({
|
|
13
14
|
coerce: true,
|
|
14
|
-
locale: properties?.locale || '
|
|
15
|
+
locale: properties?.locale || 'any',
|
|
16
|
+
strictMode: properties?.strictMode ?? true,
|
|
15
17
|
});
|
|
16
18
|
}
|
|
17
19
|
[ENCODER](properties) {
|
|
18
20
|
return vg.isMobilePhone({
|
|
19
21
|
coerce: true,
|
|
20
|
-
locale: properties?.locale || '
|
|
22
|
+
locale: properties?.locale || 'any',
|
|
23
|
+
strictMode: properties?.strictMode ?? true,
|
|
21
24
|
});
|
|
22
25
|
}
|
|
23
26
|
};
|
|
@@ -27,6 +30,12 @@ __decorate([
|
|
|
27
30
|
}),
|
|
28
31
|
__metadata("design:type", String)
|
|
29
32
|
], MobilePhoneType.prototype, "locale", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
SimpleType.Attribute({
|
|
35
|
+
description: 'If this is set to true, the mobile phone number must be supplied with the country code and therefore must start with +. Locale number',
|
|
36
|
+
}),
|
|
37
|
+
__metadata("design:type", Boolean)
|
|
38
|
+
], MobilePhoneType.prototype, "strictMode", void 0);
|
|
30
39
|
MobilePhoneType = __decorate([
|
|
31
40
|
SimpleType({
|
|
32
41
|
name: 'mobilephone',
|
package/package.json
CHANGED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type Validator } from 'valgen';
|
|
2
|
-
import { DECODER, ENCODER } from '../../constants.js';
|
|
3
|
-
export declare class PassportNumberType {
|
|
4
|
-
constructor(attributes?: Partial<PassportNumberType>);
|
|
5
|
-
countryCode?: string;
|
|
6
|
-
protected [DECODER](properties?: Partial<this>): Validator;
|
|
7
|
-
protected [ENCODER](properties?: Partial<this>): Validator;
|
|
8
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import { vg } from 'valgen';
|
|
3
|
-
import { DECODER, ENCODER } from '../../constants.js';
|
|
4
|
-
import { SimpleType } from '../simple-type.js';
|
|
5
|
-
let PassportNumberType = class PassportNumberType {
|
|
6
|
-
constructor(attributes) {
|
|
7
|
-
if (attributes)
|
|
8
|
-
Object.assign(this, attributes);
|
|
9
|
-
}
|
|
10
|
-
countryCode;
|
|
11
|
-
[DECODER](properties) {
|
|
12
|
-
return vg.isPassportNumber(properties?.countryCode || 'TR', {
|
|
13
|
-
coerce: true,
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
[ENCODER](properties) {
|
|
17
|
-
return vg.isPassportNumber(properties?.countryCode || 'TR', {
|
|
18
|
-
coerce: true,
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
__decorate([
|
|
23
|
-
SimpleType.Attribute({
|
|
24
|
-
description: 'Country code',
|
|
25
|
-
}),
|
|
26
|
-
__metadata("design:type", String)
|
|
27
|
-
], PassportNumberType.prototype, "countryCode", void 0);
|
|
28
|
-
PassportNumberType = __decorate([
|
|
29
|
-
SimpleType({
|
|
30
|
-
name: 'passportnumber',
|
|
31
|
-
description: 'A Passport Number',
|
|
32
|
-
nameMappings: {
|
|
33
|
-
js: 'string',
|
|
34
|
-
json: 'string',
|
|
35
|
-
},
|
|
36
|
-
}),
|
|
37
|
-
__metadata("design:paramtypes", [Object])
|
|
38
|
-
], PassportNumberType);
|
|
39
|
-
export { PassportNumberType };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type Validator, vg } from 'valgen';
|
|
2
|
-
import { DECODER, ENCODER } from '../../constants.js';
|
|
3
|
-
export declare class VatNumberType {
|
|
4
|
-
constructor(attributes?: Partial<VatNumberType>);
|
|
5
|
-
countryCode?: vg.isVATNumber.CountryCode;
|
|
6
|
-
protected [DECODER](properties?: Partial<this>): Validator;
|
|
7
|
-
protected [ENCODER](properties?: Partial<this>): Validator;
|
|
8
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import { vg } from 'valgen';
|
|
3
|
-
import { DECODER, ENCODER } from '../../constants.js';
|
|
4
|
-
import { SimpleType } from '../simple-type.js';
|
|
5
|
-
let VatNumberType = class VatNumberType {
|
|
6
|
-
constructor(attributes) {
|
|
7
|
-
if (attributes)
|
|
8
|
-
Object.assign(this, attributes);
|
|
9
|
-
}
|
|
10
|
-
countryCode;
|
|
11
|
-
[DECODER](properties) {
|
|
12
|
-
return vg.isVATNumber(properties?.countryCode || 'TR', {
|
|
13
|
-
coerce: true,
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
[ENCODER](properties) {
|
|
17
|
-
return vg.isVATNumber(properties?.countryCode || 'TR', {
|
|
18
|
-
coerce: true,
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
__decorate([
|
|
23
|
-
SimpleType.Attribute({
|
|
24
|
-
description: 'Country code',
|
|
25
|
-
}),
|
|
26
|
-
__metadata("design:type", String)
|
|
27
|
-
], VatNumberType.prototype, "countryCode", void 0);
|
|
28
|
-
VatNumberType = __decorate([
|
|
29
|
-
SimpleType({
|
|
30
|
-
name: 'vatnumber',
|
|
31
|
-
description: 'A VAT Number',
|
|
32
|
-
nameMappings: {
|
|
33
|
-
js: 'string',
|
|
34
|
-
json: 'string',
|
|
35
|
-
},
|
|
36
|
-
}),
|
|
37
|
-
__metadata("design:paramtypes", [Object])
|
|
38
|
-
], VatNumberType);
|
|
39
|
-
export { VatNumberType };
|