(tool, check)
| 19981 | throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); |
| 19982 | } |
| 19983 | this._filePath = pathFromEnv; |
| 19984 | return this._filePath; |
| 19985 | }); |
| 19986 | } |
| 19987 | /** |
| 19988 | * Wraps content in an HTML tag, adding any HTML attributes |
| 19989 | * |
| 19990 | * @param {string} tag HTML tag to wrap |
| 19991 | * @param {string | null} content content within the tag |
| 19992 | * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add |
| 19993 | * |
| 19994 | * @returns {string} content wrapped in HTML element |
| 19995 | */ |
| 19996 | wrap(tag, content, attrs = {}) { |
| 19997 | const htmlAttrs = Object.entries(attrs).map(([key, value]) => ` ${key}="${value}"`).join(""); |
| 19998 | if (!content) { |
| 19999 | return `<${tag}${htmlAttrs}>`; |
| 20000 | } |
| 20001 | return `<${tag}${htmlAttrs}>${content}</${tag}>`; |
| 20002 | } |
| 20003 | /** |
| 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 |
no test coverage detected