@opra/common
Version:
Opra common package
29 lines (28 loc) • 807 B
JavaScript
import { __decorate, __metadata } from "tslib";
import { vg } from 'valgen';
import { DECODER, ENCODER } from '../../constants.js';
import { SimpleType } from '../simple-type.js';
let UrlType = class UrlType {
constructor(attributes) {
if (attributes)
Object.assign(this, attributes);
}
[DECODER]() {
return vg.isURL({ coerce: true });
}
[ENCODER]() {
return vg.isURL({ coerce: true });
}
};
UrlType = __decorate([
(SimpleType({
name: 'url',
description: 'A Uniform Resource Identifier Reference (RFC 3986 icon) value',
nameMappings: {
js: 'string',
json: 'string',
},
}).Example('http://tempuri.org')),
__metadata("design:paramtypes", [Object])
], UrlType);
export { UrlType };