Framework updates

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2026-03-04 23:20:19 +00:00
parent a89daf3d43
commit 3ed8517b2a
891 changed files with 11126 additions and 9600 deletions

5
node_modules/ajv/lib/ajv.d.ts generated vendored
View File

@@ -203,6 +203,11 @@ declare namespace ajv {
logger?: CustomLogger | false;
nullable?: boolean;
serialize?: ((schema: object | boolean) => any) | false;
regExp?: (pattern: string) => RegExpLike;
}
interface RegExpLike {
test: (s: string) => boolean;
}
type FormatValidator = string | RegExp | ((data: string) => boolean | PromiseLike<any>);

View File

@@ -42,6 +42,11 @@ function compile(schema, root, localRefs, baseId) {
, defaultsHash = {}
, customRules = [];
function patternCode(i, patterns) {
var regExpCode = opts.regExp ? 'regExp' : 'new RegExp';
return 'var pattern' + i + ' = ' + regExpCode + '(' + util.toQuotedString(patterns[i]) + ');';
}
root = root || { schema: schema, refVal: refVal, refs: refs };
var c = checkCompiling.call(this, schema, root, baseId);
@@ -128,6 +133,7 @@ function compile(schema, root, localRefs, baseId) {
'equal',
'ucs2length',
'ValidationError',
'regExp',
sourceCode
);
@@ -141,7 +147,8 @@ function compile(schema, root, localRefs, baseId) {
customRules,
equal,
ucs2length,
ValidationError
ValidationError,
opts.regExp
);
refVal[0] = validate;
@@ -358,11 +365,6 @@ function compIndex(schema, root, baseId) {
}
function patternCode(i, patterns) {
return 'var pattern' + i + ' = new RegExp(' + util.toQuotedString(patterns[i]) + ');';
}
function defaultCode(i) {
return 'var default' + i + ' = defaults[' + i + '];';
}

19
node_modules/ajv/lib/dot/pattern.jst generated vendored
View File

@@ -4,11 +4,22 @@
{{# def.$data }}
{{
var $regexp = $isData
? '(new RegExp(' + $schemaValue + '))'
: it.usePattern($schema);
var $regExpCode = it.opts.regExp ? 'regExp' : 'new RegExp';
}}
if ({{# def.$dataNotType:'string' }} !{{=$regexp}}.test({{=$data}}) ) {
{{? $isData }}
var {{=$valid}} = true;
try {
{{=$valid}} = {{=$regExpCode}}({{=$schemaValue}}).test({{=$data}});
} catch(e) {
{{=$valid}} = false;
}
if ({{# def.$dataNotType:'string' }} !{{=$valid}}) {
{{??}}
{{
var $regexp = it.usePattern($schema);
}}
if ({{# def.$dataNotType:'string' }} !{{=$regexp}}.test({{=$data}}) ) {
{{?}}
{{# def.error:'pattern' }}
} {{? $breakOnError }} else { {{?}}

View File

@@ -8,6 +8,7 @@ module.exports = function generate_pattern(it, $keyword, $ruleType) {
var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
var $breakOnError = !it.opts.allErrors;
var $data = 'data' + ($dataLvl || '');
var $valid = 'valid' + $lvl;
var $isData = it.opts.$data && $schema && $schema.$data,
$schemaValue;
if ($isData) {
@@ -16,12 +17,21 @@ module.exports = function generate_pattern(it, $keyword, $ruleType) {
} else {
$schemaValue = $schema;
}
var $regexp = $isData ? '(new RegExp(' + $schemaValue + '))' : it.usePattern($schema);
out += 'if ( ';
var $regExpCode = it.opts.regExp ? 'regExp' : 'new RegExp';
if ($isData) {
out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || ';
out += ' var ' + ($valid) + ' = true; try { ' + ($valid) + ' = ' + ($regExpCode) + '(' + ($schemaValue) + ').test(' + ($data) + '); } catch(e) { ' + ($valid) + ' = false; } if ( ';
if ($isData) {
out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || ';
}
out += ' !' + ($valid) + ') {';
} else {
var $regexp = it.usePattern($schema);
out += ' if ( ';
if ($isData) {
out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || ';
}
out += ' !' + ($regexp) + '.test(' + ($data) + ') ) {';
}
out += ' !' + ($regexp) + '.test(' + ($data) + ') ) { ';
var $$outStack = $$outStack || [];
$$outStack.push(out);
out = ''; /* istanbul ignore else */