@mailwoman/core 10.1.0 → 10.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (429) hide show
  1. package/lib/api/APIClient.ts +5 -6
  2. package/lib/api/arcgis.ts +5 -5
  3. package/lib/api/ckan.ts +2 -1
  4. package/lib/api/disk-storage.ts +3 -3
  5. package/lib/api/ogc.ts +56 -52
  6. package/lib/api/pacer.ts +1 -1
  7. package/lib/api/retry.ts +6 -4
  8. package/lib/api/test/transport.ts +20 -20
  9. package/lib/api.ts +1 -0
  10. package/lib/coarse-placer/coarse-placer.ts +4 -3
  11. package/lib/crypto/node.ts +1 -2
  12. package/lib/decoder/build-tree.ts +5 -5
  13. package/lib/decoder/parse-diff.ts +47 -31
  14. package/lib/decoder/proposals-to-tree.ts +1 -0
  15. package/lib/decoder/serialize/json.ts +9 -6
  16. package/lib/decoder/serialize/tuples.ts +2 -1
  17. package/lib/decoder/serialize/xml.ts +15 -14
  18. package/lib/decoder/tree/shape.ts +14 -14
  19. package/lib/decoder/tree/walk.ts +2 -2
  20. package/lib/decoder/types.ts +48 -2
  21. package/lib/env/schema.ts +21 -23
  22. package/lib/env/utils.ts +4 -3
  23. package/lib/env.ts +4 -4
  24. package/lib/fs/delimited.ts +35 -1
  25. package/lib/fs/readers.ts +2 -5
  26. package/lib/fs/zip.ts +1 -1
  27. package/lib/geocode/result.ts +337 -0
  28. package/lib/git.ts +1 -1
  29. package/lib/html/document.ts +6 -6
  30. package/lib/html/elements.ts +26 -23
  31. package/lib/identical.ts +20 -0
  32. package/lib/json.ts +5 -7
  33. package/lib/layers/coverage.ts +28 -1
  34. package/lib/layers/feature-count.ts +3 -3
  35. package/lib/layers/manifest.ts +22 -21
  36. package/lib/layers/schema.ts +25 -1
  37. package/lib/license/configured.ts +3 -3
  38. package/lib/license/key/file.ts +2 -1
  39. package/lib/license/key.ts +3 -3
  40. package/lib/license/stamp.ts +4 -4
  41. package/lib/locale/locale.ts +1 -1
  42. package/lib/locale/registry.ts +2 -2
  43. package/lib/module/compiled-freshness.ts +1 -1
  44. package/lib/module/package-command.ts +4 -2
  45. package/lib/module/packaged-data.ts +1 -1
  46. package/lib/module/resolve-from.ts +1 -1
  47. package/lib/numeric.ts +4 -4
  48. package/lib/objects.ts +3 -0
  49. package/lib/paths.ts +16 -1
  50. package/lib/pipeline/client-result.ts +14 -14
  51. package/lib/pipeline/result.ts +5 -4
  52. package/lib/pipeline/runtime-pipeline.ts +65 -42
  53. package/lib/pipeline/span-proposer.ts +1 -1
  54. package/lib/pipeline/types.ts +328 -161
  55. package/lib/pipeline.ts +32 -7
  56. package/lib/policy/proposal-collection.ts +1 -1
  57. package/lib/policy/registry.ts +5 -3
  58. package/lib/resolver/authoritative-provider.ts +17 -17
  59. package/lib/resolver/coverage-facts.ts +3 -3
  60. package/lib/resolver/fixture-authoritative-provider.ts +4 -0
  61. package/lib/resolver/lookup-types.ts +54 -14
  62. package/lib/resolver/postcode-format.ts +9 -9
  63. package/lib/resolver/referential.ts +2 -2
  64. package/lib/resolver/types.ts +155 -51
  65. package/lib/resolver.ts +22 -20
  66. package/lib/resources/git.ts +1 -1
  67. package/lib/resources/languages.ts +0 -2
  68. package/lib/resources/libpostal.ts +1 -1
  69. package/lib/resources/whosonfirst/PlacetypeDataSource.ts +2 -6
  70. package/lib/resources/whosonfirst/extract-repo.ts +2 -1
  71. package/lib/resources/whosonfirst/placetypes/admin.ts +20 -25
  72. package/lib/resources/whosonfirst/placetypes/mermaid.ts +4 -3
  73. package/lib/resources/whosonfirst/placetypes/specificity.ts +7 -7
  74. package/lib/resources.ts +1 -0
  75. package/lib/scripting/arguments.ts +6 -5
  76. package/lib/scripting/command.ts +3 -2
  77. package/lib/scripting/operation.ts +2 -2
  78. package/lib/scripting/utils.ts +3 -5
  79. package/lib/strings/python-json.ts +1 -1
  80. package/lib/tokenization/Span.ts +1 -1
  81. package/lib/trust-policies.ts +0 -2
  82. package/lib/types/Classification.ts +1 -1
  83. package/lib/types/classifier.ts +1 -1
  84. package/lib/utils/geodatabase-archive.ts +13 -5
  85. package/lib/utils/sqlite-rows.ts +3 -3
  86. package/lib/utils/stream-to-disk.ts +1 -3
  87. package/lib/utils/union-find.ts +1 -1
  88. package/lib/vale.ts +1 -1
  89. package/lib/workspaces.ts +2 -2
  90. package/out/api/APIClient.d.ts +3 -3
  91. package/out/api/APIClient.d.ts.map +1 -1
  92. package/out/api/APIClient.js +2 -3
  93. package/out/api/APIClient.js.map +1 -1
  94. package/out/api/arcgis.d.ts +2 -2
  95. package/out/api/arcgis.d.ts.map +1 -1
  96. package/out/api/arcgis.js +6 -6
  97. package/out/api/arcgis.js.map +1 -1
  98. package/out/api/ckan.d.ts +2 -1
  99. package/out/api/ckan.d.ts.map +1 -1
  100. package/out/api/ckan.js.map +1 -1
  101. package/out/api/disk-storage.d.ts +1 -1
  102. package/out/api/disk-storage.js +2 -2
  103. package/out/api/disk-storage.js.map +1 -1
  104. package/out/api/ogc.d.ts +32 -27
  105. package/out/api/ogc.d.ts.map +1 -1
  106. package/out/api/ogc.js +41 -46
  107. package/out/api/ogc.js.map +1 -1
  108. package/out/api/pacer.d.ts +1 -1
  109. package/out/api/pacer.js +1 -1
  110. package/out/api/retry.d.ts +6 -4
  111. package/out/api/retry.d.ts.map +1 -1
  112. package/out/api/retry.js +1 -1
  113. package/out/api/retry.js.map +1 -1
  114. package/out/api/test/transport.d.ts +11 -11
  115. package/out/api/test/transport.d.ts.map +1 -1
  116. package/out/api/test/transport.js +16 -16
  117. package/out/api/test/transport.js.map +1 -1
  118. package/out/api.d.ts +1 -0
  119. package/out/api.d.ts.map +1 -1
  120. package/out/api.js +1 -0
  121. package/out/api.js.map +1 -1
  122. package/out/coarse-placer/coarse-placer.d.ts +3 -2
  123. package/out/coarse-placer/coarse-placer.d.ts.map +1 -1
  124. package/out/coarse-placer/coarse-placer.js +1 -1
  125. package/out/coarse-placer/coarse-placer.js.map +1 -1
  126. package/out/crypto/node.d.ts +1 -2
  127. package/out/crypto/node.d.ts.map +1 -1
  128. package/out/crypto/node.js +1 -2
  129. package/out/crypto/node.js.map +1 -1
  130. package/out/decoder/build-tree.js +5 -5
  131. package/out/decoder/build-tree.js.map +1 -1
  132. package/out/decoder/parse-diff.d.ts +19 -19
  133. package/out/decoder/parse-diff.d.ts.map +1 -1
  134. package/out/decoder/parse-diff.js +28 -12
  135. package/out/decoder/parse-diff.js.map +1 -1
  136. package/out/decoder/proposals-to-tree.d.ts.map +1 -1
  137. package/out/decoder/proposals-to-tree.js +1 -0
  138. package/out/decoder/proposals-to-tree.js.map +1 -1
  139. package/out/decoder/serialize/json.d.ts +35 -17
  140. package/out/decoder/serialize/json.d.ts.map +1 -1
  141. package/out/decoder/serialize/json.js +28 -0
  142. package/out/decoder/serialize/json.js.map +1 -1
  143. package/out/decoder/serialize/tuples.d.ts +2 -1
  144. package/out/decoder/serialize/tuples.d.ts.map +1 -1
  145. package/out/decoder/serialize/tuples.js.map +1 -1
  146. package/out/decoder/serialize/xml.d.ts +12 -11
  147. package/out/decoder/serialize/xml.d.ts.map +1 -1
  148. package/out/decoder/serialize/xml.js +3 -3
  149. package/out/decoder/serialize/xml.js.map +1 -1
  150. package/out/decoder/tree/shape.d.ts +6 -6
  151. package/out/decoder/tree/shape.d.ts.map +1 -1
  152. package/out/decoder/tree/shape.js +8 -8
  153. package/out/decoder/tree/shape.js.map +1 -1
  154. package/out/decoder/tree/walk.d.ts +1 -1
  155. package/out/decoder/tree/walk.d.ts.map +1 -1
  156. package/out/decoder/tree/walk.js +1 -1
  157. package/out/decoder/tree/walk.js.map +1 -1
  158. package/out/decoder/types.d.ts +55 -2
  159. package/out/decoder/types.d.ts.map +1 -1
  160. package/out/decoder/types.js +39 -1
  161. package/out/decoder/types.js.map +1 -1
  162. package/out/env/schema.d.ts +11 -12
  163. package/out/env/schema.d.ts.map +1 -1
  164. package/out/env/schema.js +15 -17
  165. package/out/env/schema.js.map +1 -1
  166. package/out/env/utils.d.ts +2 -2
  167. package/out/env/utils.d.ts.map +1 -1
  168. package/out/env/utils.js +2 -2
  169. package/out/env/utils.js.map +1 -1
  170. package/out/env.js +4 -4
  171. package/out/env.js.map +1 -1
  172. package/out/fs/delimited.d.ts +18 -0
  173. package/out/fs/delimited.d.ts.map +1 -1
  174. package/out/fs/delimited.js +31 -1
  175. package/out/fs/delimited.js.map +1 -1
  176. package/out/fs/readers.d.ts +2 -4
  177. package/out/fs/readers.d.ts.map +1 -1
  178. package/out/fs/readers.js +2 -4
  179. package/out/fs/readers.js.map +1 -1
  180. package/out/fs/zip.js +1 -1
  181. package/out/fs/zip.js.map +1 -1
  182. package/out/geocode/result.d.ts +475 -0
  183. package/out/geocode/result.d.ts.map +1 -0
  184. package/out/geocode/result.js +280 -0
  185. package/out/geocode/result.js.map +1 -0
  186. package/out/git.js +1 -1
  187. package/out/git.js.map +1 -1
  188. package/out/html/document.d.ts +3 -3
  189. package/out/html/document.d.ts.map +1 -1
  190. package/out/html/document.js +4 -4
  191. package/out/html/document.js.map +1 -1
  192. package/out/html/elements.d.ts +18 -15
  193. package/out/html/elements.d.ts.map +1 -1
  194. package/out/html/elements.js +17 -16
  195. package/out/html/elements.js.map +1 -1
  196. package/out/identical.d.ts +16 -0
  197. package/out/identical.d.ts.map +1 -0
  198. package/out/identical.js +19 -0
  199. package/out/identical.js.map +1 -0
  200. package/out/json.d.ts +3 -5
  201. package/out/json.d.ts.map +1 -1
  202. package/out/json.js +3 -5
  203. package/out/json.js.map +1 -1
  204. package/out/layers/coverage.d.ts +26 -1
  205. package/out/layers/coverage.d.ts.map +1 -1
  206. package/out/layers/coverage.js.map +1 -1
  207. package/out/layers/feature-count.d.ts +1 -1
  208. package/out/layers/feature-count.d.ts.map +1 -1
  209. package/out/layers/feature-count.js +2 -2
  210. package/out/layers/feature-count.js.map +1 -1
  211. package/out/layers/manifest.d.ts +11 -10
  212. package/out/layers/manifest.d.ts.map +1 -1
  213. package/out/layers/manifest.js +12 -13
  214. package/out/layers/manifest.js.map +1 -1
  215. package/out/layers/schema.d.ts +23 -0
  216. package/out/layers/schema.d.ts.map +1 -1
  217. package/out/layers/schema.js +1 -1
  218. package/out/layers/schema.js.map +1 -1
  219. package/out/license/configured.d.ts +1 -1
  220. package/out/license/configured.d.ts.map +1 -1
  221. package/out/license/configured.js +2 -2
  222. package/out/license/configured.js.map +1 -1
  223. package/out/license/key/file.d.ts.map +1 -1
  224. package/out/license/key/file.js +2 -1
  225. package/out/license/key/file.js.map +1 -1
  226. package/out/license/key.d.ts +1 -1
  227. package/out/license/key.d.ts.map +1 -1
  228. package/out/license/key.js +2 -2
  229. package/out/license/key.js.map +1 -1
  230. package/out/license/stamp.d.ts +2 -2
  231. package/out/license/stamp.d.ts.map +1 -1
  232. package/out/license/stamp.js +2 -2
  233. package/out/license/stamp.js.map +1 -1
  234. package/out/locale/locale.d.ts +1 -1
  235. package/out/locale/locale.d.ts.map +1 -1
  236. package/out/locale/registry.d.ts +1 -1
  237. package/out/locale/registry.d.ts.map +1 -1
  238. package/out/locale/registry.js +1 -1
  239. package/out/locale/registry.js.map +1 -1
  240. package/out/module/compiled-freshness.js +1 -1
  241. package/out/module/compiled-freshness.js.map +1 -1
  242. package/out/module/package-command.d.ts +3 -2
  243. package/out/module/package-command.d.ts.map +1 -1
  244. package/out/module/package-command.js +3 -2
  245. package/out/module/package-command.js.map +1 -1
  246. package/out/module/packaged-data.js +1 -1
  247. package/out/module/packaged-data.js.map +1 -1
  248. package/out/module/resolve-from.js +1 -1
  249. package/out/module/resolve-from.js.map +1 -1
  250. package/out/numeric.d.ts +1 -1
  251. package/out/numeric.d.ts.map +1 -1
  252. package/out/numeric.js +3 -3
  253. package/out/numeric.js.map +1 -1
  254. package/out/objects.d.ts +3 -0
  255. package/out/objects.d.ts.map +1 -1
  256. package/out/objects.js +3 -0
  257. package/out/objects.js.map +1 -1
  258. package/out/paths.d.ts +20 -1
  259. package/out/paths.d.ts.map +1 -1
  260. package/out/paths.js +1 -1
  261. package/out/paths.js.map +1 -1
  262. package/out/pipeline/client-result.d.ts +15 -15
  263. package/out/pipeline/client-result.d.ts.map +1 -1
  264. package/out/pipeline/client-result.js +1 -1
  265. package/out/pipeline/result.d.ts +4 -3
  266. package/out/pipeline/result.d.ts.map +1 -1
  267. package/out/pipeline/runtime-pipeline.d.ts +16 -9
  268. package/out/pipeline/runtime-pipeline.d.ts.map +1 -1
  269. package/out/pipeline/runtime-pipeline.js +43 -27
  270. package/out/pipeline/runtime-pipeline.js.map +1 -1
  271. package/out/pipeline/span-proposer.js +1 -1
  272. package/out/pipeline/span-proposer.js.map +1 -1
  273. package/out/pipeline/types.d.ts +394 -175
  274. package/out/pipeline/types.d.ts.map +1 -1
  275. package/out/pipeline/types.js +199 -4
  276. package/out/pipeline/types.js.map +1 -1
  277. package/out/pipeline.d.ts +4 -2
  278. package/out/pipeline.d.ts.map +1 -1
  279. package/out/pipeline.js +1 -1
  280. package/out/pipeline.js.map +1 -1
  281. package/out/policy/proposal-collection.d.ts +1 -1
  282. package/out/policy/proposal-collection.d.ts.map +1 -1
  283. package/out/policy/proposal-collection.js.map +1 -1
  284. package/out/policy/registry.d.ts +3 -1
  285. package/out/policy/registry.d.ts.map +1 -1
  286. package/out/policy/registry.js +4 -2
  287. package/out/policy/registry.js.map +1 -1
  288. package/out/resolver/authoritative-provider.d.ts +17 -17
  289. package/out/resolver/authoritative-provider.d.ts.map +1 -1
  290. package/out/resolver/authoritative-provider.js +2 -2
  291. package/out/resolver/coverage-facts.d.ts +3 -3
  292. package/out/resolver/coverage-facts.d.ts.map +1 -1
  293. package/out/resolver/fixture-authoritative-provider.d.ts.map +1 -1
  294. package/out/resolver/fixture-authoritative-provider.js +4 -0
  295. package/out/resolver/fixture-authoritative-provider.js.map +1 -1
  296. package/out/resolver/lookup-types.d.ts +52 -15
  297. package/out/resolver/lookup-types.d.ts.map +1 -1
  298. package/out/resolver/postcode-format.d.ts +3 -3
  299. package/out/resolver/postcode-format.d.ts.map +1 -1
  300. package/out/resolver/postcode-format.js +7 -7
  301. package/out/resolver/postcode-format.js.map +1 -1
  302. package/out/resolver/referential.d.ts +2 -2
  303. package/out/resolver/referential.d.ts.map +1 -1
  304. package/out/resolver/types.d.ts +126 -40
  305. package/out/resolver/types.d.ts.map +1 -1
  306. package/out/resolver/types.js +43 -1
  307. package/out/resolver/types.js.map +1 -1
  308. package/out/resolver.d.ts +5 -3
  309. package/out/resolver.d.ts.map +1 -1
  310. package/out/resolver.js +2 -2
  311. package/out/resolver.js.map +1 -1
  312. package/out/resources/git.js +1 -1
  313. package/out/resources/git.js.map +1 -1
  314. package/out/resources/languages.d.ts +0 -1
  315. package/out/resources/languages.d.ts.map +1 -1
  316. package/out/resources/languages.js +0 -1
  317. package/out/resources/languages.js.map +1 -1
  318. package/out/resources/libpostal.d.ts +1 -1
  319. package/out/resources/libpostal.d.ts.map +1 -1
  320. package/out/resources/whosonfirst/PlacetypeDataSource.d.ts +1 -1
  321. package/out/resources/whosonfirst/PlacetypeDataSource.d.ts.map +1 -1
  322. package/out/resources/whosonfirst/PlacetypeDataSource.js +2 -1
  323. package/out/resources/whosonfirst/PlacetypeDataSource.js.map +1 -1
  324. package/out/resources/whosonfirst/extract-repo.d.ts.map +1 -1
  325. package/out/resources/whosonfirst/extract-repo.js +2 -1
  326. package/out/resources/whosonfirst/extract-repo.js.map +1 -1
  327. package/out/resources/whosonfirst/placetypes/admin.d.ts +12 -12
  328. package/out/resources/whosonfirst/placetypes/admin.d.ts.map +1 -1
  329. package/out/resources/whosonfirst/placetypes/admin.js +9 -8
  330. package/out/resources/whosonfirst/placetypes/admin.js.map +1 -1
  331. package/out/resources/whosonfirst/placetypes/mermaid.d.ts +2 -1
  332. package/out/resources/whosonfirst/placetypes/mermaid.d.ts.map +1 -1
  333. package/out/resources/whosonfirst/placetypes/mermaid.js +1 -1
  334. package/out/resources/whosonfirst/placetypes/mermaid.js.map +1 -1
  335. package/out/resources/whosonfirst/placetypes/specificity.d.ts +3 -3
  336. package/out/resources/whosonfirst/placetypes/specificity.d.ts.map +1 -1
  337. package/out/resources/whosonfirst/placetypes/specificity.js +6 -6
  338. package/out/resources/whosonfirst/placetypes/specificity.js.map +1 -1
  339. package/out/resources.d.ts +1 -0
  340. package/out/resources.d.ts.map +1 -1
  341. package/out/resources.js +1 -0
  342. package/out/resources.js.map +1 -1
  343. package/out/scripting/arguments.d.ts +5 -4
  344. package/out/scripting/arguments.d.ts.map +1 -1
  345. package/out/scripting/arguments.js +5 -4
  346. package/out/scripting/arguments.js.map +1 -1
  347. package/out/scripting/command.d.ts +2 -2
  348. package/out/scripting/command.d.ts.map +1 -1
  349. package/out/scripting/command.js +1 -0
  350. package/out/scripting/command.js.map +1 -1
  351. package/out/scripting/operation.d.ts +1 -1
  352. package/out/scripting/operation.d.ts.map +1 -1
  353. package/out/scripting/operation.js +1 -1
  354. package/out/scripting/operation.js.map +1 -1
  355. package/out/scripting/utils.d.ts +3 -4
  356. package/out/scripting/utils.d.ts.map +1 -1
  357. package/out/scripting/utils.js +3 -4
  358. package/out/scripting/utils.js.map +1 -1
  359. package/out/strings/python-json.js +1 -1
  360. package/out/strings/python-json.js.map +1 -1
  361. package/out/tokenization/Span.d.ts +1 -1
  362. package/out/tokenization/Span.d.ts.map +1 -1
  363. package/out/tools/coarse-placer/build/dataset.d.ts +4 -2
  364. package/out/tools/coarse-placer/build/dataset.d.ts.map +1 -1
  365. package/out/tools/coarse-placer/build/dataset.js.map +1 -1
  366. package/out/tools/coarse-placer/build/outlier/exposure.d.ts +5 -3
  367. package/out/tools/coarse-placer/build/outlier/exposure.d.ts.map +1 -1
  368. package/out/tools/coarse-placer/build/outlier/exposure.js.map +1 -1
  369. package/out/tools/coarse-placer/build/outlier/latin.d.ts +3 -3
  370. package/out/tools/coarse-placer/build/outlier/oa.d.ts +3 -3
  371. package/out/tools/coarse-placer/eval/latin-offmap.d.ts +3 -3
  372. package/out/tools/coarse-placer/eval/openset.js +2 -2
  373. package/out/tools/coarse-placer/eval/openset.js.map +1 -1
  374. package/out/tools/coarse-placer/eval/quant-compare.d.ts +4 -4
  375. package/out/tools/coarse-placer/eval.d.ts +3 -3
  376. package/out/tools/coarse-placer/paths.js +1 -1
  377. package/out/tools/coarse-placer/paths.js.map +1 -1
  378. package/out/tools/coarse-placer/probe-frontier.d.ts +2 -2
  379. package/out/tools/coarse-placer/quantize.d.ts +2 -2
  380. package/out/tools/coarse-placer/train.d.ts +5 -5
  381. package/out/tools/download/libpostal-resources.d.ts.map +1 -1
  382. package/out/tools/download/libpostal-resources.js +2 -1
  383. package/out/tools/download/libpostal-resources.js.map +1 -1
  384. package/out/tools/download/ssl-address.d.ts +2 -2
  385. package/out/tools/generate-language-types.d.ts +1 -1
  386. package/out/tools/generate-language-types.js +1 -1
  387. package/out/tools/generate-language-types.js.map +1 -1
  388. package/out/trust-policies.d.ts +0 -1
  389. package/out/trust-policies.d.ts.map +1 -1
  390. package/out/trust-policies.js +0 -1
  391. package/out/trust-policies.js.map +1 -1
  392. package/out/types/Classification.d.ts +1 -1
  393. package/out/types/Classification.d.ts.map +1 -1
  394. package/out/types/classifier.d.ts +1 -1
  395. package/out/types/classifier.d.ts.map +1 -1
  396. package/out/utils/geodatabase-archive.d.ts +11 -4
  397. package/out/utils/geodatabase-archive.d.ts.map +1 -1
  398. package/out/utils/geodatabase-archive.js +1 -1
  399. package/out/utils/geodatabase-archive.js.map +1 -1
  400. package/out/utils/sqlite-rows.d.ts +2 -2
  401. package/out/utils/sqlite-rows.d.ts.map +1 -1
  402. package/out/utils/sqlite-rows.js +2 -2
  403. package/out/utils/sqlite-rows.js.map +1 -1
  404. package/out/utils/stream-to-disk.d.ts.map +1 -1
  405. package/out/utils/stream-to-disk.js +1 -1
  406. package/out/utils/stream-to-disk.js.map +1 -1
  407. package/out/utils/union-find.js +1 -1
  408. package/out/utils/union-find.js.map +1 -1
  409. package/out/vale.js +1 -1
  410. package/out/vale.js.map +1 -1
  411. package/out/workspaces.d.ts +1 -1
  412. package/out/workspaces.js +1 -1
  413. package/out/workspaces.js.map +1 -1
  414. package/package.json +46 -14
  415. package/tools/coarse-placer/build/dataset.ts +4 -2
  416. package/tools/coarse-placer/build/outlier/exposure.ts +5 -3
  417. package/tools/coarse-placer/build/outlier/latin.ts +3 -3
  418. package/tools/coarse-placer/build/outlier/oa.ts +3 -3
  419. package/tools/coarse-placer/eval/latin-offmap.ts +3 -3
  420. package/tools/coarse-placer/eval/openset.ts +3 -3
  421. package/tools/coarse-placer/eval/quant-compare.ts +4 -4
  422. package/tools/coarse-placer/eval.ts +3 -3
  423. package/tools/coarse-placer/paths.ts +1 -1
  424. package/tools/coarse-placer/probe-frontier.ts +2 -2
  425. package/tools/coarse-placer/quantize.ts +2 -2
  426. package/tools/coarse-placer/train.ts +5 -5
  427. package/tools/download/libpostal-resources.ts +2 -1
  428. package/tools/download/ssl-address.ts +2 -2
  429. package/tools/generate-language-types.ts +3 -3
@@ -27,8 +27,6 @@ import {
27
27
  } from "#api/retry"
28
28
  import { ConsoleLogger, type IRuntimeLogger } from "#logging"
29
29
 
30
- export { type IRuntimeLogger } from "#logging"
31
-
32
30
  const MS_PER_MINUTE = 60_000
33
31
 
34
32
  /**
@@ -50,7 +48,8 @@ export interface APIClientConfig {
50
48
 
51
49
  /**
52
50
  * This option transfers cache storage ownership to the client.
53
- * The default is false.
51
+ *
52
+ * @defaultValue `false`
54
53
  */
55
54
  disposeCacheStorage?: boolean
56
55
 
@@ -92,7 +91,7 @@ export interface APIClientConfig {
92
91
  /**
93
92
  * Time source for the pacer, cooldown timer and retry backoff.
94
93
  *
95
- * Defaults to {@linkcode systemClock}.
94
+ * @defaultValue {@linkcode systemClock}
96
95
  * Tests inject a fake clock to make timing deterministic and instant.
97
96
  */
98
97
  clock?: ClockLike
@@ -139,7 +138,7 @@ export class APIClient<C extends APIClientConfig = APIClientConfig> extends Even
139
138
  this.config = config
140
139
  this.logger = config.logger ?? ConsoleLogger.prefix(config.displayName)
141
140
  this.#clock = config.clock ?? systemClock
142
- this.#retryPolicy = resolveRetryPolicy(config.retry)
141
+ this.#retryPolicy = resolveRetryPolicy(config.retry ?? null)
143
142
  this.#pacer = config.minRequestIntervalMs ? new RequestPacer(config.minRequestIntervalMs, this.#clock) : null
144
143
 
145
144
  // The pacing limit lives IN the adapter rather than in `fetch()`: `axios-cache-interceptor`
@@ -263,7 +262,7 @@ export class APIClient<C extends APIClientConfig = APIClientConfig> extends Even
263
262
 
264
263
  if (this.#shutdown.signal.aborted || !directive.retryable || attempt >= this.#retryPolicy.maxAttempts) {
265
264
  // Always throws — `Promise<never>` is assignable to this method's return type.
266
- return await delegateAxiosError(error)
265
+ return delegateAxiosError(error)
267
266
  }
268
267
 
269
268
  const waitMs = retryDelayMs(attempt, directive, this.#retryPolicy)
package/lib/api/arcgis.ts CHANGED
@@ -37,20 +37,20 @@ export class ArcGISServiceError extends Error {
37
37
  }
38
38
 
39
39
  /**
40
- * Returns the error envelope in an ArcGIS JSON body, or `undefined` when the body is a normal response.
40
+ * Returns the error envelope in an ArcGIS JSON body, or `null` when the body is a normal response.
41
41
  *
42
42
  * The body counts as an error only when its `error` object has a string `message`.
43
43
  */
44
- export function readArcGISError(payload: unknown): ArcGISErrorEnvelope | undefined {
45
- if (typeof payload !== "object" || payload === null) return undefined
44
+ export function readArcGISError(payload: unknown): ArcGISErrorEnvelope | null {
45
+ if (typeof payload !== "object" || !payload) return null
46
46
 
47
47
  const error = (payload as { error?: unknown }).error
48
48
 
49
- if (typeof error !== "object" || error === null) return undefined
49
+ if (typeof error !== "object" || !error) return null
50
50
 
51
51
  const { code, message, details } = error as { code?: unknown; message?: unknown; details?: unknown }
52
52
 
53
- if (typeof message !== "string") return undefined
53
+ if (typeof message !== "string") return null
54
54
 
55
55
  return {
56
56
  ...(typeof code === "number" ? { code } : {}),
package/lib/api/ckan.ts CHANGED
@@ -66,7 +66,8 @@ export interface ReadCKANPackageRecordOptions {
66
66
  context: string
67
67
  /**
68
68
  * The catalogue API base URL.
69
- * The default is {@link CKAN_CATALOGUE_API_BASE_URL}.
69
+ *
70
+ * @defaultValue {@linkcode CKAN_CATALOGUE_API_BASE_URL}
70
71
  */
71
72
  baseURL?: string
72
73
  }
@@ -55,7 +55,7 @@ export interface DiskStorageOptions {
55
55
  /**
56
56
  * Where rejected writes and unreadable entries are reported.
57
57
  *
58
- * Defaults to a `disk-storage`-prefixed console logger.
58
+ * @defaultValue a `disk-storage`-prefixed console logger.
59
59
  */
60
60
  logger?: IRuntimeLogger
61
61
  }
@@ -170,7 +170,7 @@ export function buildDiskStorage(options: DiskStorageOptions): AxiosStorage {
170
170
 
171
171
  const parsed = tryParsingJSON<StorageValue>(raw)
172
172
 
173
- if (parsed === null) {
173
+ if (!parsed) {
174
174
  // A truncated or hand-edited entry is a miss rather than a crash — re-fetching is always safe.
175
175
  logger.warn(`Discarding an unreadable cache entry for ${key}.`)
176
176
 
@@ -191,7 +191,7 @@ export function buildDiskStorage(options: DiskStorageOptions): AxiosStorage {
191
191
 
192
192
  const serialized = serializeIfValid(key, value)
193
193
 
194
- if (serialized === null) {
194
+ if (!serialized) {
195
195
  // Drop any older entry too: the interceptor is telling us this key's content just changed.
196
196
  // A superseded body would turn this changed response into a stale cache hit.
197
197
  await removeEntry(key)
package/lib/api/ogc.ts CHANGED
@@ -49,7 +49,7 @@ export class OGCServiceError extends Error {
49
49
  const EXCEPTION_OPEN = "<ServiceException"
50
50
 
51
51
  /**
52
- * The element a WFS 2.0 service carries its message in, with an optional namespace prefix.
52
+ * The element a WFS 2.0 service states its message in, with an optional namespace prefix.
53
53
  *
54
54
  * OGC 1.x answers `<ServiceExceptionReport>` holding `<ServiceException>`.
55
55
  * WFS 2.0 answers `<ows:ExceptionReport>` holding `<ows:Exception exceptionCode="…">`
@@ -81,13 +81,13 @@ const OWS_EXCEPTION_CODE = /exceptionCode\s*=\s*"([^"]*)"/u
81
81
  * The entire report would become the message if the parser matched that tag.
82
82
  * An unclosed element reads as unreadable rather than as empty.
83
83
  */
84
- function exceptionText(body: string): string | undefined {
84
+ function exceptionText(body: string): string | null {
85
85
  let cursor = 0
86
86
 
87
87
  for (;;) {
88
88
  const start = body.indexOf(EXCEPTION_OPEN, cursor)
89
89
 
90
- if (start === -1) return undefined
90
+ if (start === -1) return null
91
91
 
92
92
  const after = start + EXCEPTION_OPEN.length
93
93
 
@@ -100,11 +100,11 @@ function exceptionText(body: string): string | undefined {
100
100
 
101
101
  const contentStart = body.indexOf(">", after)
102
102
 
103
- if (contentStart === -1) return undefined
103
+ if (contentStart === -1) return null
104
104
 
105
105
  const end = body.indexOf("</ServiceException>", contentStart)
106
106
 
107
- if (end === -1) return undefined
107
+ if (end === -1) return null
108
108
 
109
109
  return body.slice(contentStart + 1, end)
110
110
  }
@@ -113,26 +113,26 @@ function exceptionText(body: string): string | undefined {
113
113
  /**
114
114
  * The text of an `ExceptionText` element, with or without a namespace prefix.
115
115
  *
116
- * The prefix is captured so the closing tag matches the one the document opened,
117
- * which keeps a prefixed element from closing on an unprefixed one.
116
+ * The prefix is captured so the closing tag matches the one the document opened.
117
+ * A prefixed element therefore never closes on an unprefixed one.
118
118
  */
119
- function owsExceptionText(body: string): string | undefined {
119
+ function owsExceptionText(body: string): string | null {
120
120
  const open = OWS_EXCEPTION_TEXT_OPEN.exec(body)
121
121
 
122
- if (!open) return undefined
122
+ if (!open) return null
123
123
 
124
124
  const prefix = open[1]
125
125
  const contentStart = open.index + open[0].length
126
126
  const end = body.indexOf(prefix ? `</${prefix}:ExceptionText>` : "</ExceptionText>", contentStart)
127
127
 
128
128
  // An unclosed element reads as unreadable rather than as empty, as the 1.x path does.
129
- if (end === -1) return undefined
129
+ if (end === -1) return null
130
130
 
131
131
  return body.slice(contentStart, end)
132
132
  }
133
133
 
134
134
  /**
135
- * The exception message inside an OGC or OWS exception report, or `undefined` for a body that is neither.
135
+ * The exception message inside an OGC or OWS exception report, or `null` for a body that is neither.
136
136
  *
137
137
  * Both dialects are read, because a report shares the HTTP status a real answer arrives on
138
138
  * and a caller that recognizes one spelling parses the other as data.
@@ -144,8 +144,8 @@ function owsExceptionText(body: string): string | undefined {
144
144
  *
145
145
  * Split from the request so the detection is testable against captured bodies.
146
146
  */
147
- export function readOGCServiceException(body: string): string | undefined {
148
- if (!body.includes("ExceptionReport")) return undefined
147
+ export function readOGCServiceException(body: string): string | null {
148
+ if (!body.includes("ExceptionReport")) return null
149
149
 
150
150
  if (body.includes("ServiceExceptionReport")) {
151
151
  // A body remains an exception report when its exception element cannot be read.
@@ -169,7 +169,7 @@ export function readOGCServiceException(body: string): string | undefined {
169
169
  export function assertNoOGCServiceException(body: string, context: string): void {
170
170
  const exception = readOGCServiceException(body)
171
171
 
172
- if (exception !== undefined) {
172
+ if (exception) {
173
173
  throw new OGCServiceError(context, exception)
174
174
  }
175
175
  }
@@ -198,6 +198,14 @@ export interface CreateOGCFeaturesBBoxReaderOptions {
198
198
  limit: number
199
199
  }
200
200
 
201
+ /**
202
+ * One feature as an OGC API Features service publishes it, reduced to the fields a comparison reads.
203
+ */
204
+ export interface OGCFeature<Properties = Record<string, unknown>> {
205
+ properties?: Properties
206
+ geometry?: { type: string; coordinates: unknown }
207
+ }
208
+
201
209
  /**
202
210
  * A reader answering an OGC API Features bbox query around a point.
203
211
  *
@@ -250,7 +258,7 @@ export async function readOGCCollectionBBox(
250
258
 
251
259
  if (!bbox || bbox.length < BBOX_ORDINATES) {
252
260
  throw new TypeError(
253
- `${options.context}: the OGC collection${options.subject === undefined ? "" : ` ${options.subject}`} carried no spatial extent`
261
+ `${options.context}: the OGC collection${options.subject ? ` ${options.subject}` : ""} carried no spatial extent`
254
262
  )
255
263
  }
256
264
 
@@ -281,7 +289,7 @@ export interface ReadWFSFeatureCountOptions {
281
289
  async function readReportedNumberMatched(
282
290
  client: Pick<APIClient, "fetch">,
283
291
  options: ReadWFSFeatureCountOptions & { startIndex?: number }
284
- ): Promise<string | undefined> {
292
+ ): Promise<string | null> {
285
293
  const { data } = await client.fetch<string>({
286
294
  method: "GET",
287
295
  url: options.wfsURL,
@@ -304,11 +312,12 @@ async function readReportedNumberMatched(
304
312
  /**
305
313
  * The feature count a WFS reports for one type.
306
314
  *
307
- * `resultType=hits`, which returns the count without a single geometry.
315
+ * `resultType=hits` returns the count without a single geometry.
308
316
  *
309
317
  * This takes the service's word for the count.
310
318
  * A caller that cannot check the number against the publisher's own figure reads
311
- * {@linkcode readCheckedWFSFeatureCount} instead, which asks a second time.
319
+ * {@linkcode readCheckedWFSFeatureCount} instead.
320
+ * That reader asks a second time.
312
321
  *
313
322
  * @param options.subject Names the layer in the refusal, where the caller reads more than one.
314
323
  */
@@ -317,9 +326,9 @@ export async function readWFSFeatureCount(
317
326
  options: ReadWFSFeatureCountOptions
318
327
  ): Promise<number> {
319
328
  const numberMatched = await readReportedNumberMatched(client, options)
320
- const subject = options.subject === undefined ? "" : ` for ${options.subject}`
329
+ const subject = options.subject ? ` for ${options.subject}` : ""
321
330
 
322
- if (numberMatched === undefined) {
331
+ if (!numberMatched) {
323
332
  throw new Error(`${options.context}: the WFS hits response${subject} carried no numberMatched attribute`)
324
333
  }
325
334
 
@@ -339,7 +348,7 @@ export async function readWFSFeatureCount(
339
348
  /**
340
349
  * How much a service's own feature count is worth.
341
350
  *
342
- * `reported` is the number the service stated, and `usable` says whether a second read agreed with it.
351
+ * `reported` is the number the service stated, and `usable` records whether a second read agreed with it.
343
352
  * A caller records the count only where `usable` is true and records `because` otherwise,
344
353
  * so that a service which cannot count is told apart from one that counted a small number.
345
354
  */
@@ -360,34 +369,27 @@ const COUNT_PROBE_SIZE = 10
360
369
  /**
361
370
  * The feature count a WFS reports for one type, checked against a page of that type.
362
371
  *
363
- * Two INSPIRE Addresses services measured on 2026-09-30 answer a bare `resultType=hits`
364
- * request wrongly, in opposite directions, and the number alone tells a reader neither.
365
- *
366
- * Flanders (`geo.api.vlaanderen.be/ad/wfs`) answers `numberMatched="10000"` without a `startIndex`
367
- * and `4563062` with one, so the first request meets a per-request cap rather than counting the type.
368
- * This asks past index 0 for that reason.
372
+ * A bare `resultType=hits` request over a capped service answers with the cap,
373
+ * so the number cannot tell a reader whether it describes the type.
374
+ * This asks past index 0 and then probes a page.
369
375
  *
370
- * Poland (`mapy.geoportal.gov.pl/wss/service/INSPIRE/Addresses`) states three different
371
- * numbers for one type and none of them is its count, measured 2026-10-01.
372
- * A bare request answers `numberMatched="1000"`, which is MapServer's default feature cap.
376
+ * Flanders (`geo.api.vlaanderen.be/ad/wfs`) answers `numberMatched="10000"` without a
377
+ * `startIndex` and its real count with one, so this asks past index 0.
373
378
  *
374
- * The same request at `startIndex=1` answers `1`.
375
- * A feature page answers `numberMatched="unknown"`.
376
- * Its type holds 8,625,921 features.
379
+ * Poland (`mapy.geoportal.gov.pl/wss/service/INSPIRE/Addresses`) reports MapServer's feature
380
+ * cap for a bare request, `unknown` for a feature page, and another number at `startIndex=1`.
381
+ * Its type held 8,625,921 features.
377
382
  *
378
383
  * The tell is that a page of the same type returns more features than the count admits,
379
384
  * so this asks for one page and refuses a count that page contradicts.
380
- * A service answering this way is counted by paging instead: the count is the largest
381
- * `startIndex` that still returns a feature, which a doubling search followed by a bisection
382
- * finds in about 2·log2(n) requests, and a page straddling that index confirms the boundary.
385
+ * Such a service is counted by paging instead: {@linkcode countWFSFeaturesByPaging}.
383
386
  *
384
387
  * A missing `numberMatched` can also be transient.
385
- * Slovakia's `rageo.minv.sk/geoserver/ad/wfs` answered one request out of nine with
386
- * no such attribute and the other eight with `1704196`.
388
+ * Slovakia's `rageo.minv.sk/geoserver/ad/wfs` answered one request out of nine with no such attribute.
387
389
  *
388
390
  * This reports that response as unusable rather than inventing a count,
389
391
  * so a caller that needs the number retries, through `APIClient`'s `retry` configuration
390
- * or by reading the `numberMatched` a feature page carries.
392
+ * or by reading the `numberMatched` a feature page holds.
391
393
  *
392
394
  * @param options.subject Names the layer in the reason, where the caller reads more than one.
393
395
  */
@@ -398,7 +400,7 @@ export async function readCheckedWFSFeatureCount(
398
400
  const probeSize = options.probeSize ?? COUNT_PROBE_SIZE
399
401
  const numberMatched = await readReportedNumberMatched(client, { ...options, startIndex: 1 })
400
402
 
401
- if (numberMatched === undefined) {
403
+ if (!numberMatched) {
402
404
  return { reported: null, usable: false, because: "the hits response carried no numberMatched attribute" }
403
405
  }
404
406
 
@@ -430,7 +432,7 @@ export async function readCheckedWFSFeatureCount(
430
432
  assertNoOGCServiceException(probe, options.context)
431
433
 
432
434
  const returned = rootAttribute(probe, "numberReturned", { xml: true })
433
- const observed = returned !== undefined && /^\d+$/u.test(returned) ? Number(returned) : null
435
+ const observed = returned && /^\d+$/u.test(returned) ? Number(returned) : null
434
436
 
435
437
  if (observed !== null && observed > reported) {
436
438
  return {
@@ -441,12 +443,13 @@ export async function readCheckedWFSFeatureCount(
441
443
  }
442
444
 
443
445
  // A page no larger than the reported count agrees with it whatever the truth is,
444
- // so agreement alone does not establish that the count describes the type.
445
- // Asking for one feature at the reported index does: a service holding exactly that many has none there.
446
+ // so agreement does not establish that the count describes the type.
447
+ // One request does: asking for one feature at the reported index.
448
+ // A service holding exactly that many returns none there.
446
449
  //
447
450
  // Poland's address service is why this request exists.
448
- // It answers `numberMatched="1000"`, which is MapServer's own feature cap, and its pages cap
449
- // at 1,000 too, so a 10-feature probe agreed with 1,000 while the type held 8,626,951 on 2026-10-02.
451
+ // It answers `numberMatched="1000"`, MapServer's own feature cap, and its pages cap at 1,000 too.
452
+ // A 10-feature probe therefore agreed with 1,000 while the type held 8,626,951.
450
453
  // A caller trusting that would have stored 1,000 features and recorded the type as read whole.
451
454
  const { data: beyond } = await client.fetch<string>({
452
455
  method: "GET",
@@ -466,7 +469,7 @@ export async function readCheckedWFSFeatureCount(
466
469
 
467
470
  const beyondReturned = rootAttribute(beyond, "numberReturned", { xml: true })
468
471
 
469
- if (beyondReturned !== undefined && /^[1-9]\d*$/u.test(beyondReturned)) {
472
+ if (beyondReturned && /^[1-9]\d*$/u.test(beyondReturned)) {
470
473
  return {
471
474
  reported,
472
475
  usable: false,
@@ -487,7 +490,8 @@ export async function readCheckedWFSFeatureCount(
487
490
  export interface PagedWFSFeatureCount {
488
491
  count: number
489
492
  /**
490
- * Requests this measurement sent, which is the cost a caller is choosing to pay.
493
+ * Requests this measurement sent.
494
+ * This is the cost a caller is choosing to pay.
491
495
  */
492
496
  requests: number
493
497
  /**
@@ -508,8 +512,8 @@ const PAGING_COUNT_CEILING = 2 ** 34
508
512
  /**
509
513
  * The feature count a type holds, measured by asking which indices hold a feature.
510
514
  *
511
- * For a service whose own `resultType=hits` cannot be trusted, which
512
- * {@linkcode readCheckedWFSFeatureCount} reports as `usable: false`.
515
+ * This serves a service whose own `resultType=hits` cannot be trusted.
516
+ * {@linkcode readCheckedWFSFeatureCount} reports that condition as `usable: false`.
513
517
  * What such a service still answers truthfully is whether a feature exists at a given
514
518
  * `startIndex`, so the count is the largest index that returns one, plus one.
515
519
  *
@@ -517,7 +521,7 @@ const PAGING_COUNT_CEILING = 2 ** 34
517
521
  * It costs about 2·log2(n) requests: 51 for Poland's 8,625,921 features.
518
522
  *
519
523
  * A page straddling the last index then confirms the boundary.
520
- * `confirmed` carries that answer to the caller, because a service that caps a
524
+ * `confirmed` reports that answer to the caller, because a service that caps a
521
525
  * page would make the bisection stop early.
522
526
  *
523
527
  * The measurement means something only where paging works.
@@ -560,7 +564,7 @@ export async function countWFSFeaturesByPaging(
560
564
 
561
565
  const returned = rootAttribute(data, "numberReturned", { xml: true })
562
566
 
563
- return { returned: returned !== undefined && /^\d+$/u.test(returned) ? Number(returned) : null, body: data }
567
+ return { returned: returned && /^\d+$/u.test(returned) ? Number(returned) : null, body: data }
564
568
  }
565
569
 
566
570
  const leading = options.identify ?? ((body: string) => /gml:id="([^"]+)"/u.exec(body)?.[1] ?? null)
@@ -572,7 +576,7 @@ export async function countWFSFeaturesByPaging(
572
576
 
573
577
  const second = await read(2, 2)
574
578
 
575
- if (leading(first.body) !== null && leading(first.body) === leading(second.body)) {
579
+ if (leading(first.body) && leading(first.body) === leading(second.body)) {
576
580
  throw new Error(
577
581
  `${options.context}: the service answered startIndex 0 and startIndex 2 with the same leading feature, so it is ignoring startIndex and a count measured by paging it would be this service's page cap rather than its feature count`
578
582
  )
package/lib/api/pacer.ts CHANGED
@@ -48,7 +48,7 @@ export class RequestPacer {
48
48
  * A zero-interval pacer would never actually pace.
49
49
  * Silently accepting one would make a misconfigured caller look throttled when it isn't.
50
50
  * @param clock Time source.
51
- * Defaults to {@linkcode systemClock}.
51
+ * @defaultValue {@linkcode systemClock}
52
52
  */
53
53
  constructor(intervalMs: number, clock: ClockLike = systemClock) {
54
54
  if (!Number.isFinite(intervalMs) || intervalMs <= 0) {
package/lib/api/retry.ts CHANGED
@@ -180,7 +180,8 @@ export interface RetryOptions {
180
180
  * Total attempts, including the first, before giving up.
181
181
  *
182
182
  * A stated ceiling rather than "until it works".
183
- * Default {@linkcode DEFAULT_MAX_ATTEMPTS}.
183
+ *
184
+ * @defaultValue {@linkcode DEFAULT_MAX_ATTEMPTS}
184
185
  */
185
186
  maxAttempts?: number
186
187
  /**
@@ -188,7 +189,8 @@ export interface RetryOptions {
188
189
  *
189
190
  * Attempt `n`'s wait is `baseDelayMs * 2^(n-1)`, unless the response includes a `Retry-After` header.
190
191
  * The client honors that delay instead.
191
- * Default {@linkcode DEFAULT_BASE_RETRY_DELAY_MS}.
192
+ *
193
+ * @defaultValue {@linkcode DEFAULT_BASE_RETRY_DELAY_MS}
192
194
  */
193
195
  baseDelayMs?: number
194
196
  }
@@ -204,9 +206,9 @@ export interface ResolvedRetryPolicy {
204
206
  /**
205
207
  * Fill in {@linkcode RetryOptions}' defaults.
206
208
  *
207
- * `undefined` (the absent option) resolves to a single attempt — no retry.
209
+ * `null` (the absent option) resolves to a single attempt — no retry.
208
210
  */
209
- export function resolveRetryPolicy(options: RetryOptions | boolean | undefined): ResolvedRetryPolicy {
211
+ export function resolveRetryPolicy(options: RetryOptions | boolean | null): ResolvedRetryPolicy {
210
212
  if (!options) return { maxAttempts: 1, baseDelayMs: DEFAULT_BASE_RETRY_DELAY_MS }
211
213
 
212
214
  const provided = options === true ? {} : options
@@ -15,8 +15,8 @@
15
15
  *
16
16
  * Everything here is built structurally with `isAxiosError: true` and `config`/`code`/`response`.
17
17
  * The adapter uses `APIClientConfig["axios"]` because the packages under test reach Axios integrations through
18
- * `@mailwoman/core`. Where an axios type has to be named, such as the response
19
- * {@linkcode stubFetchingBodies} resolves, it is named here rather than by the calling test,
18
+ * `@mailwoman/core`. The axios type {@linkcode stubFetchingBodies} resolves is stated here
19
+ * rather than by the calling test,
20
20
  * so a workspace that stubs a request needs no `axios` dependency of its own.
21
21
  */
22
22
 
@@ -51,9 +51,9 @@ export interface StubRequestConfig {
51
51
  }
52
52
 
53
53
  /**
54
- * One scripted adapter outcome.
54
+ * One scripted adapter result.
55
55
  */
56
- export interface StubOutcome {
56
+ export interface StubResult {
57
57
  status?: number
58
58
  statusText?: string
59
59
  /**
@@ -110,9 +110,9 @@ export interface StubTransportOptions {
110
110
  */
111
111
  clock?: { now(): number }
112
112
  /**
113
- * The body served when an outcome names none.
113
+ * The body served when a result names none.
114
114
  *
115
- * Defaults to `{ ok: true }`; pass the envelope the client under test expects
115
+ * @defaultValue `{ ok: true }`; pass the envelope the client under test expects
116
116
  * when it validates one (BDC's `{ data: [] }`, say).
117
117
  */
118
118
  defaultBody?: unknown
@@ -122,11 +122,11 @@ export interface StubTransportOptions {
122
122
  * A client answering each `fetch` with the next of `bodies`, holding on the last once exhausted.
123
123
  *
124
124
  * A reader that takes `Pick<APIClient, "fetch">` reads only `data`, so the stub states
125
- * that field alone rather than building headers and a config.
126
- * Passing several bodies scripts a reader that asks twice, such as a count checked against a page.
125
+ * that field only rather than building headers and a config.
126
+ * Several bodies script a reader that asks twice, such as a count checked against a page.
127
127
  *
128
128
  * This lives beside {@linkcode stubTransport} so that a workspace which does not
129
- * depend on `axios` can still stub the method: the axios type is named here,
129
+ * depend on `axios` can still stub the method: the axios type is stated here,
130
130
  * in core, rather than by the test that calls this.
131
131
  */
132
132
  export function stubFetchingBodies(...bodies: string[]): Pick<APIClient, "fetch"> {
@@ -165,7 +165,7 @@ export function axiosLikeError(message: string, code: string, config: StubReques
165
165
  }
166
166
 
167
167
  /**
168
- * A stub Axios adapter that replays `outcomes` (holding on the last entry once exhausted)
168
+ * A stub Axios adapter that replays `results` (holding on the last entry once exhausted)
169
169
  * and records every dispatch.
170
170
  *
171
171
  * It reproduces what Axios's real adapters do on a failing status — reject with an
@@ -173,7 +173,7 @@ export function axiosLikeError(message: string, code: string, config: StubReques
173
173
  * by the adapter rather than by the interceptor chain.
174
174
  * A test that resolves with a 4xx instead would exercise a path the real transport never takes.
175
175
  */
176
- export function stubTransport(outcomes: StubOutcome[], options: StubTransportOptions = {}): StubTransport {
176
+ export function stubTransport(results: StubResult[], options: StubTransportOptions = {}): StubTransport {
177
177
  const { clock, defaultBody = { ok: true } } = options
178
178
  const calls: string[] = []
179
179
  const configs: StubRequestConfig[] = []
@@ -188,15 +188,15 @@ export function stubTransport(outcomes: StubOutcome[], options: StubTransportOpt
188
188
  dispatchTimes.push(clock.now())
189
189
  }
190
190
 
191
- const outcome = outcomes[Math.min(index, outcomes.length - 1)]!
191
+ const stub = results[Math.min(index, results.length - 1)]!
192
192
 
193
193
  index++
194
194
 
195
- if (outcome.throws) {
196
- throw axiosLikeError(outcome.throws.message, outcome.throws.code, config)
195
+ if (stub.throws) {
196
+ throw axiosLikeError(stub.throws.message, stub.throws.code, config)
197
197
  }
198
198
 
199
- const status = outcome.status ?? HTTP_OK
199
+ const status = stub.status ?? HTTP_OK
200
200
 
201
201
  const response = {
202
202
  // Axios's `transformResponse` runs on the raw body, so the stub passes
@@ -205,12 +205,12 @@ export function stubTransport(outcomes: StubOutcome[], options: StubTransportOpt
205
205
  // Bytes also pass through unchanged.
206
206
  // The stub serializes other values as a JSON endpoint would.
207
207
  data:
208
- typeof outcome.body === "string" || Buffer.isBuffer(outcome.body)
209
- ? outcome.body
210
- : stringifyJSON(outcome.body ?? defaultBody),
208
+ typeof stub.body === "string" || Buffer.isBuffer(stub.body)
209
+ ? stub.body
210
+ : stringifyJSON(stub.body ?? defaultBody),
211
211
  status,
212
- statusText: outcome.statusText ?? "OK",
213
- headers: outcome.headers ?? {},
212
+ statusText: stub.statusText ?? "OK",
213
+ headers: stub.headers ?? {},
214
214
  config,
215
215
  }
216
216
 
package/lib/api.ts CHANGED
@@ -7,6 +7,7 @@
7
7
  */
8
8
 
9
9
  export * from "#api/APIClient"
10
+ export { type IRuntimeLogger } from "#logging/shared"
10
11
  export * from "#api/arcgis"
11
12
  export * from "#api/ckan"
12
13
  export * from "#api/clock"
@@ -129,13 +129,14 @@ export function isOffMapHandled(prediction: CoarsePrediction): boolean {
129
129
  export interface CoarsePlacerOpts {
130
130
  /**
131
131
  * The minimum confidence for a prediction.
132
- * The default is `0.5`.
132
+ *
133
+ * @defaultValue `0.5`
133
134
  */
134
135
  abstainBelow?: number
135
136
  /**
136
137
  * Abstains on the total probability of in-map classes and otherwise returns the top in-map class.
137
138
  *
138
- * The default is `false`, which abstains on the top-class probability.
139
+ * @defaultValue `false`, which abstains on the top-class probability.
139
140
  */
140
141
  openSet?: boolean
141
142
  }
@@ -303,7 +304,7 @@ export function inMapPosterior(
303
304
  epsilonFloor?: number
304
305
  }
305
306
  ): Record<string, number> | null {
306
- if (prediction.country === null || prediction.country === "OTHER") return null
307
+ if (!prediction.country || prediction.country === "OTHER") return null
307
308
  const floor = opts?.epsilonFloor ?? 0
308
309
  const posterior: Record<string, number> = {}
309
310
 
@@ -55,8 +55,7 @@ export function normalizeSHASeeds(input: SHA3Input): string[] {
55
55
  * Each normalized seed is fed into the hash sequentially.
56
56
  *
57
57
  * @param seeds - Values to hash.
58
- * @param outputLength - Length of the digest in **bytes**.
59
- * Defaults to `32` (256-bit output).
58
+ * @param outputLength - [32] Length of the digest in **bytes** (256-bit output).
60
59
  *
61
60
  * @returns Uppercase hexadecimal digest.
62
61
  */
@@ -128,11 +128,11 @@ function flush(open: OpenSpan | null, raw: string, out: AddressNode[], attributi
128
128
  const confidence = attribution.calibrate ? attribution.calibrate(rawConfidence) : rawConfidence
129
129
  const node: AddressNode = { tag: open.tag, start, end, value, confidence, children: [] }
130
130
 
131
- if (attribution.source !== undefined) {
131
+ if (attribution.source) {
132
132
  node.source = attribution.source
133
133
  }
134
134
 
135
- if (attribution.sourceID !== undefined) {
135
+ if (attribution.sourceID) {
136
136
  node.sourceID = attribution.sourceID
137
137
  }
138
138
 
@@ -156,13 +156,13 @@ function emitSpans(raw: string, tokens: DecoderToken[], attribution: BuildTreeOp
156
156
  // The span stays open so the following same-tag `B-` token can merge in
157
157
  // (see the spurious-boundary repair below).
158
158
  // A non-whitespace `O` (comma, slash, …) is a genuine separator and still flushes.
159
- if (open !== null && /^\s*$/.test(raw.slice(tok.start, tok.end))) continue
159
+ if (open && /^\s*$/.test(raw.slice(tok.start, tok.end))) continue
160
160
  open = flush(open, raw, out, attribution)
161
161
 
162
162
  continue
163
163
  }
164
164
 
165
- if (prefix === "B" || open === null || open.tag !== tag) {
165
+ if (prefix === "B" || !open || open.tag !== tag) {
166
166
  // Spurious-boundary repair: a `B-X` token that is whitespace-adjacent to an
167
167
  // already-open `X` span is the model fragmenting a multi-word value, e.g. "Saint
168
168
  // Paul" emitted as B-locality B-locality, where the second tag continues the first.
@@ -172,7 +172,7 @@ function emitSpans(raw: string, tokens: DecoderToken[], attribution: BuildTreeOp
172
172
  // A comma or any other separator keeps them distinct.
173
173
  // An intervening O or different-tag token already nulls or replaces `open` above.
174
174
  // Two separate same-tag spans (e.g. "Springfield, Chicago") are never merged.
175
- if (prefix === "B" && open !== null && open.tag === tag && /^\s*$/.test(raw.slice(open.end, tok.start))) {
175
+ if (prefix === "B" && open && open.tag === tag && /^\s*$/.test(raw.slice(open.end, tok.start))) {
176
176
  open.end = tok.end
177
177
  open.confidences.push(tok.confidence)
178
178