import type AjvCore from "../dist/core" ; import type { Options } from ".." ; import AjvPack from "../dist/standalone/instance" ; export function withStandalone ( instances ) { return [ ... ( instances as ( AjvCore | AjvPack ) [ ] ) , ... instances . map ( makeStandalone ) ] ; } function makeStandalone ( ajv ) { ajv . opts . code . source = true ; return new AjvPack ( ajv ) ; } export function getStandalone ( _Ajv , opts = { } ) { opts . code ||= { } ; opts . code . source = true ; return new AjvPack ( new _Ajv ( opts ) ) ; }