UNPKG

abstract-type

Version:

The abstract-type library includes the abstract `Type` class and `Value` class for streamable type info and validating value.

30 lines (24 loc) 730 B
inherits = require 'inherits-ex/lib/inherits' Attributes = require 'property-manager/lib/properties' module.exports = class TypeAttributes inherits TypeAttributes, Attributes @attrs: attrs = name: required: true enumerable: false exported: true assigned: true type: 'String' required: type: 'Boolean' customValidate: alias: ['custom-validate', 'validate'] type: 'function' constructor: (aOptions, nonExported1stChar)-> if not (this instanceof TypeAttributes) return new TypeAttributes aOptions, nonExported1stChar return super aOptions, nonExported1stChar _initialize: (aOptions)-> @merge(attrs) super(aOptions) return