DEPRECATED TypeScript library for runtime type validation and sanitization using decorators, version 2.61.2. Originally designed to secure web apps by validating route params, query strings, JSON bodies, and responses, plus schemaless database data. Offers AssertDelegate<> and sd.check<> for runtime enforcement with compile-time type inference via TypeOf<> and AcceptsOf<>. Deprecated in favor of type-mapping.
npm install schema-decoratorNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Illustrates basic usage of naturalNumber() assert delegate, runtime error on invalid input, and compile-time check with sd.check().
Replace with type-mapping (https://github.com/anyhowstep/type-mapping)
Use sd.naturalNumber()('field', value) instead of sd.naturalNumber()Use TypeScript for type inference; otherwise, rely on runtime checks.
Use 'import * as sd from 'schema-decorator'' then call sd.naturalNumber()
Ensure the value matches the expected type, or use the raw assert delegate (which allows any at compile time).
Add 'import * as sd from 'schema-decorator'' at top of file.
No dependency data recorded yet.