mirror of https://github.com/actions/toolkit
33 lines
981 B
TypeScript
33 lines
981 B
TypeScript
|
import * as core from '@actions/core'
|
||
|
import {GlobOptions} from './internal-glob-options'
|
||
|
|
||
|
/**
|
||
|
* Returns a copy with defaults filled in.
|
||
|
*/
|
||
|
export function getOptions(copy?: GlobOptions): GlobOptions {
|
||
|
const result: GlobOptions = {
|
||
|
followSymbolicLinks: true,
|
||
|
implicitDescendants: true,
|
||
|
omitBrokenSymbolicLinks: true
|
||
|
}
|
||
|
|
||
|
if (copy) {
|
||
|
if (typeof copy.followSymbolicLinks === 'boolean') {
|
||
|
result.followSymbolicLinks = copy.followSymbolicLinks
|
||
|
core.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`)
|
||
|
}
|
||
|
|
||
|
if (typeof copy.implicitDescendants === 'boolean') {
|
||
|
result.implicitDescendants = copy.implicitDescendants
|
||
|
core.debug(`implicitDescendants '${result.implicitDescendants}'`)
|
||
|
}
|
||
|
|
||
|
if (typeof copy.omitBrokenSymbolicLinks === 'boolean') {
|
||
|
result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks
|
||
|
core.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return result
|
||
|
}
|