indicative-compiler
Version:
Indicative compiler to compile parsed schema into highly optimized functions
23 lines (22 loc) • 671 B
TypeScript
/**
* @module compiler/sanitizer
*/
import { Schema } from 'indicative-parser';
import { ArrayWrapper } from './ArrayWrapper';
import { SanitizationDefinition } from '../Contracts';
import { SanitizationsRunner } from './SanitizationsRunner';
/**
* Compiles rules and messages schema to an array of top level
* functions highly optimized for speed.
*/
export declare class Compiler {
private sanitizations;
private parsedSchema;
constructor(schema: Schema, sanitizations: {
[key: string]: SanitizationDefinition;
});
/**
* Compiles the schema to an array of functions
*/
compile(): (SanitizationsRunner | ArrayWrapper)[];
}