主要功能: - 修改RequirementModal支持12个订单班选择 - 添加OrderClassIconMap图标映射组件 - Store中添加selectedOrderClass状态管理 - WorkflowPage支持传递orderClass参数 - web_result添加URL参数切换功能 - 创建order-class-handler.js动态处理页面主题 技术改进: - 创建软链接关联订单班数据目录 - 生成wenlu.json和food.json数据结构 - 删除重复的web_result目录 - 添加测试页面test-order-class.html 影响范围: - 展会策划系统现支持12个订单班 - 结果展示页面自动适配不同订单班主题 - 用户可选择不同行业生成对应方案 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
151 lines
3.5 KiB
JavaScript
151 lines
3.5 KiB
JavaScript
/*!
|
|
* is-glob <https://github.com/jonschlinkert/is-glob>
|
|
*
|
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
* Released under the MIT License.
|
|
*/
|
|
|
|
var isExtglob = require('is-extglob');
|
|
var chars = { '{': '}', '(': ')', '[': ']'};
|
|
var strictCheck = function(str) {
|
|
if (str[0] === '!') {
|
|
return true;
|
|
}
|
|
var index = 0;
|
|
var pipeIndex = -2;
|
|
var closeSquareIndex = -2;
|
|
var closeCurlyIndex = -2;
|
|
var closeParenIndex = -2;
|
|
var backSlashIndex = -2;
|
|
while (index < str.length) {
|
|
if (str[index] === '*') {
|
|
return true;
|
|
}
|
|
|
|
if (str[index + 1] === '?' && /[\].+)]/.test(str[index])) {
|
|
return true;
|
|
}
|
|
|
|
if (closeSquareIndex !== -1 && str[index] === '[' && str[index + 1] !== ']') {
|
|
if (closeSquareIndex < index) {
|
|
closeSquareIndex = str.indexOf(']', index);
|
|
}
|
|
if (closeSquareIndex > index) {
|
|
if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
|
|
return true;
|
|
}
|
|
backSlashIndex = str.indexOf('\\', index);
|
|
if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
|
|
if (closeCurlyIndex !== -1 && str[index] === '{' && str[index + 1] !== '}') {
|
|
closeCurlyIndex = str.indexOf('}', index);
|
|
if (closeCurlyIndex > index) {
|
|
backSlashIndex = str.indexOf('\\', index);
|
|
if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) {
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
|
|
if (closeParenIndex !== -1 && str[index] === '(' && str[index + 1] === '?' && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ')') {
|
|
closeParenIndex = str.indexOf(')', index);
|
|
if (closeParenIndex > index) {
|
|
backSlashIndex = str.indexOf('\\', index);
|
|
if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
|
|
if (pipeIndex !== -1 && str[index] === '(' && str[index + 1] !== '|') {
|
|
if (pipeIndex < index) {
|
|
pipeIndex = str.indexOf('|', index);
|
|
}
|
|
if (pipeIndex !== -1 && str[pipeIndex + 1] !== ')') {
|
|
closeParenIndex = str.indexOf(')', pipeIndex);
|
|
if (closeParenIndex > pipeIndex) {
|
|
backSlashIndex = str.indexOf('\\', pipeIndex);
|
|
if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if (str[index] === '\\') {
|
|
var open = str[index + 1];
|
|
index += 2;
|
|
var close = chars[open];
|
|
|
|
if (close) {
|
|
var n = str.indexOf(close, index);
|
|
if (n !== -1) {
|
|
index = n + 1;
|
|
}
|
|
}
|
|
|
|
if (str[index] === '!') {
|
|
return true;
|
|
}
|
|
} else {
|
|
index++;
|
|
}
|
|
}
|
|
return false;
|
|
};
|
|
|
|
var relaxedCheck = function(str) {
|
|
if (str[0] === '!') {
|
|
return true;
|
|
}
|
|
var index = 0;
|
|
while (index < str.length) {
|
|
if (/[*?{}()[\]]/.test(str[index])) {
|
|
return true;
|
|
}
|
|
|
|
if (str[index] === '\\') {
|
|
var open = str[index + 1];
|
|
index += 2;
|
|
var close = chars[open];
|
|
|
|
if (close) {
|
|
var n = str.indexOf(close, index);
|
|
if (n !== -1) {
|
|
index = n + 1;
|
|
}
|
|
}
|
|
|
|
if (str[index] === '!') {
|
|
return true;
|
|
}
|
|
} else {
|
|
index++;
|
|
}
|
|
}
|
|
return false;
|
|
};
|
|
|
|
module.exports = function isGlob(str, options) {
|
|
if (typeof str !== 'string' || str === '') {
|
|
return false;
|
|
}
|
|
|
|
if (isExtglob(str)) {
|
|
return true;
|
|
}
|
|
|
|
var check = strictCheck;
|
|
|
|
// optionally relax check
|
|
if (options && options.strict === false) {
|
|
check = relaxedCheck;
|
|
}
|
|
|
|
return check(str);
|
|
};
|