@ark/fs 0.45.10 → 0.47.0
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/out/caller.js +3 -2
- package/out/fs.js +4 -3
- package/out/getCurrentLine.js +2 -6
- package/package.json +1 -1
package/out/caller.js
CHANGED
|
@@ -22,8 +22,9 @@ export const formatFilePath = (original, { relative, separator }) => {
|
|
|
22
22
|
if (relative) {
|
|
23
23
|
formatted = path.relative(typeof relative === "string" ? relative : process.cwd(), formatted);
|
|
24
24
|
}
|
|
25
|
-
if (separator)
|
|
26
|
-
formatted = formatted.
|
|
25
|
+
if (separator) {
|
|
26
|
+
formatted = formatted.replaceAll(new RegExp(`\\${path.sep}`, "g"), separator);
|
|
27
|
+
}
|
|
27
28
|
return formatted;
|
|
28
29
|
};
|
|
29
30
|
export const caller = (options = {}) => {
|
package/out/fs.js
CHANGED
|
@@ -128,9 +128,10 @@ const findReplace = matchers => input => matchers.reduce((acc, m) => acc.replace
|
|
|
128
128
|
* each file's contents according to the provided `Matcher["find"]`
|
|
129
129
|
* and `Matcher["replace"]`.
|
|
130
130
|
*/
|
|
131
|
-
const findReplaceMany = (matchers) => (files = []) =>
|
|
132
|
-
|
|
133
|
-
|
|
131
|
+
const findReplaceMany = (matchers) => (files = []) => {
|
|
132
|
+
for (const file of files)
|
|
133
|
+
writeFile(file, findReplace(matchers)(readFile(file)));
|
|
134
|
+
};
|
|
134
135
|
/**
|
|
135
136
|
* Given a directory and a set of {@link Matchers}, recursively walks
|
|
136
137
|
* the directory and applies every set of changes in the dictionary
|
package/out/getCurrentLine.js
CHANGED
|
@@ -23,12 +23,8 @@ export const getFramesFromError = (error) => {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
// Handle different stack formats
|
|
26
|
-
if (stack)
|
|
27
|
-
|
|
28
|
-
frames = Array(stack);
|
|
29
|
-
else
|
|
30
|
-
frames = stack.toString().split("\n");
|
|
31
|
-
}
|
|
26
|
+
if (stack)
|
|
27
|
+
frames = Array.isArray(stack) ? Array(stack) : stack.toString().split("\n");
|
|
32
28
|
else
|
|
33
29
|
frames = [];
|
|
34
30
|
// Parse our frames
|