import { log, time } from '../common'; import { Schema } from '..'; const timer = time.timer(); const schema = Schema.compile({ files: 'types/index.ts', basePath: './src/example', required: true, strictNullChecks: true, }); log.info('elapsed', timer.elapsed()); log.info('-------------------------------------------\n'); timer.reset(); const foo = schema.forType('IFoo'); log.info('foo:', foo); log.info('elapsed', timer.elapsed()); log.info('-------------------------------------------\n'); const isValid = foo.validate({ name: 'Bob', age: 31 }); const isNotValid = foo.validate({ name: true }); log.info('isValid:', isValid); log.info('isNotValid:', isNotValid); log.info('elapsed', timer.elapsed()); log.info('-------------------------------------------\n');