1.1.3 • Published 2 years ago

@galaxar/types v1.1.3

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Semantic Types

Conventions

Type Interface

name: "type name",
alias: ["type alias"],
defaultValue: null,

sanitize: (value, meta, i18n, path) => sanitized,
serialize: (value, meta) => string

Common Type Meta

  • {boolean} rawValue - Keep raw value, do not transform
  • {boolean} optional - No error throw if value is null and default is null
  • {any} default = Default value if value is null

Enumerable Types

  • bigint
  • integer
  • number
  • text

Validation Error

  • message
  • status = 400
  • code = E_INVALID_DATA
  • info = { value, meta, i18n, path }

Plugins

Note: if preProcess or postProcess is async function, sanitize_ should be called instead of sanitize

1.1.3

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.1.2

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago