mirror of
https://github.com/dorny/paths-filter.git
synced 2025-06-08 00:59:04 +00:00
Upgrade all the things
This commit is contained in:
parent
e55b1ed57a
commit
2c495ec569
4 changed files with 2338 additions and 8721 deletions
|
@ -1,6 +1,6 @@
|
|||
import * as jsyaml from 'js-yaml'
|
||||
import micromatch from 'micromatch'
|
||||
import {File, ChangeStatus} from './file'
|
||||
import {File} from './file'
|
||||
|
||||
// Type definition of object we expect to load from YAML
|
||||
interface FilterYaml {
|
||||
|
@ -15,13 +15,6 @@ const MatchOptions: micromatch.Options = {
|
|||
dot: true
|
||||
}
|
||||
|
||||
// Internal representation of one item in named filter rule
|
||||
// Created as simplified form of data in FilterItemYaml
|
||||
interface FilterRuleItem {
|
||||
/** returns the list of matched files */
|
||||
matcher: (files: string[]) => string[]
|
||||
}
|
||||
|
||||
export interface FilterResults {
|
||||
[key: string]: File[]
|
||||
}
|
||||
|
@ -42,7 +35,7 @@ export class Filter {
|
|||
return
|
||||
}
|
||||
|
||||
const doc = jsyaml.safeLoad(yaml) as FilterYaml
|
||||
const doc = jsyaml.load(yaml) as FilterYaml
|
||||
if (typeof doc !== 'object') {
|
||||
this.throwInvalidFormatError('Root element is not an object')
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue