Last change
on this file since eed0bf8 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
376 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | 'use strict'
|
---|
| 2 |
|
---|
| 3 | const path = require('path')
|
---|
| 4 |
|
---|
| 5 | const PatternUtils = {
|
---|
| 6 | getBaseDir (pattern) {
|
---|
| 7 | return pattern
|
---|
| 8 | .replace(/[/\\][^/\\]*\*.*$/, '') // remove parts with *
|
---|
| 9 | .replace(/[/\\][^/\\]*[!+]\(.*$/, '') // remove parts with !(...) and +(...)
|
---|
| 10 | .replace(/[/\\][^/\\]*\)\?.*$/, '') || path.sep // remove parts with (...)?
|
---|
| 11 | }
|
---|
| 12 | }
|
---|
| 13 |
|
---|
| 14 | module.exports = PatternUtils
|
---|
Note:
See
TracBrowser
for help on using the repository browser.