elrh-cosca 0.3.4 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -175,13 +175,13 @@ Given `jsonKey` might point to a nested key using dot notation, e.g. `a.b.c`. If
175
175
 
176
176
  ```ts
177
177
  function hasText(
178
- targetFile: string, row: string
178
+ targetFile: string, pattern: string | RegExp, exact: boolean = false
179
179
  ): boolean
180
180
  ```
181
181
 
182
- Checks whether given `row` exists in text file located at `targetFile`. Path is resolved relatively to `process.cwd()`. Several checks are in place to prevent accidental and malicious paths being passed in. Path traversal outside of CWD or providing absolute paths is disallowed.
182
+ Checks whether given `pattern` exists in text file located at `targetFile`. Path is resolved relatively to `process.cwd()`. Several checks are in place to prevent accidental and malicious paths being passed in. Path traversal outside of CWD or providing absolute paths is disallowed.
183
183
 
184
- If the `row` is present, the function returns true, false otherwise. Row must be matched completely, but surrounding whitespaces are ignored.
184
+ The `pattern` might be a plain string or a regular expression. If it is present, the function returns true, false otherwise. By default partial matches are allowed for string patterns. If you set optional `exact` parameter to true, the string must completely match at least one line in the file. However, surrounding whitespaces are trimmed in both cases.
185
185
 
186
186
  #### `getPackageManager`
187
187