toolcraft 0.0.116 → 0.0.118

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 (319) hide show
  1. package/composition.json +42 -2
  2. package/dist/composition.json +42 -2
  3. package/node_modules/@poe-code/agent-mcp-config/package.json +0 -3
  4. package/node_modules/@poe-code/config-mutations/package.json +0 -5
  5. package/node_modules/@poe-code/frontmatter/package.json +0 -3
  6. package/node_modules/@poe-code/process-runner/package.json +0 -3
  7. package/node_modules/@poe-code/task-list/package.json +0 -3
  8. package/node_modules/fast-string-truncated-width/dist/index.d.ts +4 -0
  9. package/node_modules/fast-string-truncated-width/dist/index.js +111 -0
  10. package/node_modules/fast-string-truncated-width/dist/types.d.ts +19 -0
  11. package/node_modules/fast-string-truncated-width/dist/types.js +2 -0
  12. package/node_modules/fast-string-truncated-width/dist/utils.d.ts +4 -0
  13. package/node_modules/fast-string-truncated-width/dist/utils.js +20 -0
  14. package/node_modules/fast-string-truncated-width/license +21 -0
  15. package/node_modules/fast-string-truncated-width/package.json +35 -0
  16. package/node_modules/fast-string-truncated-width/readme.md +59 -0
  17. package/node_modules/fast-string-width/dist/index.d.ts +4 -0
  18. package/node_modules/fast-string-width/dist/index.js +14 -0
  19. package/node_modules/fast-string-width/license +21 -0
  20. package/node_modules/fast-string-width/package.json +34 -0
  21. package/node_modules/fast-string-width/readme.md +42 -0
  22. package/node_modules/fast-wrap-ansi/LICENSE +23 -0
  23. package/node_modules/fast-wrap-ansi/README.md +26 -0
  24. package/node_modules/fast-wrap-ansi/lib/main.d.ts +6 -0
  25. package/node_modules/fast-wrap-ansi/lib/main.js +218 -0
  26. package/node_modules/fast-wrap-ansi/package.json +51 -0
  27. package/node_modules/ignore/LICENSE-MIT +21 -0
  28. package/node_modules/ignore/README.md +412 -0
  29. package/node_modules/ignore/index.d.ts +61 -0
  30. package/node_modules/ignore/index.js +636 -0
  31. package/node_modules/ignore/legacy.js +559 -0
  32. package/node_modules/ignore/package.json +74 -0
  33. package/node_modules/jsonc-parser/CHANGELOG.md +76 -0
  34. package/node_modules/jsonc-parser/LICENSE.md +21 -0
  35. package/node_modules/jsonc-parser/README.md +364 -0
  36. package/node_modules/jsonc-parser/SECURITY.md +41 -0
  37. package/node_modules/jsonc-parser/lib/esm/impl/edit.js +185 -0
  38. package/node_modules/jsonc-parser/lib/esm/impl/format.js +261 -0
  39. package/node_modules/jsonc-parser/lib/esm/impl/parser.js +659 -0
  40. package/node_modules/jsonc-parser/lib/esm/impl/scanner.js +443 -0
  41. package/node_modules/jsonc-parser/lib/esm/impl/string-intern.js +29 -0
  42. package/node_modules/jsonc-parser/lib/esm/main.d.ts +351 -0
  43. package/node_modules/jsonc-parser/lib/esm/main.js +178 -0
  44. package/node_modules/jsonc-parser/lib/umd/impl/edit.js +201 -0
  45. package/node_modules/jsonc-parser/lib/umd/impl/format.js +275 -0
  46. package/node_modules/jsonc-parser/lib/umd/impl/parser.js +682 -0
  47. package/node_modules/jsonc-parser/lib/umd/impl/scanner.js +456 -0
  48. package/node_modules/jsonc-parser/lib/umd/impl/string-intern.js +42 -0
  49. package/node_modules/jsonc-parser/lib/umd/main.d.ts +351 -0
  50. package/node_modules/jsonc-parser/lib/umd/main.js +194 -0
  51. package/node_modules/jsonc-parser/package.json +37 -0
  52. package/node_modules/sisteransi/license +21 -0
  53. package/node_modules/sisteransi/package.json +34 -0
  54. package/node_modules/sisteransi/readme.md +113 -0
  55. package/node_modules/sisteransi/src/index.js +58 -0
  56. package/node_modules/sisteransi/src/sisteransi.d.ts +35 -0
  57. package/node_modules/smol-toml/LICENSE +24 -0
  58. package/node_modules/smol-toml/README.md +239 -0
  59. package/node_modules/smol-toml/dist/date.d.ts +41 -0
  60. package/node_modules/smol-toml/dist/date.js +127 -0
  61. package/node_modules/smol-toml/dist/error.d.ts +38 -0
  62. package/node_modules/smol-toml/dist/error.js +63 -0
  63. package/node_modules/smol-toml/dist/extract.d.ts +30 -0
  64. package/node_modules/smol-toml/dist/extract.js +100 -0
  65. package/node_modules/smol-toml/dist/index.cjs +897 -0
  66. package/node_modules/smol-toml/dist/index.d.ts +43 -0
  67. package/node_modules/smol-toml/dist/index.js +33 -0
  68. package/node_modules/smol-toml/dist/parse.d.ts +37 -0
  69. package/node_modules/smol-toml/dist/parse.js +148 -0
  70. package/node_modules/smol-toml/dist/primitive.d.ts +31 -0
  71. package/node_modules/smol-toml/dist/primitive.js +179 -0
  72. package/node_modules/smol-toml/dist/stringify.d.ts +31 -0
  73. package/node_modules/smol-toml/dist/stringify.js +167 -0
  74. package/node_modules/smol-toml/dist/struct.d.ts +32 -0
  75. package/node_modules/smol-toml/dist/struct.js +184 -0
  76. package/node_modules/smol-toml/dist/util.d.ts +42 -0
  77. package/node_modules/smol-toml/dist/util.js +111 -0
  78. package/node_modules/smol-toml/package.json +54 -0
  79. package/node_modules/tiny-stdio-mcp-server/dist/composition.json +1 -1
  80. package/node_modules/tiny-stdio-mcp-server/dist/server.js +9 -21
  81. package/node_modules/tiny-stdio-mcp-server/dist/uri-template.d.ts +6 -0
  82. package/node_modules/tiny-stdio-mcp-server/dist/uri-template.js +363 -0
  83. package/node_modules/tiny-stdio-mcp-server/package.json +0 -4
  84. package/node_modules/toolcraft-design/package.json +0 -5
  85. package/node_modules/toolcraft-schema/package.json +3 -2
  86. package/node_modules/yaml/LICENSE +13 -0
  87. package/node_modules/yaml/README.md +172 -0
  88. package/node_modules/yaml/bin.mjs +11 -0
  89. package/node_modules/yaml/browser/dist/compose/compose-collection.js +88 -0
  90. package/node_modules/yaml/browser/dist/compose/compose-doc.js +43 -0
  91. package/node_modules/yaml/browser/dist/compose/compose-node.js +109 -0
  92. package/node_modules/yaml/browser/dist/compose/compose-scalar.js +86 -0
  93. package/node_modules/yaml/browser/dist/compose/composer.js +219 -0
  94. package/node_modules/yaml/browser/dist/compose/resolve-block-map.js +115 -0
  95. package/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +198 -0
  96. package/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +49 -0
  97. package/node_modules/yaml/browser/dist/compose/resolve-end.js +37 -0
  98. package/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +207 -0
  99. package/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +225 -0
  100. package/node_modules/yaml/browser/dist/compose/resolve-props.js +146 -0
  101. package/node_modules/yaml/browser/dist/compose/util-contains-newline.js +34 -0
  102. package/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +26 -0
  103. package/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +15 -0
  104. package/node_modules/yaml/browser/dist/compose/util-map-includes.js +13 -0
  105. package/node_modules/yaml/browser/dist/doc/Document.js +335 -0
  106. package/node_modules/yaml/browser/dist/doc/anchors.js +71 -0
  107. package/node_modules/yaml/browser/dist/doc/applyReviver.js +55 -0
  108. package/node_modules/yaml/browser/dist/doc/createNode.js +88 -0
  109. package/node_modules/yaml/browser/dist/doc/directives.js +176 -0
  110. package/node_modules/yaml/browser/dist/errors.js +57 -0
  111. package/node_modules/yaml/browser/dist/index.js +17 -0
  112. package/node_modules/yaml/browser/dist/log.js +11 -0
  113. package/node_modules/yaml/browser/dist/nodes/Alias.js +116 -0
  114. package/node_modules/yaml/browser/dist/nodes/Collection.js +147 -0
  115. package/node_modules/yaml/browser/dist/nodes/Node.js +38 -0
  116. package/node_modules/yaml/browser/dist/nodes/Pair.js +36 -0
  117. package/node_modules/yaml/browser/dist/nodes/Scalar.js +24 -0
  118. package/node_modules/yaml/browser/dist/nodes/YAMLMap.js +144 -0
  119. package/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +113 -0
  120. package/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +63 -0
  121. package/node_modules/yaml/browser/dist/nodes/identity.js +36 -0
  122. package/node_modules/yaml/browser/dist/nodes/toJS.js +37 -0
  123. package/node_modules/yaml/browser/dist/parse/cst-scalar.js +214 -0
  124. package/node_modules/yaml/browser/dist/parse/cst-stringify.js +61 -0
  125. package/node_modules/yaml/browser/dist/parse/cst-visit.js +97 -0
  126. package/node_modules/yaml/browser/dist/parse/cst.js +98 -0
  127. package/node_modules/yaml/browser/dist/parse/lexer.js +721 -0
  128. package/node_modules/yaml/browser/dist/parse/line-counter.js +39 -0
  129. package/node_modules/yaml/browser/dist/parse/parser.js +975 -0
  130. package/node_modules/yaml/browser/dist/public-api.js +102 -0
  131. package/node_modules/yaml/browser/dist/schema/Schema.js +37 -0
  132. package/node_modules/yaml/browser/dist/schema/common/map.js +17 -0
  133. package/node_modules/yaml/browser/dist/schema/common/null.js +15 -0
  134. package/node_modules/yaml/browser/dist/schema/common/seq.js +17 -0
  135. package/node_modules/yaml/browser/dist/schema/common/string.js +14 -0
  136. package/node_modules/yaml/browser/dist/schema/core/bool.js +19 -0
  137. package/node_modules/yaml/browser/dist/schema/core/float.js +43 -0
  138. package/node_modules/yaml/browser/dist/schema/core/int.js +38 -0
  139. package/node_modules/yaml/browser/dist/schema/core/schema.js +23 -0
  140. package/node_modules/yaml/browser/dist/schema/json/schema.js +62 -0
  141. package/node_modules/yaml/browser/dist/schema/tags.js +96 -0
  142. package/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +58 -0
  143. package/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +26 -0
  144. package/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +46 -0
  145. package/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +71 -0
  146. package/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +67 -0
  147. package/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +74 -0
  148. package/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +78 -0
  149. package/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +39 -0
  150. package/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +93 -0
  151. package/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +101 -0
  152. package/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +146 -0
  153. package/node_modules/yaml/browser/dist/stringify/stringify.js +129 -0
  154. package/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +153 -0
  155. package/node_modules/yaml/browser/dist/stringify/stringifyComment.js +20 -0
  156. package/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +85 -0
  157. package/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +25 -0
  158. package/node_modules/yaml/browser/dist/stringify/stringifyPair.js +150 -0
  159. package/node_modules/yaml/browser/dist/stringify/stringifyString.js +336 -0
  160. package/node_modules/yaml/browser/dist/util.js +11 -0
  161. package/node_modules/yaml/browser/dist/visit.js +233 -0
  162. package/node_modules/yaml/browser/index.js +5 -0
  163. package/node_modules/yaml/browser/package.json +3 -0
  164. package/node_modules/yaml/dist/cli.d.ts +8 -0
  165. package/node_modules/yaml/dist/cli.mjs +201 -0
  166. package/node_modules/yaml/dist/compose/compose-collection.d.ts +11 -0
  167. package/node_modules/yaml/dist/compose/compose-collection.js +90 -0
  168. package/node_modules/yaml/dist/compose/compose-doc.d.ts +7 -0
  169. package/node_modules/yaml/dist/compose/compose-doc.js +45 -0
  170. package/node_modules/yaml/dist/compose/compose-node.d.ts +29 -0
  171. package/node_modules/yaml/dist/compose/compose-node.js +112 -0
  172. package/node_modules/yaml/dist/compose/compose-scalar.d.ts +5 -0
  173. package/node_modules/yaml/dist/compose/compose-scalar.js +88 -0
  174. package/node_modules/yaml/dist/compose/composer.d.ts +63 -0
  175. package/node_modules/yaml/dist/compose/composer.js +224 -0
  176. package/node_modules/yaml/dist/compose/resolve-block-map.d.ts +6 -0
  177. package/node_modules/yaml/dist/compose/resolve-block-map.js +117 -0
  178. package/node_modules/yaml/dist/compose/resolve-block-scalar.d.ts +11 -0
  179. package/node_modules/yaml/dist/compose/resolve-block-scalar.js +200 -0
  180. package/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +6 -0
  181. package/node_modules/yaml/dist/compose/resolve-block-seq.js +51 -0
  182. package/node_modules/yaml/dist/compose/resolve-end.d.ts +6 -0
  183. package/node_modules/yaml/dist/compose/resolve-end.js +39 -0
  184. package/node_modules/yaml/dist/compose/resolve-flow-collection.d.ts +7 -0
  185. package/node_modules/yaml/dist/compose/resolve-flow-collection.js +209 -0
  186. package/node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts +10 -0
  187. package/node_modules/yaml/dist/compose/resolve-flow-scalar.js +227 -0
  188. package/node_modules/yaml/dist/compose/resolve-props.d.ts +23 -0
  189. package/node_modules/yaml/dist/compose/resolve-props.js +148 -0
  190. package/node_modules/yaml/dist/compose/util-contains-newline.d.ts +2 -0
  191. package/node_modules/yaml/dist/compose/util-contains-newline.js +36 -0
  192. package/node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts +2 -0
  193. package/node_modules/yaml/dist/compose/util-empty-scalar-position.js +28 -0
  194. package/node_modules/yaml/dist/compose/util-flow-indent-check.d.ts +3 -0
  195. package/node_modules/yaml/dist/compose/util-flow-indent-check.js +17 -0
  196. package/node_modules/yaml/dist/compose/util-map-includes.d.ts +4 -0
  197. package/node_modules/yaml/dist/compose/util-map-includes.js +15 -0
  198. package/node_modules/yaml/dist/doc/Document.d.ts +141 -0
  199. package/node_modules/yaml/dist/doc/Document.js +337 -0
  200. package/node_modules/yaml/dist/doc/anchors.d.ts +24 -0
  201. package/node_modules/yaml/dist/doc/anchors.js +76 -0
  202. package/node_modules/yaml/dist/doc/applyReviver.d.ts +9 -0
  203. package/node_modules/yaml/dist/doc/applyReviver.js +57 -0
  204. package/node_modules/yaml/dist/doc/createNode.d.ts +17 -0
  205. package/node_modules/yaml/dist/doc/createNode.js +90 -0
  206. package/node_modules/yaml/dist/doc/directives.d.ts +49 -0
  207. package/node_modules/yaml/dist/doc/directives.js +178 -0
  208. package/node_modules/yaml/dist/errors.d.ts +21 -0
  209. package/node_modules/yaml/dist/errors.js +62 -0
  210. package/node_modules/yaml/dist/index.d.ts +25 -0
  211. package/node_modules/yaml/dist/index.js +50 -0
  212. package/node_modules/yaml/dist/log.d.ts +3 -0
  213. package/node_modules/yaml/dist/log.js +19 -0
  214. package/node_modules/yaml/dist/nodes/Alias.d.ts +29 -0
  215. package/node_modules/yaml/dist/nodes/Alias.js +118 -0
  216. package/node_modules/yaml/dist/nodes/Collection.d.ts +73 -0
  217. package/node_modules/yaml/dist/nodes/Collection.js +151 -0
  218. package/node_modules/yaml/dist/nodes/Node.d.ts +53 -0
  219. package/node_modules/yaml/dist/nodes/Node.js +40 -0
  220. package/node_modules/yaml/dist/nodes/Pair.d.ts +22 -0
  221. package/node_modules/yaml/dist/nodes/Pair.js +39 -0
  222. package/node_modules/yaml/dist/nodes/Scalar.d.ts +47 -0
  223. package/node_modules/yaml/dist/nodes/Scalar.js +27 -0
  224. package/node_modules/yaml/dist/nodes/YAMLMap.d.ts +53 -0
  225. package/node_modules/yaml/dist/nodes/YAMLMap.js +147 -0
  226. package/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +60 -0
  227. package/node_modules/yaml/dist/nodes/YAMLSeq.js +115 -0
  228. package/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts +4 -0
  229. package/node_modules/yaml/dist/nodes/addPairToJSMap.js +65 -0
  230. package/node_modules/yaml/dist/nodes/identity.d.ts +23 -0
  231. package/node_modules/yaml/dist/nodes/identity.js +53 -0
  232. package/node_modules/yaml/dist/nodes/toJS.d.ts +29 -0
  233. package/node_modules/yaml/dist/nodes/toJS.js +39 -0
  234. package/node_modules/yaml/dist/options.d.ts +350 -0
  235. package/node_modules/yaml/dist/parse/cst-scalar.d.ts +64 -0
  236. package/node_modules/yaml/dist/parse/cst-scalar.js +218 -0
  237. package/node_modules/yaml/dist/parse/cst-stringify.d.ts +8 -0
  238. package/node_modules/yaml/dist/parse/cst-stringify.js +63 -0
  239. package/node_modules/yaml/dist/parse/cst-visit.d.ts +39 -0
  240. package/node_modules/yaml/dist/parse/cst-visit.js +99 -0
  241. package/node_modules/yaml/dist/parse/cst.d.ts +109 -0
  242. package/node_modules/yaml/dist/parse/cst.js +112 -0
  243. package/node_modules/yaml/dist/parse/lexer.d.ts +87 -0
  244. package/node_modules/yaml/dist/parse/lexer.js +723 -0
  245. package/node_modules/yaml/dist/parse/line-counter.d.ts +22 -0
  246. package/node_modules/yaml/dist/parse/line-counter.js +41 -0
  247. package/node_modules/yaml/dist/parse/parser.d.ts +84 -0
  248. package/node_modules/yaml/dist/parse/parser.js +980 -0
  249. package/node_modules/yaml/dist/public-api.d.ts +44 -0
  250. package/node_modules/yaml/dist/public-api.js +107 -0
  251. package/node_modules/yaml/dist/schema/Schema.d.ts +17 -0
  252. package/node_modules/yaml/dist/schema/Schema.js +39 -0
  253. package/node_modules/yaml/dist/schema/common/map.d.ts +2 -0
  254. package/node_modules/yaml/dist/schema/common/map.js +19 -0
  255. package/node_modules/yaml/dist/schema/common/null.d.ts +4 -0
  256. package/node_modules/yaml/dist/schema/common/null.js +17 -0
  257. package/node_modules/yaml/dist/schema/common/seq.d.ts +2 -0
  258. package/node_modules/yaml/dist/schema/common/seq.js +19 -0
  259. package/node_modules/yaml/dist/schema/common/string.d.ts +2 -0
  260. package/node_modules/yaml/dist/schema/common/string.js +16 -0
  261. package/node_modules/yaml/dist/schema/core/bool.d.ts +4 -0
  262. package/node_modules/yaml/dist/schema/core/bool.js +21 -0
  263. package/node_modules/yaml/dist/schema/core/float.d.ts +4 -0
  264. package/node_modules/yaml/dist/schema/core/float.js +47 -0
  265. package/node_modules/yaml/dist/schema/core/int.d.ts +4 -0
  266. package/node_modules/yaml/dist/schema/core/int.js +42 -0
  267. package/node_modules/yaml/dist/schema/core/schema.d.ts +1 -0
  268. package/node_modules/yaml/dist/schema/core/schema.js +25 -0
  269. package/node_modules/yaml/dist/schema/json/schema.d.ts +2 -0
  270. package/node_modules/yaml/dist/schema/json/schema.js +64 -0
  271. package/node_modules/yaml/dist/schema/json-schema.d.ts +69 -0
  272. package/node_modules/yaml/dist/schema/tags.d.ts +48 -0
  273. package/node_modules/yaml/dist/schema/tags.js +99 -0
  274. package/node_modules/yaml/dist/schema/types.d.ts +92 -0
  275. package/node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts +2 -0
  276. package/node_modules/yaml/dist/schema/yaml-1.1/binary.js +70 -0
  277. package/node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts +7 -0
  278. package/node_modules/yaml/dist/schema/yaml-1.1/bool.js +29 -0
  279. package/node_modules/yaml/dist/schema/yaml-1.1/float.d.ts +4 -0
  280. package/node_modules/yaml/dist/schema/yaml-1.1/float.js +50 -0
  281. package/node_modules/yaml/dist/schema/yaml-1.1/int.d.ts +5 -0
  282. package/node_modules/yaml/dist/schema/yaml-1.1/int.js +76 -0
  283. package/node_modules/yaml/dist/schema/yaml-1.1/merge.d.ts +9 -0
  284. package/node_modules/yaml/dist/schema/yaml-1.1/merge.js +71 -0
  285. package/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +22 -0
  286. package/node_modules/yaml/dist/schema/yaml-1.1/omap.js +77 -0
  287. package/node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts +10 -0
  288. package/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +82 -0
  289. package/node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts +1 -0
  290. package/node_modules/yaml/dist/schema/yaml-1.1/schema.js +41 -0
  291. package/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +28 -0
  292. package/node_modules/yaml/dist/schema/yaml-1.1/set.js +96 -0
  293. package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts +6 -0
  294. package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +105 -0
  295. package/node_modules/yaml/dist/stringify/foldFlowLines.d.ts +34 -0
  296. package/node_modules/yaml/dist/stringify/foldFlowLines.js +151 -0
  297. package/node_modules/yaml/dist/stringify/stringify.d.ts +21 -0
  298. package/node_modules/yaml/dist/stringify/stringify.js +132 -0
  299. package/node_modules/yaml/dist/stringify/stringifyCollection.d.ts +17 -0
  300. package/node_modules/yaml/dist/stringify/stringifyCollection.js +155 -0
  301. package/node_modules/yaml/dist/stringify/stringifyComment.d.ts +10 -0
  302. package/node_modules/yaml/dist/stringify/stringifyComment.js +24 -0
  303. package/node_modules/yaml/dist/stringify/stringifyDocument.d.ts +4 -0
  304. package/node_modules/yaml/dist/stringify/stringifyDocument.js +87 -0
  305. package/node_modules/yaml/dist/stringify/stringifyNumber.d.ts +2 -0
  306. package/node_modules/yaml/dist/stringify/stringifyNumber.js +27 -0
  307. package/node_modules/yaml/dist/stringify/stringifyPair.d.ts +3 -0
  308. package/node_modules/yaml/dist/stringify/stringifyPair.js +152 -0
  309. package/node_modules/yaml/dist/stringify/stringifyString.d.ts +9 -0
  310. package/node_modules/yaml/dist/stringify/stringifyString.js +338 -0
  311. package/node_modules/yaml/dist/test-events.d.ts +4 -0
  312. package/node_modules/yaml/dist/test-events.js +134 -0
  313. package/node_modules/yaml/dist/util.d.ts +16 -0
  314. package/node_modules/yaml/dist/util.js +28 -0
  315. package/node_modules/yaml/dist/visit.d.ts +102 -0
  316. package/node_modules/yaml/dist/visit.js +236 -0
  317. package/node_modules/yaml/package.json +97 -0
  318. package/node_modules/yaml/util.js +2 -0
  319. package/package.json +12 -7
@@ -0,0 +1,218 @@
1
+ import stringWidth from 'fast-string-width';
2
+ const ESC = '\x1B';
3
+ const CSI = '\x9B';
4
+ const END_CODE = 39;
5
+ const ANSI_ESCAPE_BELL = '\u0007';
6
+ const ANSI_CSI = '[';
7
+ const ANSI_OSC = ']';
8
+ const ANSI_SGR_TERMINATOR = 'm';
9
+ const ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
10
+ const GROUP_REGEX = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`, 'y');
11
+ const getClosingCode = (openingCode) => {
12
+ if (openingCode >= 30 && openingCode <= 37)
13
+ return 39;
14
+ if (openingCode >= 90 && openingCode <= 97)
15
+ return 39;
16
+ if (openingCode >= 40 && openingCode <= 47)
17
+ return 49;
18
+ if (openingCode >= 100 && openingCode <= 107)
19
+ return 49;
20
+ if (openingCode === 1 || openingCode === 2)
21
+ return 22;
22
+ if (openingCode === 3)
23
+ return 23;
24
+ if (openingCode === 4)
25
+ return 24;
26
+ if (openingCode === 7)
27
+ return 27;
28
+ if (openingCode === 8)
29
+ return 28;
30
+ if (openingCode === 9)
31
+ return 29;
32
+ if (openingCode === 0)
33
+ return 0;
34
+ return undefined;
35
+ };
36
+ const wrapAnsiCode = (code) => `${ESC}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
37
+ const wrapAnsiHyperlink = (url) => `${ESC}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;
38
+ const wrapWord = (rows, word, columns) => {
39
+ const characters = word[Symbol.iterator]();
40
+ let isInsideEscape = false;
41
+ let isInsideLinkEscape = false;
42
+ let lastRow = rows.at(-1);
43
+ let visible = lastRow === undefined ? 0 : stringWidth(lastRow);
44
+ let currentCharacter = characters.next();
45
+ let nextCharacter = characters.next();
46
+ let rawCharacterIndex = 0;
47
+ while (!currentCharacter.done) {
48
+ const character = currentCharacter.value;
49
+ const characterLength = stringWidth(character);
50
+ if (visible + characterLength <= columns) {
51
+ rows[rows.length - 1] += character;
52
+ }
53
+ else {
54
+ rows.push(character);
55
+ visible = 0;
56
+ }
57
+ if (character === ESC || character === CSI) {
58
+ isInsideEscape = true;
59
+ isInsideLinkEscape = word.startsWith(ANSI_ESCAPE_LINK, rawCharacterIndex + 1);
60
+ }
61
+ if (isInsideEscape) {
62
+ if (isInsideLinkEscape) {
63
+ if (character === ANSI_ESCAPE_BELL) {
64
+ isInsideEscape = false;
65
+ isInsideLinkEscape = false;
66
+ }
67
+ }
68
+ else if (character === ANSI_SGR_TERMINATOR) {
69
+ isInsideEscape = false;
70
+ }
71
+ }
72
+ else {
73
+ visible += characterLength;
74
+ if (visible === columns && !nextCharacter.done) {
75
+ rows.push('');
76
+ visible = 0;
77
+ }
78
+ }
79
+ currentCharacter = nextCharacter;
80
+ nextCharacter = characters.next();
81
+ rawCharacterIndex += character.length;
82
+ }
83
+ lastRow = rows.at(-1);
84
+ if (!visible && lastRow !== undefined && lastRow.length && rows.length > 1) {
85
+ rows[rows.length - 2] += rows.pop();
86
+ }
87
+ };
88
+ const stringVisibleTrimSpacesRight = (string) => {
89
+ const words = string.split(' ');
90
+ let last = words.length;
91
+ while (last) {
92
+ if (stringWidth(words[last - 1])) {
93
+ break;
94
+ }
95
+ last--;
96
+ }
97
+ if (last === words.length) {
98
+ return string;
99
+ }
100
+ return words.slice(0, last).join(' ') + words.slice(last).join('');
101
+ };
102
+ const exec = (string, columns, options = {}) => {
103
+ if (options.trim !== false && string.trim() === '') {
104
+ return '';
105
+ }
106
+ let returnValue = '';
107
+ let escapeCode;
108
+ let escapeUrl;
109
+ const words = string.split(' ');
110
+ let rows = [''];
111
+ let rowLength = 0;
112
+ for (let index = 0; index < words.length; index++) {
113
+ const word = words[index];
114
+ if (options.trim !== false) {
115
+ const row = rows.at(-1) ?? '';
116
+ const trimmed = row.trimStart();
117
+ if (row.length !== trimmed.length) {
118
+ rows[rows.length - 1] = trimmed;
119
+ rowLength = stringWidth(trimmed);
120
+ }
121
+ }
122
+ if (index !== 0) {
123
+ if (rowLength >= columns &&
124
+ (options.wordWrap === false || options.trim === false)) {
125
+ rows.push('');
126
+ rowLength = 0;
127
+ }
128
+ if (rowLength || options.trim === false) {
129
+ rows[rows.length - 1] += ' ';
130
+ rowLength++;
131
+ }
132
+ }
133
+ const wordLength = stringWidth(word);
134
+ if (options.hard && wordLength > columns) {
135
+ const remainingColumns = columns - rowLength;
136
+ const breaksStartingThisLine = 1 + Math.floor((wordLength - remainingColumns - 1) / columns);
137
+ const breaksStartingNextLine = Math.floor((wordLength - 1) / columns);
138
+ if (breaksStartingNextLine < breaksStartingThisLine) {
139
+ rows.push('');
140
+ }
141
+ wrapWord(rows, word, columns);
142
+ rowLength = stringWidth(rows.at(-1) ?? '');
143
+ continue;
144
+ }
145
+ if (rowLength + wordLength > columns && rowLength && wordLength) {
146
+ if (options.wordWrap === false && rowLength < columns) {
147
+ wrapWord(rows, word, columns);
148
+ rowLength = stringWidth(rows.at(-1) ?? '');
149
+ continue;
150
+ }
151
+ rows.push('');
152
+ rowLength = 0;
153
+ }
154
+ if (rowLength + wordLength > columns && options.wordWrap === false) {
155
+ wrapWord(rows, word, columns);
156
+ rowLength = stringWidth(rows.at(-1) ?? '');
157
+ continue;
158
+ }
159
+ rows[rows.length - 1] += word;
160
+ rowLength += wordLength;
161
+ }
162
+ if (options.trim !== false) {
163
+ rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
164
+ }
165
+ const preString = rows.join('\n');
166
+ let inSurrogate = false;
167
+ for (let i = 0; i < preString.length; i++) {
168
+ const character = preString[i];
169
+ returnValue += character;
170
+ if (!inSurrogate) {
171
+ inSurrogate = character >= '\ud800' && character <= '\udbff';
172
+ if (inSurrogate) {
173
+ continue;
174
+ }
175
+ }
176
+ else {
177
+ inSurrogate = false;
178
+ }
179
+ if (character === ESC || character === CSI) {
180
+ GROUP_REGEX.lastIndex = i + 1;
181
+ const groupsResult = GROUP_REGEX.exec(preString);
182
+ const groups = groupsResult?.groups;
183
+ if (groups?.code !== undefined) {
184
+ const code = Number.parseFloat(groups.code);
185
+ escapeCode = code === END_CODE ? undefined : code;
186
+ }
187
+ else if (groups?.uri !== undefined) {
188
+ escapeUrl = groups.uri.length === 0 ? undefined : groups.uri;
189
+ }
190
+ }
191
+ if (preString[i + 1] === '\n') {
192
+ if (escapeUrl) {
193
+ returnValue += wrapAnsiHyperlink('');
194
+ }
195
+ const closingCode = escapeCode ? getClosingCode(escapeCode) : undefined;
196
+ if (escapeCode && closingCode) {
197
+ returnValue += wrapAnsiCode(closingCode);
198
+ }
199
+ }
200
+ else if (character === '\n') {
201
+ if (escapeCode && getClosingCode(escapeCode)) {
202
+ returnValue += wrapAnsiCode(escapeCode);
203
+ }
204
+ if (escapeUrl) {
205
+ returnValue += wrapAnsiHyperlink(escapeUrl);
206
+ }
207
+ }
208
+ }
209
+ return returnValue;
210
+ };
211
+ const CRLF_OR_LF = /\r?\n/;
212
+ export function wrapAnsi(string, columns, options) {
213
+ return String(string)
214
+ .normalize()
215
+ .split(CRLF_OR_LF)
216
+ .map((line) => exec(line, columns, options))
217
+ .join('\n');
218
+ }
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "fast-wrap-ansi",
3
+ "version": "0.2.2",
4
+ "files": [
5
+ "lib"
6
+ ],
7
+ "description": "A tiny and fast text wrap library which takes ANSI escapes into account.",
8
+ "keywords": [
9
+ "wrap",
10
+ "ansi",
11
+ "term",
12
+ "colors"
13
+ ],
14
+ "homepage": "https://github.com/43081j/fast-wrap-ansi#readme",
15
+ "bugs": {
16
+ "url": "https://github.com/43081j/fast-wrap-ansi/issues"
17
+ },
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/43081j/fast-wrap-ansi.git"
21
+ },
22
+ "license": "MIT",
23
+ "author": "James Garbutt (https://github.com/43081j)",
24
+ "type": "module",
25
+ "main": "lib/main.js",
26
+ "scripts": {
27
+ "format": "prettier --write src test",
28
+ "lint": "npm run lint:js && npm run lint:format && npm run lint:types",
29
+ "lint:js": "eslint src test",
30
+ "lint:format": "prettier --check src test",
31
+ "lint:types": "npx tsc --noEmit -p tsconfig.test.json",
32
+ "build": "tsc",
33
+ "test": "vitest run"
34
+ },
35
+ "devDependencies": {
36
+ "@eslint/js": "^10.0.1",
37
+ "@types/node": "^25.8.0",
38
+ "eslint": "^10.4.0",
39
+ "fast-wrap-ansi-prod": "npm:fast-wrap-ansi@*",
40
+ "picocolors": "^1.1.1",
41
+ "prettier": "^3.8.3",
42
+ "tinybench": "^6.0.2",
43
+ "typescript": "^6.0.3",
44
+ "typescript-eslint": "^8.59.3",
45
+ "vitest": "^4.1.6",
46
+ "wrap-ansi": "^10.0.0"
47
+ },
48
+ "dependencies": {
49
+ "fast-string-width": "^3.0.2"
50
+ }
51
+ }
@@ -0,0 +1,21 @@
1
+ Copyright (c) 2013 Kael Zhang <i@kael.me>, contributors
2
+ http://kael.me/
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining
5
+ a copy of this software and associated documentation files (the
6
+ "Software"), to deal in the Software without restriction, including
7
+ without limitation the rights to use, copy, modify, merge, publish,
8
+ distribute, sublicense, and/or sell copies of the Software, and to
9
+ permit persons to whom the Software is furnished to do so, subject to
10
+ the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,412 @@
1
+ <table><thead>
2
+ <tr>
3
+ <th>Linux</th>
4
+ <th>OS X</th>
5
+ <th>Windows</th>
6
+ <th>Coverage</th>
7
+ <th>Downloads</th>
8
+ </tr>
9
+ </thead><tbody><tr>
10
+ <td colspan="2" align="center">
11
+ <a href="https://github.com/kaelzhang/node-ignore/actions/workflows/nodejs.yml">
12
+ <img
13
+ src="https://github.com/kaelzhang/node-ignore/actions/workflows/nodejs.yml/badge.svg"
14
+ alt="Build Status" /></a>
15
+ </td>
16
+ <td align="center">
17
+ <a href="https://ci.appveyor.com/project/kaelzhang/node-ignore">
18
+ <img
19
+ src="https://ci.appveyor.com/api/projects/status/github/kaelzhang/node-ignore?branch=master&svg=true"
20
+ alt="Windows Build Status" /></a>
21
+ </td>
22
+ <td align="center">
23
+ <a href="https://codecov.io/gh/kaelzhang/node-ignore">
24
+ <img
25
+ src="https://codecov.io/gh/kaelzhang/node-ignore/branch/master/graph/badge.svg"
26
+ alt="Coverage Status" /></a>
27
+ </td>
28
+ <td align="center">
29
+ <a href="https://www.npmjs.org/package/ignore">
30
+ <img
31
+ src="http://img.shields.io/npm/dm/ignore.svg"
32
+ alt="npm module downloads per month" /></a>
33
+ </td>
34
+ </tr></tbody></table>
35
+
36
+ # ignore
37
+
38
+ `ignore` is a manager, filter and parser which implemented in pure JavaScript according to the [.gitignore spec 2.22.1](http://git-scm.com/docs/gitignore).
39
+
40
+ `ignore` is used by eslint, gitbook and [many others](https://www.npmjs.com/browse/depended/ignore).
41
+
42
+ Pay **ATTENTION** that [`minimatch`](https://www.npmjs.org/package/minimatch) (which used by `fstream-ignore`) does not follow the gitignore spec.
43
+
44
+ To filter filenames according to a .gitignore file, I recommend this npm package, `ignore`.
45
+
46
+ To parse an `.npmignore` file, you should use `minimatch`, because an `.npmignore` file is parsed by npm using `minimatch` and it does not work in the .gitignore way.
47
+
48
+ ### Tested on
49
+
50
+ `ignore` is fully tested, and has more than **five hundreds** of unit tests.
51
+
52
+ - Linux + Node: `0.8` - `7.x`
53
+ - Windows + Node: `0.10` - `7.x`, node < `0.10` is not tested due to the lack of support of appveyor.
54
+
55
+ Actually, `ignore` does not rely on any versions of node specially.
56
+
57
+ Since `4.0.0`, ignore will no longer support `node < 6` by default, to use in node < 6, `require('ignore/legacy')`. For details, see [CHANGELOG](https://github.com/kaelzhang/node-ignore/blob/master/CHANGELOG.md).
58
+
59
+ ## Table Of Main Contents
60
+
61
+ - [Usage](#usage)
62
+ - [`Pathname` Conventions](#pathname-conventions)
63
+ - See Also:
64
+ - [`glob-gitignore`](https://www.npmjs.com/package/glob-gitignore) matches files using patterns and filters them according to gitignore rules.
65
+ - [Upgrade Guide](#upgrade-guide)
66
+
67
+ ## Install
68
+
69
+ ```sh
70
+ npm i ignore
71
+ ```
72
+
73
+ ## Usage
74
+
75
+ ```js
76
+ import ignore from 'ignore'
77
+ const ig = ignore().add(['.abc/*', '!.abc/d/'])
78
+ ```
79
+
80
+ ### Filter the given paths
81
+
82
+ ```js
83
+ const paths = [
84
+ '.abc/a.js', // filtered out
85
+ '.abc/d/e.js' // included
86
+ ]
87
+
88
+ ig.filter(paths) // ['.abc/d/e.js']
89
+ ig.ignores('.abc/a.js') // true
90
+ ```
91
+
92
+ ### As the filter function
93
+
94
+ ```js
95
+ paths.filter(ig.createFilter()); // ['.abc/d/e.js']
96
+ ```
97
+
98
+ ### Win32 paths will be handled
99
+
100
+ ```js
101
+ ig.filter(['.abc\\a.js', '.abc\\d\\e.js'])
102
+ // if the code above runs on windows, the result will be
103
+ // ['.abc\\d\\e.js']
104
+ ```
105
+
106
+ ## Why another ignore?
107
+
108
+ - `ignore` is a standalone module, and is much simpler so that it could easy work with other programs, unlike [isaacs](https://npmjs.org/~isaacs)'s [fstream-ignore](https://npmjs.org/package/fstream-ignore) which must work with the modules of the fstream family.
109
+
110
+ - `ignore` only contains utility methods to filter paths according to the specified ignore rules, so
111
+ - `ignore` never try to find out ignore rules by traversing directories or fetching from git configurations.
112
+ - `ignore` don't cares about sub-modules of git projects.
113
+
114
+ - Exactly according to [gitignore man page](http://git-scm.com/docs/gitignore), fixes some known matching issues of fstream-ignore, such as:
115
+ - '`/*.js`' should only match '`a.js`', but not '`abc/a.js`'.
116
+ - '`**/foo`' should match '`foo`' anywhere.
117
+ - Prevent re-including a file if a parent directory of that file is excluded.
118
+ - Handle trailing whitespaces:
119
+ - `'a '`(one space) should not match `'a '`(two spaces).
120
+ - `'a \ '` matches `'a '`
121
+ - All test cases are verified with the result of `git check-ignore`.
122
+
123
+ # Methods
124
+
125
+ ## .add(pattern: string | Ignore): this
126
+ ## .add(patterns: Array<string | Ignore>): this
127
+
128
+ - **pattern** `String | Ignore` An ignore pattern string, or the `Ignore` instance
129
+ - **patterns** `Array<String | Ignore>` Array of ignore patterns.
130
+
131
+ Adds a rule or several rules to the current manager.
132
+
133
+ Returns `this`
134
+
135
+ Notice that a line starting with `'#'`(hash) is treated as a comment. Put a backslash (`'\'`) in front of the first hash for patterns that begin with a hash, if you want to ignore a file with a hash at the beginning of the filename.
136
+
137
+ ```js
138
+ ignore().add('#abc').ignores('#abc') // false
139
+ ignore().add('\\#abc').ignores('#abc') // true
140
+ ```
141
+
142
+ `pattern` could either be a line of ignore pattern or a string of multiple ignore patterns, which means we could just `ignore().add()` the content of a ignore file:
143
+
144
+ ```js
145
+ ignore()
146
+ .add(fs.readFileSync(filenameOfGitignore).toString())
147
+ .filter(filenames)
148
+ ```
149
+
150
+ `pattern` could also be an `ignore` instance, so that we could easily inherit the rules of another `Ignore` instance.
151
+
152
+ ## <strike>.addIgnoreFile(path)</strike>
153
+
154
+ REMOVED in `3.x` for now.
155
+
156
+ To upgrade `ignore@2.x` up to `3.x`, use
157
+
158
+ ```js
159
+ import fs from 'fs'
160
+
161
+ if (fs.existsSync(filename)) {
162
+ ignore().add(fs.readFileSync(filename).toString())
163
+ }
164
+ ```
165
+
166
+ instead.
167
+
168
+ ## .filter(paths: Array&lt;Pathname&gt;): Array&lt;Pathname&gt;
169
+
170
+ ```ts
171
+ type Pathname = string
172
+ ```
173
+
174
+ Filters the given array of pathnames, and returns the filtered array.
175
+
176
+ - **paths** `Array.<Pathname>` The array of `pathname`s to be filtered.
177
+
178
+ ### `Pathname` Conventions:
179
+
180
+ #### 1. `Pathname` should be a `path.relative()`d pathname
181
+
182
+ `Pathname` should be a string that have been `path.join()`ed, or the return value of `path.relative()` to the current directory,
183
+
184
+ ```js
185
+ // WRONG, an error will be thrown
186
+ ig.ignores('./abc')
187
+
188
+ // WRONG, for it will never happen, and an error will be thrown
189
+ // If the gitignore rule locates at the root directory,
190
+ // `'/abc'` should be changed to `'abc'`.
191
+ // ```
192
+ // path.relative('/', '/abc') -> 'abc'
193
+ // ```
194
+ ig.ignores('/abc')
195
+
196
+ // WRONG, that it is an absolute path on Windows, an error will be thrown
197
+ ig.ignores('C:\\abc')
198
+
199
+ // Right
200
+ ig.ignores('abc')
201
+
202
+ // Right
203
+ ig.ignores(path.join('./abc')) // path.join('./abc') -> 'abc'
204
+ ```
205
+
206
+ In other words, each `Pathname` here should be a relative path to the directory of the gitignore rules.
207
+
208
+ Suppose the dir structure is:
209
+
210
+ ```
211
+ /path/to/your/repo
212
+ |-- a
213
+ | |-- a.js
214
+ |
215
+ |-- .b
216
+ |
217
+ |-- .c
218
+ |-- .DS_store
219
+ ```
220
+
221
+ Then the `paths` might be like this:
222
+
223
+ ```js
224
+ [
225
+ 'a/a.js'
226
+ '.b',
227
+ '.c/.DS_store'
228
+ ]
229
+ ```
230
+
231
+ #### 2. filenames and dirnames
232
+
233
+ `node-ignore` does NO `fs.stat` during path matching, so for the example below:
234
+
235
+ ```js
236
+ // First, we add a ignore pattern to ignore a directory
237
+ ig.add('config/')
238
+
239
+ // `ig` does NOT know if 'config', in the real world,
240
+ // is a normal file, directory or something.
241
+
242
+ ig.ignores('config')
243
+ // `ig` treats `config` as a file, so it returns `false`
244
+
245
+ ig.ignores('config/')
246
+ // returns `true`
247
+ ```
248
+
249
+ Specially for people who develop some library based on `node-ignore`, it is important to understand that.
250
+
251
+ Usually, you could use [`glob`](http://npmjs.org/package/glob) with `option.mark = true` to fetch the structure of the current directory:
252
+
253
+ ```js
254
+ import glob from 'glob'
255
+
256
+ glob('**', {
257
+ // Adds a / character to directory matches.
258
+ mark: true
259
+ }, (err, files) => {
260
+ if (err) {
261
+ return console.error(err)
262
+ }
263
+
264
+ let filtered = ignore().add(patterns).filter(files)
265
+ console.log(filtered)
266
+ })
267
+ ```
268
+
269
+ ## .ignores(pathname: Pathname): boolean
270
+
271
+ > new in 3.2.0
272
+
273
+ Returns `Boolean` whether `pathname` should be ignored.
274
+
275
+ ```js
276
+ ig.ignores('.abc/a.js') // true
277
+ ```
278
+
279
+ ## .createFilter()
280
+
281
+ Creates a filter function which could filter an array of paths with `Array.prototype.filter`.
282
+
283
+ Returns `function(path)` the filter function.
284
+
285
+ ## .test(pathname: Pathname) since 5.0.0
286
+
287
+ Returns `TestResult`
288
+
289
+ ```ts
290
+ interface TestResult {
291
+ ignored: boolean
292
+ // true if the `pathname` is finally unignored by some negative pattern
293
+ unignored: boolean
294
+ }
295
+ ```
296
+
297
+ - `{ignored: true, unignored: false}`: the `pathname` is ignored
298
+ - `{ignored: false, unignored: true}`: the `pathname` is unignored
299
+ - `{ignored: false, unignored: false}`: the `pathname` is never matched by any ignore rules.
300
+
301
+ ## static `ignore.isPathValid(pathname): boolean` since 5.0.0
302
+
303
+ Check whether the `pathname` is an valid `path.relative()`d path according to the [convention](#1-pathname-should-be-a-pathrelatived-pathname).
304
+
305
+ This method is **NOT** used to check if an ignore pattern is valid.
306
+
307
+ ```js
308
+ ignore.isPathValid('./foo') // false
309
+ ```
310
+
311
+ ## ignore(options)
312
+
313
+ ### `options.ignorecase` since 4.0.0
314
+
315
+ Similar as the `core.ignorecase` option of [git-config](https://git-scm.com/docs/git-config), `node-ignore` will be case insensitive if `options.ignorecase` is set to `true` (the default value), otherwise case sensitive.
316
+
317
+ ```js
318
+ const ig = ignore({
319
+ ignorecase: false
320
+ })
321
+
322
+ ig.add('*.png')
323
+
324
+ ig.ignores('*.PNG') // false
325
+ ```
326
+
327
+ ### `options.ignoreCase?: boolean` since 5.2.0
328
+
329
+ Which is alternative to `options.ignoreCase`
330
+
331
+ ### `options.allowRelativePaths?: boolean` since 5.2.0
332
+
333
+ This option brings backward compatibility with projects which based on `ignore@4.x`. If `options.allowRelativePaths` is `true`, `ignore` will not check whether the given path to be tested is [`path.relative()`d](#pathname-conventions).
334
+
335
+ However, passing a relative path, such as `'./foo'` or `'../foo'`, to test if it is ignored or not is not a good practise, which might lead to unexpected behavior
336
+
337
+ ```js
338
+ ignore({
339
+ allowRelativePaths: true
340
+ }).ignores('../foo/bar.js') // And it will not throw
341
+ ```
342
+
343
+ ****
344
+
345
+ # Upgrade Guide
346
+
347
+ ## Upgrade 4.x -> 5.x
348
+
349
+ Since `5.0.0`, if an invalid `Pathname` passed into `ig.ignores()`, an error will be thrown, unless `options.allowRelative = true` is passed to the `Ignore` factory.
350
+
351
+ While `ignore < 5.0.0` did not make sure what the return value was, as well as
352
+
353
+ ```ts
354
+ .ignores(pathname: Pathname): boolean
355
+
356
+ .filter(pathnames: Array<Pathname>): Array<Pathname>
357
+
358
+ .createFilter(): (pathname: Pathname) => boolean
359
+
360
+ .test(pathname: Pathname): {ignored: boolean, unignored: boolean}
361
+ ```
362
+
363
+ See the convention [here](#1-pathname-should-be-a-pathrelatived-pathname) for details.
364
+
365
+ If there are invalid pathnames, the conversion and filtration should be done by users.
366
+
367
+ ```js
368
+ import {isPathValid} from 'ignore' // introduced in 5.0.0
369
+
370
+ const paths = [
371
+ // invalid
372
+ //////////////////
373
+ '',
374
+ false,
375
+ '../foo',
376
+ '.',
377
+ //////////////////
378
+
379
+ // valid
380
+ 'foo'
381
+ ]
382
+ .filter(isValidPath)
383
+
384
+ ig.filter(paths)
385
+ ```
386
+
387
+ ## Upgrade 3.x -> 4.x
388
+
389
+ Since `4.0.0`, `ignore` will no longer support node < 6, to use `ignore` in node < 6:
390
+
391
+ ```js
392
+ var ignore = require('ignore/legacy')
393
+ ```
394
+
395
+ ## Upgrade 2.x -> 3.x
396
+
397
+ - All `options` of 2.x are unnecessary and removed, so just remove them.
398
+ - `ignore()` instance is no longer an [`EventEmitter`](nodejs.org/api/events.html), and all events are unnecessary and removed.
399
+ - `.addIgnoreFile()` is removed, see the [.addIgnoreFile](#addignorefilepath) section for details.
400
+
401
+ ****
402
+
403
+ # Collaborators
404
+
405
+ - [@whitecolor](https://github.com/whitecolor) *Alex*
406
+ - [@SamyPesse](https://github.com/SamyPesse) *Samy Pessé*
407
+ - [@azproduction](https://github.com/azproduction) *Mikhail Davydov*
408
+ - [@TrySound](https://github.com/TrySound) *Bogdan Chadkin*
409
+ - [@JanMattner](https://github.com/JanMattner) *Jan Mattner*
410
+ - [@ntwb](https://github.com/ntwb) *Stephen Edgar*
411
+ - [@kasperisager](https://github.com/kasperisager) *Kasper Isager*
412
+ - [@sandersn](https://github.com/sandersn) *Nathan Shively-Sanders*