@anzenjs/extra
Advanced tools
Comparing version 0.0.4-alpha.0 to 0.0.4-alpha.1
import { ResolveBrand } from '@anzenjs/core'; | ||
declare const emailSymbol: unique symbol; | ||
export declare const emailSchema: import("../../core/src").IBrandSchema<string, typeof emailSymbol, true> & import("../../core/src").BrandDecorator<import("../../core/src").IBrandSchema<string, typeof emailSymbol, true>>; | ||
export declare type Email = ResolveBrand<typeof emailSchema>; | ||
declare const uriSymbol: unique symbol; | ||
export declare const uriSchema: import("../../core/src").IBrandSchema<string, typeof uriSymbol, true> & import("../../core/src").BrandDecorator<import("../../core/src").IBrandSchema<string, typeof uriSymbol, true>>; | ||
export declare type Uri = ResolveBrand<typeof uriSchema>; | ||
declare const integerSymbol: unique symbol; | ||
export declare const integerSchema: import("../../core/src").IBrandSchema<number, typeof integerSymbol, true> & import("../../core/src").BrandDecorator<import("../../core/src").IBrandSchema<number, typeof integerSymbol, true>>; | ||
export declare type Integer = ResolveBrand<typeof integerSchema>; | ||
declare const portSymbol: unique symbol; | ||
export declare const portSchema: import("../../core/src").IBrandSchema<any, typeof portSymbol, true> & import("../../core/src").BrandDecorator<import("../../core/src").IBrandSchema<any, typeof portSymbol, true>>; | ||
export declare type Port = ResolveBrand<typeof portSchema>; | ||
declare const ipSymbol: unique symbol; | ||
export declare const ipSchema: import("../../core/src").IBrandSchema<string, typeof ipSymbol, true> & import("../../core/src").BrandDecorator<import("../../core/src").IBrandSchema<string, typeof ipSymbol, true>>; | ||
export declare type Ip = ResolveBrand<typeof ipSchema>; | ||
declare const hostnameSymbol: unique symbol; | ||
export declare const hostnameSchema: import("../../core/src").IBrandSchema<string, typeof hostnameSymbol, true> & import("../../core/src").BrandDecorator<import("../../core/src").IBrandSchema<string, typeof hostnameSymbol, true>>; | ||
export declare type Hostname = ResolveBrand<typeof hostnameSchema>; | ||
declare const uuidSymbol: unique symbol; | ||
export declare const uuidSchema: import("../../core/src").IBrandSchema<string, typeof uuidSymbol, true> & import("../../core/src").BrandDecorator<import("../../core/src").IBrandSchema<string, typeof uuidSymbol, true>>; | ||
export declare type Uuid = ResolveBrand<typeof uuidSchema>; | ||
export declare const emailSymbol: unique symbol; | ||
export declare const Email: import("../../core/src").IBrandSchema<string, typeof emailSymbol, true> & import("../../core/src").BrandDecorator<import("../../core/src").IBrandSchema<string, typeof emailSymbol, true>>; | ||
export declare type Email = ResolveBrand<typeof Email>; | ||
export declare const uriSymbol: unique symbol; | ||
export declare const Uri: import("../../core/src").IBrandSchema<string, typeof uriSymbol, true> & import("../../core/src").BrandDecorator<import("../../core/src").IBrandSchema<string, typeof uriSymbol, true>>; | ||
export declare type Uri = ResolveBrand<typeof Uri>; | ||
export declare const integerSymbol: unique symbol; | ||
export declare const Integer: import("../../core/src").IBrandSchema<number, typeof integerSymbol, true> & import("../../core/src").BrandDecorator<import("../../core/src").IBrandSchema<number, typeof integerSymbol, true>>; | ||
export declare type Integer = ResolveBrand<typeof Integer>; | ||
export declare const portSymbol: unique symbol; | ||
export declare const Port: import("../../core/src").IBrandSchema<any, typeof portSymbol, true> & import("../../core/src").BrandDecorator<import("../../core/src").IBrandSchema<any, typeof portSymbol, true>>; | ||
export declare type Port = ResolveBrand<typeof Port>; | ||
export declare const ipSymbol: unique symbol; | ||
export declare const Ip: import("../../core/src").IBrandSchema<string, typeof ipSymbol, true> & import("../../core/src").BrandDecorator<import("../../core/src").IBrandSchema<string, typeof ipSymbol, true>>; | ||
export declare type Ip = ResolveBrand<typeof Ip>; | ||
export declare const hostnameSymbol: unique symbol; | ||
export declare const Hostname: import("../../core/src").IBrandSchema<string, typeof hostnameSymbol, true> & import("../../core/src").BrandDecorator<import("../../core/src").IBrandSchema<string, typeof hostnameSymbol, true>>; | ||
export declare type Hostname = ResolveBrand<typeof Hostname>; | ||
export declare const uuidSymbol: unique symbol; | ||
export declare const Uuid: import("../../core/src").IBrandSchema<string, typeof uuidSymbol, true> & import("../../core/src").BrandDecorator<import("../../core/src").IBrandSchema<string, typeof uuidSymbol, true>>; | ||
export declare type Uuid = ResolveBrand<typeof Uuid>; | ||
export { IEncoder, IDecoder, ICodec } from './codec'; | ||
export { Id } from './id'; | ||
//# sourceMappingURL=index.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const core_1 = require("@anzenjs/core"); | ||
const emailSymbol = Symbol('email'); | ||
exports.emailSchema = core_1.Brand(String, emailSymbol); | ||
const uriSymbol = Symbol('uri'); | ||
exports.uriSchema = core_1.Brand(String, uriSymbol); | ||
const integerSymbol = Symbol('integer'); | ||
exports.integerSchema = core_1.Brand(Number, integerSymbol); | ||
const portSymbol = Symbol('port'); | ||
exports.portSchema = core_1.Brand(exports.integerSchema, portSymbol); | ||
const ipSymbol = Symbol('ip'); | ||
exports.ipSchema = core_1.Brand(String, ipSymbol); | ||
const hostnameSymbol = Symbol('hostname'); | ||
exports.hostnameSchema = core_1.Brand(String, hostnameSymbol); | ||
const uuidSymbol = Symbol('uuid'); | ||
exports.uuidSchema = core_1.Brand(String, uuidSymbol); | ||
exports.emailSymbol = Symbol('email'); | ||
exports.Email = core_1.Brand(String, exports.emailSymbol); | ||
exports.uriSymbol = Symbol('uri'); | ||
exports.Uri = core_1.Brand(String, exports.uriSymbol); | ||
exports.integerSymbol = Symbol('integer'); | ||
exports.Integer = core_1.Brand(Number, exports.integerSymbol); | ||
exports.portSymbol = Symbol('port'); | ||
exports.Port = core_1.Brand(exports.Integer, exports.portSymbol); | ||
exports.ipSymbol = Symbol('ip'); | ||
exports.Ip = core_1.Brand(String, exports.ipSymbol); | ||
exports.hostnameSymbol = Symbol('hostname'); | ||
exports.Hostname = core_1.Brand(String, exports.hostnameSymbol); | ||
exports.uuidSymbol = Symbol('uuid'); | ||
exports.Uuid = core_1.Brand(String, exports.uuidSymbol); | ||
var id_1 = require("./id"); | ||
exports.Id = id_1.Id; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@anzenjs/extra", | ||
"version": "0.0.4-alpha.0", | ||
"version": "0.0.4-alpha.1", | ||
"main": "cjs/src/index.js", | ||
@@ -15,3 +15,3 @@ "types": "cjs/src/index.d.ts", | ||
}, | ||
"gitHead": "0f9659432114ef764fc951c1c1326f8e6c6da99f" | ||
"gitHead": "5022259a40c0508dae37df5404853765c18200dd" | ||
} |
@@ -1,9 +0,9 @@ | ||
import { Resolve, Schema } from '@anzenjs/core' | ||
import { Resolve, SchemaLike } from '@anzenjs/core' | ||
export interface IEncoder<O extends unknown> { | ||
encode<S extends Schema>(schema: S): (value: Resolve<S>) => O | ||
encode<S extends SchemaLike>(schema: S): (value: Resolve<S>) => O | ||
} | ||
export interface IDecoder<I extends unknown> { | ||
decode<S extends Schema>(schema: S): (value: I) => Resolve<S> | ||
decode<S extends SchemaLike>(schema: S): (value: I) => Resolve<S> | ||
} | ||
@@ -10,0 +10,0 @@ |
@@ -11,5 +11,5 @@ import { Brand, ResolveBrand } from '@anzenjs/core' | ||
export const uriSchema = Brand(String, uriSymbol) | ||
export const Uri = Brand(String, uriSymbol) | ||
export type Uri = ResolveBrand<typeof uriSchema> | ||
export type Uri = ResolveBrand<typeof Uri> | ||
@@ -47,1 +47,3 @@ export const integerSymbol = Symbol('integer') | ||
export { IEncoder, IDecoder, ICodec } from './codec' | ||
export { Id } from './id' |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11992
18
136