revert Merge branch 'main' of http://47.107.152.87:3000/liubiao/APP # Conflicts: # .gitignore # pages/common/index/index.vue # unpackage/dist/dev/app-plus/app-config-service.js # unpackage/dist/dev/app-plus/app-service.js # unpackage/dist/dev/app-plus/app-view.js # unpackage/dist/dev/app-plus/manifest.json # utils/request.js
25 lines
763 B
JavaScript
25 lines
763 B
JavaScript
'use strict';
|
|
|
|
var path = require('path');
|
|
var isglob = require('is-glob');
|
|
var pathDirname = require('path-dirname');
|
|
var isWin32 = require('os').platform() === 'win32';
|
|
|
|
module.exports = function globParent(str) {
|
|
// flip windows path separators
|
|
if (isWin32 && str.indexOf('/') < 0) str = str.split('\\').join('/');
|
|
|
|
// special case for strings ending in enclosure containing path separator
|
|
if (/[\{\[].*[\/]*.*[\}\]]$/.test(str)) str += '/';
|
|
|
|
// preserves full path in case of trailing path separator
|
|
str += 'a';
|
|
|
|
// remove path parts that are globby
|
|
do {str = pathDirname.posix(str)}
|
|
while (isglob(str) || /(^|[^\\])([\{\[]|\([^\)]+$)/.test(str));
|
|
|
|
// remove escape chars and return result
|
|
return str.replace(/\\([\*\?\|\[\]\(\)\{\}])/g, '$1');
|
|
};
|