chore: update node_modules with new binary files and dependencies

- Add new binary files for nodemon, onnxruntime-web, and xenova/transformers
- Update various JavaScript and TypeScript files in node_modules
- Remove unused files and dependencies
- Add new test fixtures and documentation files
This commit is contained in:
你的名字
2025-07-18 08:41:48 +08:00
parent db8c0adc79
commit 4c2f5c69a1
4655 changed files with 811329 additions and 35112 deletions

View File

@@ -0,0 +1,53 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
const INLINE_FUNC_DEF_REGEX = /@inline[\s\n\r]+(\w+)[\s\n\r]+([0-9a-zA-Z_]+)\s*\(([^)]*)\)\s*{(([^}]|[\n\r])*)}/gm;
const FUNC_CALL_REGEX = '(\\w+)?\\s+([_0-9a-zA-Z]+)\\s+=\\s+__FUNC__\\((.*)\\)\\s*;';
/**
* GLSL preprocessor responsible for resolving @inline directives
*/
export function replaceInlines(script: string): string {
const inlineDefs: {[name: string]: {params: Array<{type: string; name: string}|null>; body: string}} = {};
let match;
while ((match = INLINE_FUNC_DEF_REGEX.exec(script)) !== null) {
const params = match[3]
.split(',')
.map(s => {
const tokens = s.trim().split(' ');
if (tokens && tokens.length === 2) {
return {type: tokens[0], name: tokens[1]};
}
return null;
})
.filter(v => v !== null);
inlineDefs[match[2]] = {params, body: match[4]};
}
for (const name in inlineDefs) {
const regexString = FUNC_CALL_REGEX.replace('__FUNC__', name);
const regex = new RegExp(regexString, 'gm');
while ((match = regex.exec(script)) !== null) {
const type = match[1];
const variable = match[2];
const params = match[3].split(',');
const declLine = (type) ? `${type} ${variable};` : '';
let newBody: string = inlineDefs[name].body;
let paramRedecLine = '';
inlineDefs[name].params.forEach((v, i) => {
if (v) {
paramRedecLine += `${v.type} ${v.name} = ${params[i]};\n`;
}
});
newBody = `${paramRedecLine}\n ${newBody}`;
newBody = newBody.replace('return', `${variable} = `);
const replacement = `
${declLine}
{
${newBody}
}
`;
script = script.replace(match[0], replacement);
}
}
script = script.replace(INLINE_FUNC_DEF_REGEX, '');
return script;
}