Major changes: - New frontend (platform/web/): Vite + React 18 + TypeScript + Tailwind - 4-module navigation: 数据送标 / 模型管理 / 车队管理 / 系统管理 - Data catalog with charts (DMS/ADAS/Lane 3-tab view) - Quality review workflow (标注质检): Good/Fine/Bad scoring with auto-advance - Audit enhancements: batch operations, rejection categories, Feishu notifications - Operation audit log (操作日志) - World model simulation studio (仿真工坊) - Dataset version management with snapshots and diff - ADAS 7-class dataset integration (138K images organized + compressed) - User management with Feishu integration and pagination - CRUD/search/filter on all pages, card layout redesign - PIL-optimized image overlay rendering - Auto-snapshot on build, in_review workflow stage - Removed embedded algorithm code (now in workspace)
76 lines
1.6 KiB
JavaScript
76 lines
1.6 KiB
JavaScript
'use strict';
|
|
|
|
var isGlob = require('is-glob');
|
|
var pathPosixDirname = require('path').posix.dirname;
|
|
var isWin32 = require('os').platform() === 'win32';
|
|
|
|
var slash = '/';
|
|
var backslash = /\\/g;
|
|
var escaped = /\\([!*?|[\](){}])/g;
|
|
|
|
/**
|
|
* @param {string} str
|
|
* @param {Object} opts
|
|
* @param {boolean} [opts.flipBackslashes=true]
|
|
*/
|
|
module.exports = function globParent(str, opts) {
|
|
var options = Object.assign({ flipBackslashes: true }, opts);
|
|
|
|
// flip windows path separators
|
|
if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) {
|
|
str = str.replace(backslash, slash);
|
|
}
|
|
|
|
// special case for strings ending in enclosure containing path separator
|
|
if (isEnclosure(str)) {
|
|
str += slash;
|
|
}
|
|
|
|
// preserves full path in case of trailing path separator
|
|
str += 'a';
|
|
|
|
// remove path parts that are globby
|
|
do {
|
|
str = pathPosixDirname(str);
|
|
} while (isGlobby(str));
|
|
|
|
// remove escape chars and return result
|
|
return str.replace(escaped, '$1');
|
|
};
|
|
|
|
function isEnclosure(str) {
|
|
var lastChar = str.slice(-1);
|
|
|
|
var enclosureStart;
|
|
switch (lastChar) {
|
|
case '}':
|
|
enclosureStart = '{';
|
|
break;
|
|
case ']':
|
|
enclosureStart = '[';
|
|
break;
|
|
default:
|
|
return false;
|
|
}
|
|
|
|
var foundIndex = str.indexOf(enclosureStart);
|
|
if (foundIndex < 0) {
|
|
return false;
|
|
}
|
|
|
|
return str.slice(foundIndex + 1, -1).includes(slash);
|
|
}
|
|
|
|
function isGlobby(str) {
|
|
if (/\([^()]+$/.test(str)) {
|
|
return true;
|
|
}
|
|
if (str[0] === '{' || str[0] === '[') {
|
|
return true;
|
|
}
|
|
if (/[^\\][{[]/.test(str)) {
|
|
return true;
|
|
}
|
|
return isGlob(str);
|
|
}
|