1
0
forked from Rowland/EG
EG/Cesium-1.132/node_modules/karma/lib/utils/pattern-utils.js
2025-08-25 17:48:13 +08:00

15 lines
376 B
JavaScript

'use strict'
const path = require('path')
const PatternUtils = {
getBaseDir (pattern) {
return pattern
.replace(/[/\\][^/\\]*\*.*$/, '') // remove parts with *
.replace(/[/\\][^/\\]*[!+]\(.*$/, '') // remove parts with !(...) and +(...)
.replace(/[/\\][^/\\]*\)\?.*$/, '') || path.sep // remove parts with (...)?
}
}
module.exports = PatternUtils