oxfmt 0.48.0 → 0.50.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/configuration_schema.json +70 -12
- package/dist/acorn-sBRpswSh.js +4972 -0
- package/dist/angular-DtI-eDW8.js +4004 -0
- package/dist/{apis-hnICGpKH.js → apis-CKvPKBJI.js} +51 -5
- package/dist/babel-DaNjvh9L.js +9885 -0
- package/dist/{bindings-DSOLttxo.js → bindings-Dj_YoR0Z.js} +26 -26
- package/dist/cli-worker.js +1 -1
- package/dist/cli.js +5 -5
- package/dist/{dist-DBVLDX4Z.js → dist-D_YbN99t.js} +19 -17
- package/dist/{estree-CvnLDdmw.js → estree-CzfNsl8m.js} +1914 -1911
- package/dist/flow-c9AjoQam.js +52916 -0
- package/dist/glimmer-D_zkI0w_.js +7533 -0
- package/dist/graphql-BFXkB4Nq.js +1944 -0
- package/dist/html-DkcPxRXg.js +7139 -0
- package/dist/index.d.ts +61 -5
- package/dist/index.js +2 -2
- package/dist/{init-BbKOMZ57.js → init-C3nxU_Wc.js} +1 -1
- package/dist/{jiti-Bb1dT6Cw-DpVi6yB1.js → jiti-Bb1dT6Cw-C0N20Za1.js} +5 -7
- package/dist/markdown-DVLNmbQg.js +6880 -0
- package/dist/{meriyah-CIaAh_Jq.js → meriyah-BGPf00Rn.js} +4649 -4647
- package/dist/{migrate-biome-BMqs7-eg.js → migrate-biome-DclTzwKW.js} +1 -1
- package/dist/{migrate-prettier-mSf_N9fW.js → migrate-prettier-DLfviW85.js} +2 -2
- package/dist/plugin-DOdiccQR.js +1914 -0
- package/dist/postcss-D-ql-dm8.js +6788 -0
- package/dist/prettier-Cw36juP9.js +15601 -0
- package/dist/{prettier-plugin-oxfmt-CLoiASgP.js → prettier-plugin-oxfmt-BlJcmKAv.js} +38 -3
- package/dist/{resolve-pWjAK-4f-BnvQ49el.js → sorter-BZkvDMjt-DpGe0QK9.js} +325 -4
- package/dist/{sorter-C3ZRVYzK.js → sorter-w0dgpoFw.js} +1 -2
- package/dist/typescript-C_eN_ThF.js +22899 -0
- package/dist/{v3-D-mr2VVh-DA8uo048.js → v3-D-mr2VVh-CU7hQIit.js} +3 -4
- package/dist/{v4-C-HWEQJm-olIGVWd7.js → v4-C-HWEQJm-C8EWwksG.js} +3 -4
- package/dist/yaml-Bqxyk-13.js +5280 -0
- package/package.json +28 -20
- package/dist/acorn-K_XpABqm.js +0 -4968
- package/dist/angular-B2OHapHD.js +0 -4057
- package/dist/babel-DA0BK-9N.js +0 -9883
- package/dist/chunk-DSjvVL_1-DvmJ8i3j.js +0 -36
- package/dist/chunk-DrSxFLj_.js +0 -14
- package/dist/flow-BthqNux8.js +0 -52912
- package/dist/glimmer-0WQITj6v.js +0 -7541
- package/dist/graphql-CZVKp936.js +0 -1945
- package/dist/html-CC61hPUL.js +0 -7137
- package/dist/markdown-BkJWkmO_.js +0 -6876
- package/dist/postcss-C8WoCp9x.js +0 -6785
- package/dist/prettier-DpEoE-3g.js +0 -15596
- package/dist/sorter-BZkvDMjt-CgLjPuXI.js +0 -212
- package/dist/typescript-Cg8onQ4r.js +0 -22936
- package/dist/utils-D8dQkKEd-CoIwOuFZ.js +0 -81
- package/dist/yaml-CTxkSwZx.js +0 -5281
- /package/dist/{shared-BTEY2VsW.js → shared-BtJbjkue.js} +0 -0
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import * as path from "node:path";
|
|
2
|
-
//#region ../../node_modules/.pnpm/prettier-plugin-tailwindcss@0.0.0-insiders.3997fbd_prettier@3.8.3/node_modules/prettier-plugin-tailwindcss/dist/utils-D8dQkKEd.mjs
|
|
3
|
-
function isNodeLike(value) {
|
|
4
|
-
return typeof (value === null || value === void 0 ? void 0 : value.type) === "string";
|
|
5
|
-
}
|
|
6
|
-
function visit(ast, callbackMap) {
|
|
7
|
-
function _visit(node, path, meta) {
|
|
8
|
-
if (typeof callbackMap === "function") {
|
|
9
|
-
if (callbackMap(node, path, meta) === false) return;
|
|
10
|
-
} else if (node.type in callbackMap) {
|
|
11
|
-
if (callbackMap[node.type](node, path, meta) === false) return;
|
|
12
|
-
}
|
|
13
|
-
const keys = Object.keys(node);
|
|
14
|
-
for (let i = 0; i < keys.length; i++) {
|
|
15
|
-
const child = node[keys[i]];
|
|
16
|
-
if (Array.isArray(child)) {
|
|
17
|
-
for (let j = 0; j < child.length; j++) if (isNodeLike(child[j])) {
|
|
18
|
-
let newMeta = { ...meta };
|
|
19
|
-
let newPath = [{
|
|
20
|
-
node: child[j],
|
|
21
|
-
parent: node,
|
|
22
|
-
key: keys[i],
|
|
23
|
-
index: j,
|
|
24
|
-
meta: newMeta
|
|
25
|
-
}, ...path];
|
|
26
|
-
_visit(child[j], newPath, newMeta);
|
|
27
|
-
}
|
|
28
|
-
} else if (isNodeLike(child)) {
|
|
29
|
-
let newMeta = { ...meta };
|
|
30
|
-
_visit(child, [{
|
|
31
|
-
node: child,
|
|
32
|
-
parent: node,
|
|
33
|
-
key: keys[i],
|
|
34
|
-
index: i,
|
|
35
|
-
meta: newMeta
|
|
36
|
-
}, ...path], newMeta);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
let newMeta = {};
|
|
41
|
-
_visit(ast, [{
|
|
42
|
-
node: ast,
|
|
43
|
-
parent: null,
|
|
44
|
-
key: null,
|
|
45
|
-
index: null,
|
|
46
|
-
meta: newMeta
|
|
47
|
-
}], newMeta);
|
|
48
|
-
}
|
|
49
|
-
function spliceChangesIntoString(str, changes) {
|
|
50
|
-
if (!changes[0]) return str;
|
|
51
|
-
changes.sort((a, b) => {
|
|
52
|
-
return a.end - b.end || a.start - b.start;
|
|
53
|
-
});
|
|
54
|
-
let result = "";
|
|
55
|
-
let previous = changes[0];
|
|
56
|
-
result += str.slice(0, previous.start);
|
|
57
|
-
result += previous.after;
|
|
58
|
-
for (let i = 1; i < changes.length; ++i) {
|
|
59
|
-
let change = changes[i];
|
|
60
|
-
result += str.slice(previous.end, change.start);
|
|
61
|
-
result += change.after;
|
|
62
|
-
previous = change;
|
|
63
|
-
}
|
|
64
|
-
result += str.slice(previous.end);
|
|
65
|
-
return result;
|
|
66
|
-
}
|
|
67
|
-
function bigSign(bigIntValue) {
|
|
68
|
-
return Number(bigIntValue > 0n) - Number(bigIntValue < 0n);
|
|
69
|
-
}
|
|
70
|
-
function cacheForDirs(cache, inputDir, value, targetDir, makeKey = (dir) => dir) {
|
|
71
|
-
let dir = inputDir;
|
|
72
|
-
while (dir !== path.dirname(dir) && dir.length >= targetDir.length) {
|
|
73
|
-
const key = makeKey(dir);
|
|
74
|
-
if (cache.get(key) !== void 0) break;
|
|
75
|
-
cache.set(key, value);
|
|
76
|
-
if (dir === targetDir) break;
|
|
77
|
-
dir = path.dirname(dir);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
//#endregion
|
|
81
|
-
export { visit as i, cacheForDirs as n, spliceChangesIntoString as r, bigSign as t };
|