Home Reference Source Test

Function

Static Public Summary
public

HTTP(method: String, path: String, contentType: String): function(meta: DecoratorDescriptor): void

Hookable decorator for RESTful API

public

HTTP_URL(value: *, key: String, data: Model)

public

IPA(value: *, key: String, data: Model)

Validator for IP address

public

IPv4(value: *, key: String, data: Model)

public

IPv6(value: *, key: String, data: Model)

public
public

is(condition: Function | RegExp | Array | ModelValueHandler, defaultValue: *): function(meta: DecoratorDescriptor): void

Field Decorator to validate the value of Setter

public
public

listen(name: String, handler: function(data: Object): void)

Hook listener

public

Class Decorator to set same name Getters of existed Setters

public

trigger(name: String, data: Object)

Hook trigger

public

typeOf(object: *): String

public

* walkPrototype(object: *)

Static Public

public HTTP(method: String, path: String, contentType: String): function(meta: DecoratorDescriptor): void source

Hookable decorator for RESTful API

Params:

NameTypeAttributeDescription
method String
path String
contentType String
  • optional
  • default: 'application/json'

Return:

function(meta: DecoratorDescriptor): void

Test:

public HTTP_URL(value: *, key: String, data: Model) source

import {HTTP_URL} from 'data-scheme/source/scheme/index.js'

Params:

NameTypeAttributeDescription
value *
key String
data Model

Test:

public IPA(value: *, key: String, data: Model) source

Validator for IP address

Params:

NameTypeAttributeDescription
value *
key String
data Model

public IPv4(value: *, key: String, data: Model) source

Params:

NameTypeAttributeDescription
value *
key String
data Model

Test:

public IPv6(value: *, key: String, data: Model) source

Params:

NameTypeAttributeDescription
value *
key String
data Model

Test:

public Range(min: Number, max: Number, step: Number): ModelValueHandler source

Params:

NameTypeAttributeDescription
min Number
  • optional
  • default: -Infinity
max Number
  • optional
  • default: +Infinity
step Number
  • optional
  • default: 1

Test:

public is(condition: Function | RegExp | Array | ModelValueHandler, defaultValue: *): function(meta: DecoratorDescriptor): void source

Field Decorator to validate the value of Setter

Params:

NameTypeAttributeDescription
condition Function | RegExp | Array | ModelValueHandler
defaultValue *
  • optional

Return:

function(meta: DecoratorDescriptor): void

Test:

public isClass(func: Function): Boolean source

import {isClass} from 'data-scheme/source/utility/index.js'

Params:

NameTypeAttributeDescription
func Function

Return:

Boolean

public listen(name: String, handler: function(data: Object): void) source

import {listen} from 'data-scheme/source/hook/index.js'

Hook listener

Params:

NameTypeAttributeDescription
name String
handler function(data: Object): void

Test:

public mapGetter(meta: DecoratorDescriptor) source

import {mapGetter} from 'data-scheme/source/Model.js'

Class Decorator to set same name Getters of existed Setters

Params:

NameTypeAttributeDescription
meta DecoratorDescriptor

Test:

public trigger(name: String, data: Object) source

import {trigger} from 'data-scheme/source/hook/index.js'

Hook trigger

Params:

NameTypeAttributeDescription
name String
data Object

Test:

public typeOf(object: *): String source

Params:

NameTypeAttributeDescription
object *

Return:

String

Class name

public * walkPrototype(object: *) source

import {walkPrototype} from 'data-scheme/source/utility/index.js'

Params:

NameTypeAttributeDescription
object *