@actions/glob
Advanced tools
Comparing version 0.1.2 to 0.2.0
import { Globber } from './internal-globber'; | ||
import { GlobOptions } from './internal-glob-options'; | ||
import { HashFileOptions } from './internal-hash-file-options'; | ||
export { Globber, GlobOptions }; | ||
@@ -11,1 +12,8 @@ /** | ||
export declare function create(patterns: string, options?: GlobOptions): Promise<Globber>; | ||
/** | ||
* Computes the sha256 hash of a glob | ||
* | ||
* @param patterns Patterns separated by newlines | ||
* @param options Glob options | ||
*/ | ||
export declare function hashFiles(patterns: string, options?: HashFileOptions): Promise<string>; |
@@ -12,4 +12,5 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.create = void 0; | ||
exports.hashFiles = exports.create = void 0; | ||
const internal_globber_1 = require("./internal-globber"); | ||
const internal_hash_files_1 = require("./internal-hash-files"); | ||
/** | ||
@@ -27,2 +28,19 @@ * Constructs a globber | ||
exports.create = create; | ||
/** | ||
* Computes the sha256 hash of a glob | ||
* | ||
* @param patterns Patterns separated by newlines | ||
* @param options Glob options | ||
*/ | ||
function hashFiles(patterns, options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
let followSymbolicLinks = true; | ||
if (options && typeof options.followSymbolicLinks === 'boolean') { | ||
followSymbolicLinks = options.followSymbolicLinks; | ||
} | ||
const globber = yield create(patterns, { followSymbolicLinks }); | ||
return internal_hash_files_1.hashFiles(globber); | ||
}); | ||
} | ||
exports.hashFiles = hashFiles; | ||
//# sourceMappingURL=glob.js.map |
@@ -31,2 +31,3 @@ "use strict"; | ||
implicitDescendants: true, | ||
matchDirectories: true, | ||
omitBrokenSymbolicLinks: true | ||
@@ -43,2 +44,6 @@ }; | ||
} | ||
if (typeof copy.matchDirectories === 'boolean') { | ||
result.matchDirectories = copy.matchDirectories; | ||
core.debug(`matchDirectories '${result.matchDirectories}'`); | ||
} | ||
if (typeof copy.omitBrokenSymbolicLinks === 'boolean') { | ||
@@ -45,0 +50,0 @@ result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; |
@@ -23,2 +23,9 @@ /** | ||
/** | ||
* Indicates whether matching directories should be included in the | ||
* result set. | ||
* | ||
* @default true | ||
*/ | ||
matchDirectories?: boolean; | ||
/** | ||
* Indicates whether broken symbolic should be ignored and omitted from the | ||
@@ -25,0 +32,0 @@ * result set. Otherwise an error will be thrown. |
@@ -144,3 +144,3 @@ "use strict"; | ||
// Matched | ||
if (match & internal_match_kind_1.MatchKind.Directory) { | ||
if (match & internal_match_kind_1.MatchKind.Directory && options.matchDirectories) { | ||
yield yield __await(item.path); | ||
@@ -147,0 +147,0 @@ } |
{ | ||
"name": "@actions/glob", | ||
"version": "0.1.2", | ||
"version": "0.2.0", | ||
"preview": true, | ||
@@ -5,0 +5,0 @@ "description": "Actions glob lib", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
85841
39
1380
3