MCPcopy Create free account
hub / github.com/angular/dev-infra / findInPath

Function findInPath

github-actions/browserstack/set-browserstack-env.js:20006–20046  ·  view source on GitHub ↗
(tool)

Source from the content-addressed store, hash-verified

20004 * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.
20005 *
20006 * @param {SummaryWriteOptions} [options] (optional) options for write operation
20007 *
20008 * @returns {Promise<Summary>} summary instance
20009 */
20010 write(options) {
20011 return __awaiter(this, void 0, void 0, function* () {
20012 const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);
20013 const filePath = yield this.filePath();
20014 const writeFunc = overwrite ? writeFile : appendFile;
20015 yield writeFunc(filePath, this._buffer, { encoding: "utf8" });
20016 return this.emptyBuffer();
20017 });
20018 }
20019 /**
20020 * Clears the summary buffer and wipes the summary file
20021 *
20022 * @returns {Summary} summary instance
20023 */
20024 clear() {
20025 return __awaiter(this, void 0, void 0, function* () {
20026 return this.emptyBuffer().write({ overwrite: true });
20027 });
20028 }
20029 /**
20030 * Returns the current summary buffer as a string
20031 *
20032 * @returns {string} string of summary buffer
20033 */
20034 stringify() {
20035 return this._buffer;
20036 }
20037 /**
20038 * If the summary buffer is empty
20039 *
20040 * @returns {boolen} true if the buffer is empty
20041 */
20042 isEmptyBuffer() {
20043 return this._buffer.length === 0;
20044 }
20045 /**
20046 * Resets the summary buffer without writing to summary file
20047 *
20048 * @returns {Summary} summary instance
20049 */

Callers 1

whichFunction · 0.70

Calls 4

__awaiter3Function · 0.70
isRootedFunction · 0.70
tryGetExecutablePathFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected