UNPKG

@rustable/type

Version:

A TypeScript implementation of Rust-like type system with generic support and runtime type information.

17 lines (15 loc) 304 B
"use strict"; function derive(fns) { return (target) => { if (Array.isArray(fns)) { fns.forEach((fn) => fn(target)); } else { fns(target); } return target; }; } function applyMacros(macros) { return (target) => derive(macros)(target); } export { applyMacros, derive };