@effect-app/eslint-shared-config 0.5.5 → 0.5.6

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.
Files changed (164) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/node_modules/@dprint/formatter/README.md +27 -29
  3. package/node_modules/@dprint/formatter/esm/common.d.ts +2 -6
  4. package/node_modules/@dprint/formatter/esm/common.d.ts.map +1 -1
  5. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert.d.ts.map +1 -0
  6. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_almost_equals.d.ts.map +1 -0
  7. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_array_includes.d.ts.map +1 -0
  8. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_equals.d.ts.map +1 -0
  9. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_exists.d.ts.map +1 -0
  10. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_false.d.ts.map +1 -0
  11. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_greater.d.ts.map +1 -0
  12. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_greater_or_equal.d.ts.map +1 -0
  13. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_instance_of.d.ts.map +1 -0
  14. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_is_error.d.ts.map +1 -0
  15. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_less.d.ts.map +1 -0
  16. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_less_or_equal.d.ts.map +1 -0
  17. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_match.d.ts.map +1 -0
  18. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_not_equals.d.ts.map +1 -0
  19. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_not_instance_of.d.ts.map +1 -0
  20. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_not_match.d.ts.map +1 -0
  21. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_not_strict_equals.d.ts.map +1 -0
  22. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_object_match.d.ts.map +1 -0
  23. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_rejects.d.ts.map +1 -0
  24. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_strict_equals.d.ts.map +1 -0
  25. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_string_includes.d.ts.map +1 -0
  26. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assert_throws.d.ts.map +1 -0
  27. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/assertion_error.d.ts.map +1 -0
  28. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/equal.d.ts.map +1 -0
  29. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/fail.d.ts.map +1 -0
  30. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/mod.d.ts.map +1 -0
  31. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/unimplemented.d.ts.map +1 -0
  32. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/0.226.0/unreachable.d.ts.map +1 -0
  33. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/internal/1.0.0/build_message.d.ts.map +1 -0
  34. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/internal/1.0.0/diff.d.ts.map +1 -0
  35. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/internal/1.0.0/diff_str.d.ts.map +1 -0
  36. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/internal/1.0.0/format.d.ts.map +1 -0
  37. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/internal/1.0.0/mod.d.ts.map +1 -0
  38. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/internal/1.0.0/styles.d.ts.map +1 -0
  39. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/internal/1.0.0/types.d.ts.map +1 -0
  40. package/node_modules/@dprint/formatter/esm/mod.d.ts +1 -43
  41. package/node_modules/@dprint/formatter/esm/mod.d.ts.map +1 -1
  42. package/node_modules/@dprint/formatter/esm/mod.js +3 -106
  43. package/node_modules/@dprint/formatter/esm/mod_test.d.ts.map +1 -1
  44. package/node_modules/@dprint/formatter/esm/v3.d.ts.map +1 -1
  45. package/node_modules/@dprint/formatter/esm/v3.js +2 -4
  46. package/node_modules/@dprint/formatter/esm/v4.d.ts.map +1 -1
  47. package/node_modules/@dprint/formatter/esm/v4.js +2 -4
  48. package/node_modules/@dprint/formatter/package.json +2 -5
  49. package/node_modules/@dprint/formatter/script/common.d.ts +2 -6
  50. package/node_modules/@dprint/formatter/script/common.d.ts.map +1 -1
  51. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert.d.ts.map +1 -0
  52. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_almost_equals.d.ts.map +1 -0
  53. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_array_includes.d.ts.map +1 -0
  54. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_equals.d.ts.map +1 -0
  55. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_exists.d.ts.map +1 -0
  56. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_false.d.ts.map +1 -0
  57. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_greater.d.ts.map +1 -0
  58. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_greater_or_equal.d.ts.map +1 -0
  59. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_instance_of.d.ts.map +1 -0
  60. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_is_error.d.ts.map +1 -0
  61. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_less.d.ts.map +1 -0
  62. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_less_or_equal.d.ts.map +1 -0
  63. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_match.d.ts.map +1 -0
  64. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_not_equals.d.ts.map +1 -0
  65. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_not_instance_of.d.ts.map +1 -0
  66. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_not_match.d.ts.map +1 -0
  67. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_not_strict_equals.d.ts.map +1 -0
  68. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_object_match.d.ts.map +1 -0
  69. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_rejects.d.ts.map +1 -0
  70. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_strict_equals.d.ts.map +1 -0
  71. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_string_includes.d.ts.map +1 -0
  72. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assert_throws.d.ts.map +1 -0
  73. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/assertion_error.d.ts.map +1 -0
  74. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/equal.d.ts.map +1 -0
  75. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/fail.d.ts.map +1 -0
  76. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/mod.d.ts.map +1 -0
  77. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/unimplemented.d.ts.map +1 -0
  78. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/0.226.0/unreachable.d.ts.map +1 -0
  79. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/internal/1.0.0/build_message.d.ts.map +1 -0
  80. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/internal/1.0.0/diff.d.ts.map +1 -0
  81. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/internal/1.0.0/diff_str.d.ts.map +1 -0
  82. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/internal/1.0.0/format.d.ts.map +1 -0
  83. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/internal/1.0.0/mod.d.ts.map +1 -0
  84. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/internal/1.0.0/styles.d.ts.map +1 -0
  85. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/internal/1.0.0/types.d.ts.map +1 -0
  86. package/node_modules/@dprint/formatter/script/mod.d.ts +1 -43
  87. package/node_modules/@dprint/formatter/script/mod.d.ts.map +1 -1
  88. package/node_modules/@dprint/formatter/script/mod.js +14 -127
  89. package/node_modules/@dprint/formatter/script/mod_test.d.ts.map +1 -1
  90. package/node_modules/@dprint/formatter/script/v3.d.ts.map +1 -1
  91. package/node_modules/@dprint/formatter/script/v3.js +5 -6
  92. package/node_modules/@dprint/formatter/script/v4.d.ts.map +1 -1
  93. package/node_modules/@dprint/formatter/script/v4.js +12 -23
  94. package/package.json +2 -2
  95. package/node_modules/@dprint/formatter/esm/_dnt.test_polyfills.d.ts.map +0 -1
  96. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/almost_equals.d.ts.map +0 -1
  97. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/array_includes.d.ts.map +0 -1
  98. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/assert.d.ts.map +0 -1
  99. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/assertion_error.d.ts.map +0 -1
  100. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/equal.d.ts.map +0 -1
  101. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/equals.d.ts.map +0 -1
  102. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/exists.d.ts.map +0 -1
  103. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/fail.d.ts.map +0 -1
  104. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/false.d.ts.map +0 -1
  105. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/greater.d.ts.map +0 -1
  106. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/greater_or_equal.d.ts.map +0 -1
  107. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/instance_of.d.ts.map +0 -1
  108. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/is_error.d.ts.map +0 -1
  109. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/less.d.ts.map +0 -1
  110. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/less_or_equal.d.ts.map +0 -1
  111. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/match.d.ts.map +0 -1
  112. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/mod.d.ts.map +0 -1
  113. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/not_equals.d.ts.map +0 -1
  114. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/not_instance_of.d.ts.map +0 -1
  115. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/not_match.d.ts.map +0 -1
  116. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/not_strict_equals.d.ts.map +0 -1
  117. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/object_match.d.ts.map +0 -1
  118. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/rejects.d.ts.map +0 -1
  119. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/strict_equals.d.ts.map +0 -1
  120. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/string_includes.d.ts.map +0 -1
  121. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/throws.d.ts.map +0 -1
  122. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/unimplemented.d.ts.map +0 -1
  123. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/assert/1.0.16/unreachable.d.ts.map +0 -1
  124. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/internal/1.0.12/build_message.d.ts.map +0 -1
  125. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/internal/1.0.12/diff.d.ts.map +0 -1
  126. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/internal/1.0.12/diff_str.d.ts.map +0 -1
  127. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/internal/1.0.12/format.d.ts.map +0 -1
  128. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/internal/1.0.12/styles.d.ts.map +0 -1
  129. package/node_modules/@dprint/formatter/esm/deps/jsr.io/@std/internal/1.0.12/types.d.ts.map +0 -1
  130. package/node_modules/@dprint/formatter/script/_dnt.test_polyfills.d.ts.map +0 -1
  131. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/almost_equals.d.ts.map +0 -1
  132. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/array_includes.d.ts.map +0 -1
  133. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/assert.d.ts.map +0 -1
  134. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/assertion_error.d.ts.map +0 -1
  135. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/equal.d.ts.map +0 -1
  136. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/equals.d.ts.map +0 -1
  137. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/exists.d.ts.map +0 -1
  138. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/fail.d.ts.map +0 -1
  139. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/false.d.ts.map +0 -1
  140. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/greater.d.ts.map +0 -1
  141. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/greater_or_equal.d.ts.map +0 -1
  142. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/instance_of.d.ts.map +0 -1
  143. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/is_error.d.ts.map +0 -1
  144. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/less.d.ts.map +0 -1
  145. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/less_or_equal.d.ts.map +0 -1
  146. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/match.d.ts.map +0 -1
  147. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/mod.d.ts.map +0 -1
  148. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/not_equals.d.ts.map +0 -1
  149. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/not_instance_of.d.ts.map +0 -1
  150. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/not_match.d.ts.map +0 -1
  151. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/not_strict_equals.d.ts.map +0 -1
  152. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/object_match.d.ts.map +0 -1
  153. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/rejects.d.ts.map +0 -1
  154. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/strict_equals.d.ts.map +0 -1
  155. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/string_includes.d.ts.map +0 -1
  156. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/throws.d.ts.map +0 -1
  157. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/unimplemented.d.ts.map +0 -1
  158. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/assert/1.0.16/unreachable.d.ts.map +0 -1
  159. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/internal/1.0.12/build_message.d.ts.map +0 -1
  160. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/internal/1.0.12/diff.d.ts.map +0 -1
  161. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/internal/1.0.12/diff_str.d.ts.map +0 -1
  162. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/internal/1.0.12/format.d.ts.map +0 -1
  163. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/internal/1.0.12/styles.d.ts.map +0 -1
  164. package/node_modules/@dprint/formatter/script/deps/jsr.io/@std/internal/1.0.12/types.d.ts.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @effect-app/eslint-shared-config
2
2
 
3
+ ## 0.5.6
4
+
5
+ ### Patch Changes
6
+
7
+ - dcb2df4: bump down formatter
8
+ - @effect-app/eslint-codegen-model@1.47.0
9
+
3
10
  ## 0.5.5
4
11
 
5
12
  ### Patch Changes
@@ -11,7 +11,7 @@ JS formatter for dprint Wasm plugins.
11
11
  Deno:
12
12
 
13
13
  ```sh
14
- deno add npm:@dprint/formatter
14
+ deno add @dprint/formatter
15
15
  ```
16
16
 
17
17
  Node.js:
@@ -22,40 +22,40 @@ npm i @dprint/formatter
22
22
 
23
23
  ## Use
24
24
 
25
- The context API allows you to manage multiple plugins with shared configuration and automatic plugin selection based on file type:
26
-
27
25
  ```ts
28
- import { createContext } from "@dprint/formatter";
29
- import * as json from "@dprint/json";
30
- import * as markdown from "@dprint/markdown";
31
- import * as typescript from "@dprint/typescript";
32
- import fs from "node:fs";
33
-
34
- const context = createContext({
35
- // global config
26
+ import { createStreaming, GlobalConfiguration } from "@dprint/formatter";
27
+
28
+ const globalConfig: GlobalConfiguration = {
36
29
  indentWidth: 2,
37
30
  lineWidth: 80,
38
- });
31
+ };
32
+ const tsFormatter = await createStreaming(
33
+ // check https://plugins.dprint.dev/ for latest plugin versions
34
+ fetch("https://plugins.dprint.dev/typescript-0.57.0.wasm"),
35
+ );
39
36
 
40
- // note: some plugins might have a getBuffer() export instead
41
- context.addPlugin(fs.readFileSync(typescript.getPath()), {
37
+ tsFormatter.setConfig(globalConfig, {
42
38
  semiColons: "asi",
43
39
  });
44
- context.addPlugin(fs.readFileSync(json.getPath()));
45
- context.addPlugin(fs.readFileSync(markdown.getPath()));
46
-
47
- console.log(context.formatText({
48
- filePath: "config.json",
49
- fileText: "{\"a\":1}",
50
- }));
51
-
52
- console.log(context.formatText({
53
- filePath: "app.ts",
54
- fileText: "const x=1",
55
- }));
40
+
41
+ // outputs: "const t = 5\n"
42
+ console.log(tsFormatter.formatText("file.ts", "const t = 5;"));
56
43
  ```
57
44
 
58
- The context also handles host formatting automatically, so embedded code blocks (like JSON in Markdown) will be formatted by the appropriate plugin.
45
+ Using with plugins on npm (ex. [@dprint/json](https://www.npmjs.com/package/@dprint/json)):
46
+
47
+ ```ts
48
+ import { createFromBuffer } from "@dprint/formatter";
49
+ // You may have to use `getBuffer` on plugins that haven't updated yet.
50
+ // See the plugins README.md for details.
51
+ import { getPath } from "@dprint/json";
52
+ import * as fs from "node:fs";
53
+
54
+ const buffer = fs.readFileSync(getPath());
55
+ const formatter = createFromBuffer(buffer);
56
+
57
+ console.log(formatter.formatText("test.json", "{test: 5}"));
58
+ ```
59
59
 
60
60
  ### Plugin NPM Packages
61
61
 
@@ -67,6 +67,4 @@ Note: In the future I will ensure plugins are published to JSR as well.
67
67
  - [@dprint/toml](https://www.npmjs.com/package/@dprint/toml)
68
68
  - [@dprint/dockerfile](https://www.npmjs.com/package/@dprint/dockerfile)
69
69
  - [@dprint/biome](https://www.npmjs.com/package/@dprint/biome)
70
- - [@dprint/oxc](https://www.npmjs.com/package/@dprint/oxc)
71
- - [@dprint/mago](https://www.npmjs.com/package/@dprint/mago)
72
70
  - [@dprint/ruff](https://www.npmjs.com/package/@dprint/ruff)
@@ -42,18 +42,14 @@ export interface Formatter {
42
42
  * Gets the license text of the plugin.
43
43
  */
44
44
  getLicenseText(): string;
45
- /**
46
- * Sets the host formatter for formatting embedded code.
47
- * @param formatWithHost - A function that formats embedded code blocks.
48
- */
49
- setHostFormatter(formatWithHost: ((request: FormatRequest) => string) | undefined): void;
50
45
  /**
51
46
  * Formats the specified file text.
52
47
  * @param request - Data to format.
48
+ * @param formatWithHost - Host formatter.
53
49
  * @returns The formatted text.
54
50
  * @throws If there is an error formatting.
55
51
  */
56
- formatText(request: FormatRequest): string;
52
+ formatText(request: FormatRequest, formatWithHost?: (request: FormatRequest) => string): string;
57
53
  }
58
54
  /** Configuration specified for use across plugins. */
59
55
  export interface GlobalConfiguration {
@@ -1 +1 @@
1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EAAE,MAAM,EAAE,CAAC;IACzB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/0.226.0/assert.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,SAAK,GAAG,OAAO,CAAC,IAAI,CAI5D"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert_almost_equals.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/0.226.0/assert_almost_equals.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,SAAS,SAAO,EAChB,GAAG,CAAC,EAAE,MAAM,QAgBb"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert_array_includes.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/0.226.0/assert_array_includes.ts"],"names":[],"mappings":"AAMA,0FAA0F;AAC1F,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,EACvB,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,EACzB,GAAG,CAAC,EAAE,MAAM,QAwBb"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert_equals.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/0.226.0/assert_equals.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,MAAM,EAAE,CAAC,EACT,QAAQ,EAAE,CAAC,EACX,GAAG,CAAC,EAAE,MAAM,QAkBb"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert_exists.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/0.226.0/assert_exists.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,MAAM,EAAE,CAAC,EACT,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,IAAI,WAAW,CAAC,CAAC,CAAC,CAOlC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert_false.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/0.226.0/assert_false.ts"],"names":[],"mappings":"AAIA,uDAAuD;AACvD,MAAM,MAAM,KAAK,GAAG,KAAK,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC;AAE3D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,SAAK,GAAG,OAAO,CAAC,IAAI,IAAI,KAAK,CAI1E"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert_greater.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/0.226.0/assert_greater.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,MAAM,QAMpE"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert_greater_or_equal.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/0.226.0/assert_greater_or_equal.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EACpC,MAAM,EAAE,CAAC,EACT,QAAQ,EAAE,CAAC,EACX,GAAG,CAAC,EAAE,MAAM,QASb"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert_instance_of.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/0.226.0/assert_instance_of.ts"],"names":[],"mappings":"AAIA,sBAAsB;AAEtB,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AACzD,4BAA4B;AAC5B,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,cAAc,IAAI,CAAC,SAC5D,KAAK,GAAG,IAAI,EAAE,GAAG,KAAK,MAAM,CAAC,GAAG,CAAC,GAC7B,KAAK,CAAC;AAEV;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,cAAc,EACvD,MAAM,EAAE,OAAO,EACf,YAAY,EAAE,CAAC,EACf,GAAG,SAAK,GACP,OAAO,CAAC,MAAM,IAAI,kBAAkB,CAAC,CAAC,CAAC,CA6BzC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert_is_error.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/0.226.0/assert_is_error.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,KAAK,GAAG,KAAK,EACnD,KAAK,EAAE,OAAO,EAEd,UAAU,CAAC,EAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EACtC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAC5B,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,KAAK,IAAI,CAAC,CA8BpB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert_less.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/0.226.0/assert_less.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,MAAM,QAMjE"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert_less_or_equal.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/0.226.0/assert_less_or_equal.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,MAAM,EAAE,CAAC,EACT,QAAQ,EAAE,CAAC,EACX,GAAG,CAAC,EAAE,MAAM,QASb"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert_match.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/0.226.0/assert_match.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,GAAG,CAAC,EAAE,MAAM,QAOb"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert_not_equals.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/0.226.0/assert_not_equals.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,MAAM,QAUtE"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert_not_instance_of.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/0.226.0/assert_not_instance_of.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,CAAC,EACtC,MAAM,EAAE,CAAC,EAET,cAAc,EAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EACzC,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAKjC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert_not_match.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/0.226.0/assert_not_match.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,GAAG,CAAC,EAAE,MAAM,QAQb"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert_not_strict_equals.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/0.226.0/assert_not_strict_equals.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EACrC,MAAM,EAAE,CAAC,EACT,QAAQ,EAAE,CAAC,EACX,GAAG,CAAC,EAAE,MAAM,QAYb"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert_object_match.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/0.226.0/assert_object_match.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAE/B,MAAM,EAAE,MAAM,CAAC,WAAW,EAAE,GAAG,CAAC,EAChC,QAAQ,EAAE,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,EACtC,GAAG,CAAC,EAAE,MAAM,GACX,IAAI,CA+EN"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert_rejects.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/0.226.0/assert_rejects.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,aAAa,CAC3B,EAAE,EAAE,MAAM,WAAW,CAAC,OAAO,CAAC,EAC9B,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,OAAO,CAAC,CAAC;AACpB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,KAAK,GAAG,KAAK,EACnD,EAAE,EAAE,MAAM,WAAW,CAAC,OAAO,CAAC,EAE9B,UAAU,EAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EACrC,WAAW,CAAC,EAAE,MAAM,EACpB,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert_strict_equals.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/0.226.0/assert_strict_equals.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,CAAC,EACX,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,IAAI,CAAC,CA+BrB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert_string_includes.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/0.226.0/assert_string_includes.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,GAAG,CAAC,EAAE,MAAM,QAOb"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert_throws.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/0.226.0/assert_throws.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAC1B,EAAE,EAAE,MAAM,OAAO,EACjB,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC;AACX;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,KAAK,GAAG,KAAK,EAClD,EAAE,EAAE,MAAM,OAAO,EAEjB,UAAU,EAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EACrC,WAAW,CAAC,EAAE,MAAM,EACpB,GAAG,CAAC,EAAE,MAAM,GACX,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertion_error.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/0.226.0/assertion_error.ts"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACvC;;;;;;;;;;OAUG;gBACS,OAAO,EAAE,MAAM;CAI5B"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"equal.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/0.226.0/equal.ts"],"names":[],"mappings":"AAYA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO,CA8FrD"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fail.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/0.226.0/fail.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AACH,wBAAgB,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,KAAK,CAGxC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/0.226.0/mod.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;GAeG;AAEH,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unimplemented.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/0.226.0/unimplemented.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,KAAK,CAGjD"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unreachable.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/0.226.0/unreachable.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAElD"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build_message.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/internal/1.0.0/build_message.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEvD;;;;;;;;;;;;;;;;;;GAkBG;AACH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;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,EAAE,CAkDlE"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/internal/1.0.0/format.ts"],"names":[],"mappings":"AAuBA,wBAAgB,MAAM,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,CAezC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/internal/1.0.0/mod.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/internal/1.0.0/styles.ts"],"names":[],"mappings":"AAqCA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAExC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEvC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEzC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE1C;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEzC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAExC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEzC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE3C;AAWD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpD"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/internal/1.0.0/types.ts"],"names":[],"mappings":"AAEA,kDAAkD;AAClD,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEtD;;;;GAIG;AACH,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,4BAA4B;IAC5B,IAAI,EAAE,QAAQ,CAAC;IACf,6BAA6B;IAC7B,KAAK,EAAE,CAAC,CAAC;IACT,+BAA+B;IAC/B,OAAO,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;CAC3B"}
@@ -1,47 +1,5 @@
1
- import type { ConfigurationDiagnostic, FormatRequest, Formatter, GlobalConfiguration } from "./common.js";
1
+ import type { Formatter } from "./common.js";
2
2
  export type { ConfigurationDiagnostic, FileMatchingInfo, FormatRequest, Formatter, GlobalConfiguration, Host, PluginInfo, } from "./common.js";
3
- /** A formatter returned from adding a plugin to a context. */
4
- export interface ContextFormatter {
5
- /** Formats the specified file text using this plugin. */
6
- formatText(request: FormatRequest): string;
7
- /** Gets the resolved configuration for this plugin. */
8
- getResolvedConfig(): Record<string, unknown>;
9
- /** Gets the configuration diagnostics for this plugin. */
10
- getConfigDiagnostics(): ConfigurationDiagnostic[];
11
- }
12
- /** A context for managing multiple formatters with shared configuration. */
13
- export interface FormatterContext {
14
- /**
15
- * Adds a plugin to the context.
16
- * @param source - The buffer or Wasm module of the plugin (e.g., from `@dprint/json` getBuffer()).
17
- * @param param - Plugin config.
18
- * @returns A formatter for directly formatting with this plugin.
19
- */
20
- addPlugin(source: BufferSource | WebAssembly.Module, pluginConfig?: Record<string, unknown>): ContextFormatter;
21
- /**
22
- * Adds a plugin to the context.
23
- * @param source - Source response object.
24
- * @param pluginConfig - Plugin config.
25
- * @returns A formatter for directly formatting with this plugin.
26
- */
27
- addPluginStreaming(source: ResponseLike, pluginConfig?: Record<string, unknown>): Promise<ContextFormatter>;
28
- /**
29
- * Formats the specified file text, automatically selecting the appropriate plugin.
30
- * @param request - Data to format.
31
- * @returns The formatted text.
32
- * @throws If no plugin matches the file or there is an error formatting.
33
- */
34
- formatText(request: FormatRequest): string;
35
- /**
36
- * Gets all configuration diagnostics from all plugins.
37
- */
38
- getConfigDiagnostics(): ConfigurationDiagnostic[];
39
- }
40
- /**
41
- * Creates a formatter context for managing multiple plugins with shared configuration.
42
- * @param globalConfig - Global configuration shared across all plugins.
43
- */
44
- export declare function createContext(globalConfig?: GlobalConfiguration): FormatterContext;
45
3
  export interface ResponseLike {
46
4
  status: number;
47
5
  arrayBuffer(): Promise<BufferSource>;
@@ -1 +1 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,aAAa,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAI1G,YAAY,EACV,uBAAuB,EACvB,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,mBAAmB,EACnB,IAAI,EACJ,UAAU,GACX,MAAM,aAAa,CAAC;AAUrB,8DAA8D;AAC9D,MAAM,WAAW,gBAAgB;IAC/B,yDAAyD;IACzD,UAAU,CAAC,OAAO,EAAE,aAAa,GA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,MAAM,GAAG,SAAS,CAkB9E"}
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAI7C,YAAY,EACV,uBAAuB,EACvB,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,mBAAmB,EACnB,IAAI,EACJ,UAAU,GACX,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,IAAI,OAAO,CAAC,YAAY,CAAC,CAAC;IACrC,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACxB,OAAO,EAAE;QACP,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;KAClC,CAAC;CACH;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CACnC,eAAe,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,YAAY,GACpD,OAAO,CAAC,SAAS,CAAC,CAmBpB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,gBAAgB,EAAE,YAAY,GAAG,SAAS,CAG1E;AAED,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAkB9E"}
@@ -1,115 +1,11 @@
1
1
  import * as v3 from "./v3.js";
2
2
  import * as v4 from "./v4.js";
3
- /**
4
- * Creates a formatter context for managing multiple plugins with shared configuration.
5
- * @param globalConfig - Global configuration shared across all plugins.
6
- */
7
- export function createContext(globalConfig = {}) {
8
- const plugins = [];
9
- function findPluginForFile(filePath) {
10
- const fileName = getFileName(filePath);
11
- const ext = getFileExtension(filePath);
12
- // First try to match by exact file name
13
- for (const plugin of plugins) {
14
- if (plugin.fileNames.has(fileName)) {
15
- return plugin;
16
- }
17
- }
18
- // Then try to match by extension
19
- if (ext) {
20
- for (const plugin of plugins) {
21
- if (plugin.fileExtensions.has(ext)) {
22
- return plugin;
23
- }
24
- }
25
- }
26
- return undefined;
27
- }
28
- function createHostFormatter(currentPlugin) {
29
- return (request) => {
30
- const plugin = findPluginForFile(request.filePath);
31
- if (plugin && plugin !== currentPlugin) {
32
- return plugin.formatter.formatText(request);
33
- }
34
- // Return unchanged if no other plugin matches
35
- return request.fileText;
36
- };
37
- }
38
- return {
39
- async addPluginStreaming(source, pluginConfig) {
40
- const wasmModule = await createWasmModuleFromStreaming(source);
41
- return this.addPlugin(wasmModule, pluginConfig);
42
- },
43
- addPlugin(source, pluginConfig = {}) {
44
- const formatter = source instanceof WebAssembly.Module
45
- ? createFromWasmModule(source)
46
- : createFromBuffer(source);
47
- // Set configuration
48
- formatter.setConfig(globalConfig, pluginConfig);
49
- // Get file matching info
50
- const matchingInfo = formatter.getFileMatchingInfo();
51
- const fileExtensions = new Set(matchingInfo.fileExtensions.map((ext) => ext.toLowerCase()));
52
- const fileNames = new Set(matchingInfo.fileNames.map((name) => name.toLowerCase()));
53
- const registered = {
54
- formatter,
55
- pluginConfig,
56
- fileExtensions,
57
- fileNames,
58
- };
59
- plugins.push(registered);
60
- // Set up host formatter for this plugin
61
- formatter.setHostFormatter(createHostFormatter(registered));
62
- // Return a context-aware formatter
63
- return {
64
- formatText(request) {
65
- return formatter.formatText(request);
66
- },
67
- getResolvedConfig() {
68
- return formatter.getResolvedConfig();
69
- },
70
- getConfigDiagnostics() {
71
- return formatter.getConfigDiagnostics();
72
- },
73
- };
74
- },
75
- formatText(request) {
76
- const plugin = findPluginForFile(request.filePath);
77
- if (!plugin) {
78
- throw new Error(`No plugin found for file: ${request.filePath}. `
79
- + `Registered plugins handle: ${plugins
80
- .map((p) => [...p.fileExtensions].join(", "))
81
- .join("; ")}`);
82
- }
83
- return plugin.formatter.formatText(request);
84
- },
85
- getConfigDiagnostics() {
86
- return plugins.flatMap((p) => p.formatter.getConfigDiagnostics());
87
- },
88
- };
89
- }
90
- function getFileName(filePath) {
91
- const lastSlash = Math.max(filePath.lastIndexOf("/"), filePath.lastIndexOf("\\"));
92
- return (lastSlash >= 0 ? filePath.slice(lastSlash + 1) : filePath)
93
- .toLowerCase();
94
- }
95
- function getFileExtension(filePath) {
96
- const fileName = getFileName(filePath);
97
- const lastDot = fileName.lastIndexOf(".");
98
- if (lastDot > 0) {
99
- return fileName.slice(lastDot + 1);
100
- }
101
- return undefined;
102
- }
103
3
  /**
104
4
  * Creates a formatter from the specified streaming source.
105
5
  * @remarks This is the most efficient way to create a formatter.
106
6
  * @param response - The streaming source to create the formatter from.
107
7
  */
108
8
  export async function createStreaming(responsePromise) {
109
- const wasmModule = await createWasmModuleFromStreaming(responsePromise);
110
- return createFromWasmModule(wasmModule);
111
- }
112
- async function createWasmModuleFromStreaming(responsePromise) {
113
9
  const response = await responsePromise;
114
10
  if (response.status !== 200) {
115
11
  throw new Error(`Unexpected status code: ${response.status}\n${await response.text()}`);
@@ -117,12 +13,13 @@ async function createWasmModuleFromStreaming(responsePromise) {
117
13
  if (typeof WebAssembly.instantiateStreaming === "function"
118
14
  && response.headers.get("content-type") === "application/wasm") {
119
15
  // deno-lint-ignore no-explicit-any
120
- return await WebAssembly.compileStreaming(response);
16
+ const module = await WebAssembly.compileStreaming(response);
17
+ return createFromWasmModule(module);
121
18
  }
122
19
  else {
123
20
  // fallback for node.js or when the content type isn't application/wasm
124
21
  return response.arrayBuffer()
125
- .then((buffer) => new WebAssembly.Module(buffer));
22
+ .then((buffer) => createFromBuffer(buffer));
126
23
  }
127
24
  }
128
25
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"mod_test.d.ts","sourceRoot":"","sources":["../src/mod_test.ts"],"names":[],"mappings":"AAAA,OAAO,0BAA0B,CAAC"}
1
+ {"version":3,"file":"mod_test.d.ts","sourceRoot":"","sources":["../src/mod_test.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"v3.d.ts","sourceRoot":"","sources":["../src/v3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,SAAS,EAAuB,IAAI,EAAc,MAAM,aAAa,CAAC;AAKnG;;GAEG;AACH,wBAAgB,UAAU,IAAI,IAAI,CAyEjC;AAED,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,WAAW,CAAC,QAAQ,EAClC,IAAI,EAAE,IAAI,GACT,SAAS,CAmIX"}
1
+ {"version":3,"file":"v3.d.ts","sourceRoot":"","sources":["../src/v3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,SAAS,EAAuB,IAAI,EAAc,MAAM,aAAa,CAAC;AAKnG;;GAEG;AACH,wBAAgB,UAAU,IAAI,IAAI,CAyEjC;AAED,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,WAAW,CAAC,QAAQ,EAClC,IAAI,EAAE,IAAI,GACT,SAAS,CAiIX"}
@@ -125,14 +125,12 @@ export function createFromInstance(wasmInstance, host) {
125
125
  const length = get_license_text();
126
126
  return receiveString(wasmInstance, length);
127
127
  },
128
- setHostFormatter(formatWithHost) {
129
- host.setHostFormatter(formatWithHost);
130
- },
131
- formatText(request) {
128
+ formatText(request, formatWithHost) {
132
129
  if (request.bytesRange != null) {
133
130
  // not supported for v3
134
131
  return request.fileText;
135
132
  }
133
+ host.setHostFormatter(formatWithHost);
136
134
  setConfigIfNotSet();
137
135
  if (request.overrideConfig != null) {
138
136
  if (pluginSchemaVersion === 2) {
@@ -1 +1 @@
1
- {"version":3,"file":"v4.d.ts","sourceRoot":"","sources":["../src/v4.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,SAAS,EAAuB,IAAI,EAAc,MAAM,aAAa,CAAC;AAMnG;;GAEG;AACH,wBAAgB,UAAU,IAAI,IAAI,CAuHjC;AAED,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,WAAW,CAAC,QAAQ,EAClC,IAAI,EAAE,IAAI,GACT,SAAS,CAoHX"}
1
+ {"version":3,"file":"v4.d.ts","sourceRoot":"","sources":["../src/v4.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,SAAS,EAAuB,IAAI,EAAc,MAAM,aAAa,CAAC;AAMnG;;GAEG;AACH,wBAAgB,UAAU,IAAI,IAAI,CAuHjC;AAED,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,WAAW,CAAC,QAAQ,EAClC,IAAI,EAAE,IAAI,GACT,SAAS,CAmHX"}
@@ -138,14 +138,12 @@ export function createFromInstance(wasmInstance, host) {
138
138
  const length = get_license_text();
139
139
  return receiveString(length);
140
140
  },
141
- setHostFormatter(formatWithHost) {
142
- host.setHostFormatter(formatWithHost);
143
- },
144
- formatText(request) {
141
+ formatText(request, formatWithHost) {
145
142
  if (request.bytesRange != null && format_range == null) {
146
143
  // plugin doesn't support range formatting
147
144
  return request.fileText;
148
145
  }
146
+ host.setHostFormatter(formatWithHost);
149
147
  setConfigIfNotSet();
150
148
  if (request.overrideConfig != null) {
151
149
  sendString(JSON.stringify(request.overrideConfig));
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dprint/formatter",
3
- "version": "0.5.1",
3
+ "version": "0.4.1",
4
4
  "description": "Wasm formatter for dprint plugins.",
5
5
  "keywords": [
6
6
  "dprint",
@@ -29,11 +29,8 @@
29
29
  "test": "node test_runner.js"
30
30
  },
31
31
  "devDependencies": {
32
- "@types/node": "^25",
32
+ "@types/node": "^20.9.0",
33
33
  "picocolors": "^1.0.0",
34
- "@dprint/json": "^0.21.1",
35
- "@dprint/markdown": "^0.20.0",
36
- "@dprint/typescript": "^0.95.13",
37
34
  "@deno/shim-deno-test": "~0.5.0",
38
35
  "undici": "^4.12.1"
39
36
  },
@@ -42,18 +42,14 @@ export interface Formatter {
42
42
  * Gets the license text of the plugin.
43
43
  */
44
44
  getLicenseText(): string;
45
- /**
46
- * Sets the host formatter for formatting embedded code.
47
- * @param formatWithHost - A function that formats embedded code blocks.
48
- */
49
- setHostFormatter(formatWithHost: ((request: FormatRequest) => string) | undefined): void;
50
45
  /**
51
46
  * Formats the specified file text.
52
47
  * @param request - Data to format.
48
+ * @param formatWithHost - Host formatter.
53
49
  * @returns The formatted text.
54
50
  * @throws If there is an error formatting.
55
51
  */
56
- formatText(request: FormatRequest): string;
52
+ formatText(request: FormatRequest, formatWithHost?: (request: FormatRequest) => string): string;
57
53
  }
58
54
  /** Configuration specified for use across plugins. */
59
55
  export interface GlobalConfiguration {
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,2BAA2B;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,UAAU,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,gDAAgD;IAChD,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC1C;AAED,MAAM,WAAW,IAAI;IACnB,WAAW,CAAC,YAAY,EAAE,WAAW,CAAC,QAAQ,GAAG,IAAI,CAAC;IACtD,gBAAgB,CAAC,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE,aAAa,KAAK,MAAM,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC;IACzF,kBAAkB,IAAI,WAAW,CAAC,OAAO,CAAC;CAC3C;AAED,oBAAoB;AACpB,MAAM,WAAW,SAAS;IACxB;;;;OAIG;IACH,SAAS,CACP,YAAY,EAAE,mBAAmB,EACjC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACpC,IAAI,CAAC;IACR;;OAEG;IACH,oBAAoB,IAAI,uBAAuB,EAAE,CAAC;IAClD;;;OAGG;IACH,iBAAiB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7C;;OAEG;IACH,aAAa,IAAI,UAAU,CAAC;IAC5B;;OAEG;IACH,mBAAmB,IAAI,gBAAgB,CAAC;IACxC;;OAEG;IACH,cAAc,IAAI,MAAM,CAA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AO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,8DAA8D;AAC9D,MAAM,WAAW,gBAAgB;IAC/B,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/0.226.0/assert.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,SAAK,GAAG,OAAO,CAAC,IAAI,CAI5D"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert_almost_equals.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/0.226.0/assert_almost_equals.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,SAAS,SAAO,EAChB,GAAG,CAAC,EAAE,MAAM,QAgBb"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert_array_includes.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/0.226.0/assert_array_includes.ts"],"names":[],"mappings":"AAMA,0FAA0F;AAC1F,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,EACvB,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,EACzB,GAAG,CAAC,EAAE,MAAM,QAwBb"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert_equals.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/0.226.0/assert_equals.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,MAAM,EAAE,CAAC,EACT,QAAQ,EAAE,CAAC,EACX,GAAG,CAAC,EAAE,MAAM,QAkBb"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert_exists.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/0.226.0/assert_exists.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,MAAM,EAAE,CAAC,EACT,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,IAAI,WAAW,CAAC,CAAC,CAAC,CAOlC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert_false.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/0.226.0/assert_false.ts"],"names":[],"mappings":"AAIA,uDAAuD;AACvD,MAAM,MAAM,KAAK,GAAG,KAAK,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC;AAE3D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,SAAK,GAAG,OAAO,CAAC,IAAI,IAAI,KAAK,CAI1E"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert_greater.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/0.226.0/assert_greater.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,MAAM,QAMpE"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert_greater_or_equal.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/0.226.0/assert_greater_or_equal.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EACpC,MAAM,EAAE,CAAC,EACT,QAAQ,EAAE,CAAC,EACX,GAAG,CAAC,EAAE,MAAM,QASb"}