feedsmith 3.0.1 → 3.1.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 (418) hide show
  1. package/README.md +7 -6
  2. package/dist/common/config.cjs +61 -67
  3. package/dist/common/config.mjs +59 -64
  4. package/dist/common/detect.cjs +14 -0
  5. package/dist/common/detect.d.cts +2 -0
  6. package/dist/common/detect.d.mts +2 -0
  7. package/dist/common/detect.mjs +14 -0
  8. package/dist/common/errors.cjs +1 -2
  9. package/dist/common/errors.d.cts +1 -3
  10. package/dist/common/errors.d.mts +1 -3
  11. package/dist/common/errors.mjs +1 -2
  12. package/dist/common/parse.cjs +22 -25
  13. package/dist/common/parse.d.cts +2 -4
  14. package/dist/common/parse.d.mts +2 -4
  15. package/dist/common/parse.mjs +20 -23
  16. package/dist/common/types.d.cts +1 -2
  17. package/dist/common/types.d.mts +1 -2
  18. package/dist/common/utils.cjs +43 -35
  19. package/dist/common/utils.mjs +44 -36
  20. package/dist/feeds/atom/common/types.d.cts +23 -19
  21. package/dist/feeds/atom/common/types.d.mts +23 -19
  22. package/dist/feeds/atom/detect/index.cjs +1 -2
  23. package/dist/feeds/atom/detect/index.d.cts +1 -3
  24. package/dist/feeds/atom/detect/index.d.mts +1 -3
  25. package/dist/feeds/atom/detect/index.mjs +1 -2
  26. package/dist/feeds/atom/generate/config.cjs +5 -6
  27. package/dist/feeds/atom/generate/config.mjs +2 -3
  28. package/dist/feeds/atom/generate/index.cjs +5 -6
  29. package/dist/feeds/atom/generate/index.d.cts +1 -3
  30. package/dist/feeds/atom/generate/index.d.mts +1 -3
  31. package/dist/feeds/atom/generate/index.mjs +3 -4
  32. package/dist/feeds/atom/generate/utils.cjs +57 -51
  33. package/dist/feeds/atom/generate/utils.mjs +53 -47
  34. package/dist/feeds/atom/parse/config.cjs +6 -6
  35. package/dist/feeds/atom/parse/config.mjs +2 -3
  36. package/dist/feeds/atom/parse/index.cjs +7 -7
  37. package/dist/feeds/atom/parse/index.d.cts +1 -3
  38. package/dist/feeds/atom/parse/index.d.mts +1 -3
  39. package/dist/feeds/atom/parse/index.mjs +7 -7
  40. package/dist/feeds/atom/parse/utils.cjs +74 -61
  41. package/dist/feeds/atom/parse/utils.mjs +71 -58
  42. package/dist/feeds/json/common/types.d.cts +1 -3
  43. package/dist/feeds/json/common/types.d.mts +1 -3
  44. package/dist/feeds/json/detect/index.cjs +1 -2
  45. package/dist/feeds/json/detect/index.d.cts +1 -3
  46. package/dist/feeds/json/detect/index.d.mts +1 -3
  47. package/dist/feeds/json/detect/index.mjs +1 -2
  48. package/dist/feeds/json/generate/index.cjs +3 -4
  49. package/dist/feeds/json/generate/index.d.cts +1 -3
  50. package/dist/feeds/json/generate/index.d.mts +1 -3
  51. package/dist/feeds/json/generate/index.mjs +3 -4
  52. package/dist/feeds/json/generate/utils.cjs +1 -2
  53. package/dist/feeds/json/generate/utils.mjs +1 -2
  54. package/dist/feeds/json/parse/index.cjs +5 -6
  55. package/dist/feeds/json/parse/index.d.cts +1 -3
  56. package/dist/feeds/json/parse/index.d.mts +1 -3
  57. package/dist/feeds/json/parse/index.mjs +5 -6
  58. package/dist/feeds/json/parse/utils.cjs +2 -3
  59. package/dist/feeds/json/parse/utils.mjs +2 -3
  60. package/dist/feeds/rdf/common/types.d.cts +32 -16
  61. package/dist/feeds/rdf/common/types.d.mts +32 -16
  62. package/dist/feeds/rdf/detect/index.cjs +1 -2
  63. package/dist/feeds/rdf/detect/index.d.cts +1 -3
  64. package/dist/feeds/rdf/detect/index.d.mts +1 -3
  65. package/dist/feeds/rdf/detect/index.mjs +1 -2
  66. package/dist/feeds/rdf/parse/config.cjs +1 -2
  67. package/dist/feeds/rdf/parse/config.mjs +1 -2
  68. package/dist/feeds/rdf/parse/index.cjs +6 -6
  69. package/dist/feeds/rdf/parse/index.d.cts +1 -3
  70. package/dist/feeds/rdf/parse/index.d.mts +1 -3
  71. package/dist/feeds/rdf/parse/index.mjs +6 -6
  72. package/dist/feeds/rdf/parse/utils.cjs +77 -49
  73. package/dist/feeds/rdf/parse/utils.mjs +66 -38
  74. package/dist/feeds/rss/common/types.d.cts +46 -39
  75. package/dist/feeds/rss/common/types.d.mts +46 -39
  76. package/dist/feeds/rss/detect/index.cjs +1 -2
  77. package/dist/feeds/rss/detect/index.d.cts +1 -3
  78. package/dist/feeds/rss/detect/index.d.mts +1 -3
  79. package/dist/feeds/rss/detect/index.mjs +1 -2
  80. package/dist/feeds/rss/generate/config.cjs +5 -6
  81. package/dist/feeds/rss/generate/config.mjs +2 -3
  82. package/dist/feeds/rss/generate/index.cjs +5 -6
  83. package/dist/feeds/rss/generate/index.d.cts +1 -3
  84. package/dist/feeds/rss/generate/index.d.mts +1 -3
  85. package/dist/feeds/rss/generate/index.mjs +3 -4
  86. package/dist/feeds/rss/generate/utils.cjs +88 -80
  87. package/dist/feeds/rss/generate/utils.mjs +74 -66
  88. package/dist/feeds/rss/parse/config.cjs +1 -2
  89. package/dist/feeds/rss/parse/config.mjs +1 -2
  90. package/dist/feeds/rss/parse/index.cjs +8 -7
  91. package/dist/feeds/rss/parse/index.d.cts +1 -3
  92. package/dist/feeds/rss/parse/index.d.mts +1 -3
  93. package/dist/feeds/rss/parse/index.mjs +8 -7
  94. package/dist/feeds/rss/parse/utils.cjs +138 -106
  95. package/dist/feeds/rss/parse/utils.mjs +124 -92
  96. package/dist/index.cjs +23 -21
  97. package/dist/index.d.cts +34 -34
  98. package/dist/index.d.mts +34 -34
  99. package/dist/index.mjs +9 -8
  100. package/dist/locales.json.cjs +16 -0
  101. package/dist/locales.json.mjs +11 -0
  102. package/dist/namespaces/acast/common/config.cjs +1 -2
  103. package/dist/namespaces/acast/common/config.mjs +1 -2
  104. package/dist/namespaces/acast/common/types.d.cts +1 -3
  105. package/dist/namespaces/acast/common/types.d.mts +1 -3
  106. package/dist/namespaces/acast/generate/utils.cjs +1 -2
  107. package/dist/namespaces/acast/generate/utils.mjs +1 -2
  108. package/dist/namespaces/acast/parse/utils.cjs +1 -2
  109. package/dist/namespaces/acast/parse/utils.mjs +1 -2
  110. package/dist/namespaces/admin/common/config.cjs +6 -3
  111. package/dist/namespaces/admin/common/config.mjs +6 -3
  112. package/dist/namespaces/admin/common/types.d.cts +1 -3
  113. package/dist/namespaces/admin/common/types.d.mts +1 -3
  114. package/dist/namespaces/admin/generate/utils.cjs +1 -2
  115. package/dist/namespaces/admin/generate/utils.mjs +1 -2
  116. package/dist/namespaces/admin/parse/utils.cjs +1 -2
  117. package/dist/namespaces/admin/parse/utils.mjs +1 -2
  118. package/dist/namespaces/app/common/config.cjs +6 -3
  119. package/dist/namespaces/app/common/config.mjs +6 -3
  120. package/dist/namespaces/app/common/types.d.cts +1 -3
  121. package/dist/namespaces/app/common/types.d.mts +1 -3
  122. package/dist/namespaces/app/generate/utils.cjs +1 -2
  123. package/dist/namespaces/app/generate/utils.mjs +1 -2
  124. package/dist/namespaces/app/parse/utils.cjs +1 -2
  125. package/dist/namespaces/app/parse/utils.mjs +1 -2
  126. package/dist/namespaces/arxiv/common/config.cjs +9 -4
  127. package/dist/namespaces/arxiv/common/config.mjs +9 -4
  128. package/dist/namespaces/arxiv/common/types.d.cts +3 -3
  129. package/dist/namespaces/arxiv/common/types.d.mts +3 -3
  130. package/dist/namespaces/arxiv/generate/utils.cjs +4 -3
  131. package/dist/namespaces/arxiv/generate/utils.mjs +4 -3
  132. package/dist/namespaces/arxiv/parse/utils.cjs +4 -3
  133. package/dist/namespaces/arxiv/parse/utils.mjs +4 -3
  134. package/dist/namespaces/atom/common/config.cjs +8 -3
  135. package/dist/namespaces/atom/common/config.mjs +8 -3
  136. package/dist/namespaces/atom/common/types.d.cts +3 -3
  137. package/dist/namespaces/atom/common/types.d.mts +2 -3
  138. package/dist/namespaces/atom/generate/utils.cjs +1 -2
  139. package/dist/namespaces/atom/generate/utils.mjs +1 -2
  140. package/dist/namespaces/atom/parse/utils.cjs +1 -2
  141. package/dist/namespaces/atom/parse/utils.mjs +1 -2
  142. package/dist/namespaces/blogchannel/common/config.cjs +3 -3
  143. package/dist/namespaces/blogchannel/common/config.mjs +3 -3
  144. package/dist/namespaces/blogchannel/common/types.d.cts +2 -3
  145. package/dist/namespaces/blogchannel/common/types.d.mts +2 -3
  146. package/dist/namespaces/blogchannel/generate/utils.cjs +3 -3
  147. package/dist/namespaces/blogchannel/generate/utils.mjs +3 -3
  148. package/dist/namespaces/blogchannel/parse/utils.cjs +3 -3
  149. package/dist/namespaces/blogchannel/parse/utils.mjs +3 -3
  150. package/dist/namespaces/cc/common/config.cjs +3 -2
  151. package/dist/namespaces/cc/common/config.mjs +3 -2
  152. package/dist/namespaces/cc/common/types.d.cts +1 -3
  153. package/dist/namespaces/cc/common/types.d.mts +1 -3
  154. package/dist/namespaces/cc/generate/utils.cjs +1 -2
  155. package/dist/namespaces/cc/generate/utils.mjs +1 -2
  156. package/dist/namespaces/cc/parse/utils.cjs +1 -2
  157. package/dist/namespaces/cc/parse/utils.mjs +1 -2
  158. package/dist/namespaces/content/common/config.cjs +6 -3
  159. package/dist/namespaces/content/common/config.mjs +6 -3
  160. package/dist/namespaces/content/common/types.d.cts +1 -3
  161. package/dist/namespaces/content/common/types.d.mts +1 -3
  162. package/dist/namespaces/content/generate/utils.cjs +1 -2
  163. package/dist/namespaces/content/generate/utils.mjs +1 -2
  164. package/dist/namespaces/content/parse/utils.cjs +1 -2
  165. package/dist/namespaces/content/parse/utils.mjs +1 -2
  166. package/dist/namespaces/creativecommons/common/config.cjs +4 -3
  167. package/dist/namespaces/creativecommons/common/config.mjs +4 -3
  168. package/dist/namespaces/creativecommons/common/types.d.cts +1 -3
  169. package/dist/namespaces/creativecommons/common/types.d.mts +1 -3
  170. package/dist/namespaces/creativecommons/generate/utils.cjs +1 -2
  171. package/dist/namespaces/creativecommons/generate/utils.mjs +1 -2
  172. package/dist/namespaces/creativecommons/parse/utils.cjs +1 -2
  173. package/dist/namespaces/creativecommons/parse/utils.mjs +1 -2
  174. package/dist/namespaces/dc/common/config.cjs +14 -3
  175. package/dist/namespaces/dc/common/config.mjs +14 -3
  176. package/dist/namespaces/dc/common/types.d.cts +1 -3
  177. package/dist/namespaces/dc/common/types.d.mts +1 -3
  178. package/dist/namespaces/dc/generate/utils.cjs +1 -2
  179. package/dist/namespaces/dc/generate/utils.mjs +1 -2
  180. package/dist/namespaces/dc/parse/utils.cjs +1 -2
  181. package/dist/namespaces/dc/parse/utils.mjs +1 -2
  182. package/dist/namespaces/dcterms/common/config.cjs +14 -3
  183. package/dist/namespaces/dcterms/common/config.mjs +14 -3
  184. package/dist/namespaces/dcterms/common/types.d.cts +1 -3
  185. package/dist/namespaces/dcterms/common/types.d.mts +1 -3
  186. package/dist/namespaces/dcterms/generate/utils.cjs +1 -2
  187. package/dist/namespaces/dcterms/generate/utils.mjs +1 -2
  188. package/dist/namespaces/dcterms/parse/utils.cjs +1 -2
  189. package/dist/namespaces/dcterms/parse/utils.mjs +1 -2
  190. package/dist/namespaces/feedburner/common/config.cjs +22 -0
  191. package/dist/namespaces/feedburner/common/config.mjs +21 -0
  192. package/dist/namespaces/feedburner/common/types.d.cts +21 -0
  193. package/dist/namespaces/feedburner/common/types.d.mts +21 -0
  194. package/dist/namespaces/feedburner/generate/utils.cjs +42 -0
  195. package/dist/namespaces/feedburner/generate/utils.mjs +39 -0
  196. package/dist/namespaces/feedburner/parse/utils.cjs +37 -0
  197. package/dist/namespaces/feedburner/parse/utils.mjs +35 -0
  198. package/dist/namespaces/feedpress/common/config.cjs +14 -3
  199. package/dist/namespaces/feedpress/common/config.mjs +14 -3
  200. package/dist/namespaces/feedpress/common/types.d.cts +1 -3
  201. package/dist/namespaces/feedpress/common/types.d.mts +1 -3
  202. package/dist/namespaces/feedpress/generate/utils.cjs +1 -2
  203. package/dist/namespaces/feedpress/generate/utils.mjs +1 -2
  204. package/dist/namespaces/feedpress/parse/utils.cjs +1 -2
  205. package/dist/namespaces/feedpress/parse/utils.mjs +1 -2
  206. package/dist/namespaces/geo/common/config.cjs +7 -3
  207. package/dist/namespaces/geo/common/config.mjs +7 -3
  208. package/dist/namespaces/geo/common/types.d.cts +1 -3
  209. package/dist/namespaces/geo/common/types.d.mts +1 -3
  210. package/dist/namespaces/geo/generate/utils.cjs +1 -2
  211. package/dist/namespaces/geo/generate/utils.mjs +1 -2
  212. package/dist/namespaces/geo/parse/utils.cjs +1 -2
  213. package/dist/namespaces/geo/parse/utils.mjs +1 -2
  214. package/dist/namespaces/georss/common/config.cjs +7 -3
  215. package/dist/namespaces/georss/common/config.mjs +7 -3
  216. package/dist/namespaces/georss/common/types.d.cts +6 -3
  217. package/dist/namespaces/georss/common/types.d.mts +6 -3
  218. package/dist/namespaces/georss/generate/utils.cjs +10 -3
  219. package/dist/namespaces/georss/generate/utils.mjs +11 -5
  220. package/dist/namespaces/georss/parse/utils.cjs +23 -6
  221. package/dist/namespaces/georss/parse/utils.mjs +24 -8
  222. package/dist/namespaces/googleplay/common/config.cjs +11 -4
  223. package/dist/namespaces/googleplay/common/config.mjs +11 -4
  224. package/dist/namespaces/googleplay/common/types.d.cts +2 -3
  225. package/dist/namespaces/googleplay/common/types.d.mts +2 -3
  226. package/dist/namespaces/googleplay/generate/utils.cjs +6 -6
  227. package/dist/namespaces/googleplay/generate/utils.mjs +6 -6
  228. package/dist/namespaces/googleplay/parse/utils.cjs +8 -4
  229. package/dist/namespaces/googleplay/parse/utils.mjs +8 -5
  230. package/dist/namespaces/itunes/common/config.cjs +9 -3
  231. package/dist/namespaces/itunes/common/config.mjs +9 -3
  232. package/dist/namespaces/itunes/common/types.d.cts +5 -3
  233. package/dist/namespaces/itunes/common/types.d.mts +5 -3
  234. package/dist/namespaces/itunes/generate/utils.cjs +5 -4
  235. package/dist/namespaces/itunes/generate/utils.mjs +6 -5
  236. package/dist/namespaces/itunes/parse/utils.cjs +10 -5
  237. package/dist/namespaces/itunes/parse/utils.mjs +11 -6
  238. package/dist/namespaces/media/common/config.cjs +5 -2
  239. package/dist/namespaces/media/common/config.mjs +5 -2
  240. package/dist/namespaces/media/common/types.d.cts +1 -3
  241. package/dist/namespaces/media/common/types.d.mts +1 -3
  242. package/dist/namespaces/media/generate/utils.cjs +2 -3
  243. package/dist/namespaces/media/generate/utils.mjs +3 -4
  244. package/dist/namespaces/media/parse/utils.cjs +1 -2
  245. package/dist/namespaces/media/parse/utils.mjs +1 -2
  246. package/dist/namespaces/opensearch/common/config.cjs +20 -3
  247. package/dist/namespaces/opensearch/common/config.mjs +20 -3
  248. package/dist/namespaces/opensearch/common/types.d.cts +11 -3
  249. package/dist/namespaces/opensearch/common/types.d.mts +11 -3
  250. package/dist/namespaces/opensearch/generate/utils.cjs +15 -2
  251. package/dist/namespaces/opensearch/generate/utils.mjs +15 -3
  252. package/dist/namespaces/opensearch/parse/utils.cjs +15 -2
  253. package/dist/namespaces/opensearch/parse/utils.mjs +15 -3
  254. package/dist/namespaces/pingback/common/config.cjs +7 -3
  255. package/dist/namespaces/pingback/common/config.mjs +7 -3
  256. package/dist/namespaces/pingback/common/types.d.cts +3 -3
  257. package/dist/namespaces/pingback/common/types.d.mts +3 -3
  258. package/dist/namespaces/pingback/generate/utils.cjs +3 -3
  259. package/dist/namespaces/pingback/generate/utils.mjs +4 -4
  260. package/dist/namespaces/pingback/parse/utils.cjs +3 -3
  261. package/dist/namespaces/pingback/parse/utils.mjs +4 -4
  262. package/dist/namespaces/podcast/common/config.cjs +9 -3
  263. package/dist/namespaces/podcast/common/config.mjs +9 -3
  264. package/dist/namespaces/podcast/common/types.d.cts +4 -4
  265. package/dist/namespaces/podcast/common/types.d.mts +4 -4
  266. package/dist/namespaces/podcast/generate/utils.cjs +5 -4
  267. package/dist/namespaces/podcast/generate/utils.mjs +5 -4
  268. package/dist/namespaces/podcast/parse/utils.cjs +5 -4
  269. package/dist/namespaces/podcast/parse/utils.mjs +5 -4
  270. package/dist/namespaces/prism/common/config.cjs +61 -4
  271. package/dist/namespaces/prism/common/config.mjs +61 -4
  272. package/dist/namespaces/prism/common/types.d.cts +60 -73
  273. package/dist/namespaces/prism/common/types.d.mts +60 -73
  274. package/dist/namespaces/prism/generate/utils.cjs +139 -145
  275. package/dist/namespaces/prism/generate/utils.mjs +136 -145
  276. package/dist/namespaces/prism/parse/utils.cjs +116 -118
  277. package/dist/namespaces/prism/parse/utils.mjs +112 -118
  278. package/dist/namespaces/psc/common/config.cjs +6 -3
  279. package/dist/namespaces/psc/common/config.mjs +6 -3
  280. package/dist/namespaces/psc/common/types.d.cts +1 -3
  281. package/dist/namespaces/psc/common/types.d.mts +1 -3
  282. package/dist/namespaces/psc/generate/utils.cjs +1 -2
  283. package/dist/namespaces/psc/generate/utils.mjs +1 -2
  284. package/dist/namespaces/psc/parse/utils.cjs +1 -2
  285. package/dist/namespaces/psc/parse/utils.mjs +1 -2
  286. package/dist/namespaces/rawvoice/common/config.cjs +10 -3
  287. package/dist/namespaces/rawvoice/common/config.mjs +10 -3
  288. package/dist/namespaces/rawvoice/common/types.d.cts +1 -3
  289. package/dist/namespaces/rawvoice/common/types.d.mts +1 -3
  290. package/dist/namespaces/rawvoice/generate/utils.cjs +1 -2
  291. package/dist/namespaces/rawvoice/generate/utils.mjs +1 -2
  292. package/dist/namespaces/rawvoice/parse/utils.cjs +1 -2
  293. package/dist/namespaces/rawvoice/parse/utils.mjs +1 -2
  294. package/dist/namespaces/rdf/common/config.cjs +7 -3
  295. package/dist/namespaces/rdf/common/config.mjs +7 -3
  296. package/dist/namespaces/rdf/common/types.d.cts +3 -3
  297. package/dist/namespaces/rdf/common/types.d.mts +3 -3
  298. package/dist/namespaces/rdf/parse/utils.cjs +1 -2
  299. package/dist/namespaces/rdf/parse/utils.mjs +1 -2
  300. package/dist/namespaces/rss/common/config.cjs +6 -3
  301. package/dist/namespaces/rss/common/config.mjs +6 -3
  302. package/dist/namespaces/rss2/common/config.cjs +10 -0
  303. package/dist/namespaces/rss2/common/config.mjs +10 -0
  304. package/dist/namespaces/slash/common/config.cjs +6 -3
  305. package/dist/namespaces/slash/common/config.mjs +6 -3
  306. package/dist/namespaces/slash/common/types.d.cts +1 -3
  307. package/dist/namespaces/slash/common/types.d.mts +1 -3
  308. package/dist/namespaces/slash/generate/utils.cjs +1 -2
  309. package/dist/namespaces/slash/generate/utils.mjs +1 -2
  310. package/dist/namespaces/slash/parse/utils.cjs +1 -2
  311. package/dist/namespaces/slash/parse/utils.mjs +1 -2
  312. package/dist/namespaces/source/common/config.cjs +1 -2
  313. package/dist/namespaces/source/common/config.mjs +1 -2
  314. package/dist/namespaces/source/common/types.d.cts +6 -3
  315. package/dist/namespaces/source/common/types.d.mts +6 -3
  316. package/dist/namespaces/source/generate/utils.cjs +20 -11
  317. package/dist/namespaces/source/generate/utils.mjs +21 -13
  318. package/dist/namespaces/source/parse/utils.cjs +12 -3
  319. package/dist/namespaces/source/parse/utils.mjs +13 -5
  320. package/dist/namespaces/spotify/common/config.cjs +6 -3
  321. package/dist/namespaces/spotify/common/config.mjs +6 -3
  322. package/dist/namespaces/spotify/common/types.d.cts +1 -3
  323. package/dist/namespaces/spotify/common/types.d.mts +1 -3
  324. package/dist/namespaces/spotify/generate/utils.cjs +3 -3
  325. package/dist/namespaces/spotify/generate/utils.mjs +4 -4
  326. package/dist/namespaces/spotify/parse/utils.cjs +7 -5
  327. package/dist/namespaces/spotify/parse/utils.mjs +7 -5
  328. package/dist/namespaces/sy/common/config.cjs +6 -3
  329. package/dist/namespaces/sy/common/config.mjs +6 -3
  330. package/dist/namespaces/sy/common/types.d.cts +1 -3
  331. package/dist/namespaces/sy/common/types.d.mts +1 -3
  332. package/dist/namespaces/sy/generate/utils.cjs +1 -2
  333. package/dist/namespaces/sy/generate/utils.mjs +1 -2
  334. package/dist/namespaces/sy/parse/utils.cjs +1 -2
  335. package/dist/namespaces/sy/parse/utils.mjs +1 -2
  336. package/dist/namespaces/thr/common/config.cjs +10 -3
  337. package/dist/namespaces/thr/common/config.mjs +10 -3
  338. package/dist/namespaces/thr/common/types.d.cts +1 -3
  339. package/dist/namespaces/thr/common/types.d.mts +1 -3
  340. package/dist/namespaces/thr/generate/utils.cjs +1 -2
  341. package/dist/namespaces/thr/generate/utils.mjs +1 -2
  342. package/dist/namespaces/thr/parse/utils.cjs +1 -2
  343. package/dist/namespaces/thr/parse/utils.mjs +1 -2
  344. package/dist/namespaces/trackback/common/config.cjs +6 -3
  345. package/dist/namespaces/trackback/common/config.mjs +6 -3
  346. package/dist/namespaces/trackback/common/types.d.cts +1 -3
  347. package/dist/namespaces/trackback/common/types.d.mts +1 -3
  348. package/dist/namespaces/trackback/generate/utils.cjs +1 -2
  349. package/dist/namespaces/trackback/generate/utils.mjs +1 -2
  350. package/dist/namespaces/trackback/parse/utils.cjs +1 -2
  351. package/dist/namespaces/trackback/parse/utils.mjs +1 -2
  352. package/dist/namespaces/wfw/common/config.cjs +6 -3
  353. package/dist/namespaces/wfw/common/config.mjs +6 -3
  354. package/dist/namespaces/wfw/common/types.d.cts +1 -3
  355. package/dist/namespaces/wfw/common/types.d.mts +1 -3
  356. package/dist/namespaces/wfw/generate/utils.cjs +1 -2
  357. package/dist/namespaces/wfw/generate/utils.mjs +1 -2
  358. package/dist/namespaces/wfw/parse/utils.cjs +1 -2
  359. package/dist/namespaces/wfw/parse/utils.mjs +1 -2
  360. package/dist/namespaces/xml/common/types.d.cts +1 -3
  361. package/dist/namespaces/xml/common/types.d.mts +1 -3
  362. package/dist/namespaces/xml/generate/utils.cjs +1 -2
  363. package/dist/namespaces/xml/generate/utils.mjs +1 -2
  364. package/dist/namespaces/xml/parse/utils.cjs +1 -2
  365. package/dist/namespaces/xml/parse/utils.mjs +1 -2
  366. package/dist/namespaces/yt/common/config.cjs +6 -3
  367. package/dist/namespaces/yt/common/config.mjs +6 -3
  368. package/dist/namespaces/yt/common/types.d.cts +1 -3
  369. package/dist/namespaces/yt/common/types.d.mts +1 -3
  370. package/dist/namespaces/yt/generate/utils.cjs +1 -2
  371. package/dist/namespaces/yt/generate/utils.mjs +1 -2
  372. package/dist/namespaces/yt/parse/utils.cjs +1 -2
  373. package/dist/namespaces/yt/parse/utils.mjs +1 -2
  374. package/dist/node_modules/trousse/dist/arrays.d.cts +1 -0
  375. package/dist/node_modules/trousse/dist/coercions.cjs +7 -3
  376. package/dist/node_modules/trousse/dist/coercions.d.cts +1 -0
  377. package/dist/node_modules/trousse/dist/coercions.mjs +8 -5
  378. package/dist/node_modules/trousse/dist/files.d.cts +1 -0
  379. package/dist/node_modules/trousse/dist/index.d.cts +13 -0
  380. package/dist/node_modules/trousse/dist/is.cjs +15 -4
  381. package/dist/node_modules/trousse/dist/is.d.cts +1 -0
  382. package/dist/node_modules/trousse/dist/is.mjs +13 -5
  383. package/dist/node_modules/trousse/dist/json.cjs +1 -2
  384. package/dist/node_modules/trousse/dist/json.d.cts +1 -0
  385. package/dist/node_modules/trousse/dist/json.mjs +1 -2
  386. package/dist/node_modules/trousse/dist/locales.cjs +1 -2
  387. package/dist/node_modules/trousse/dist/locales.d.cts +1 -0
  388. package/dist/node_modules/trousse/dist/locales.mjs +1 -2
  389. package/dist/node_modules/trousse/dist/matching.d.cts +1 -0
  390. package/dist/node_modules/trousse/dist/mimes.d.cts +1 -0
  391. package/dist/node_modules/trousse/dist/objects.cjs +14 -3
  392. package/dist/node_modules/trousse/dist/objects.d.cts +1 -0
  393. package/dist/node_modules/trousse/dist/objects.mjs +14 -3
  394. package/dist/node_modules/trousse/dist/timers.d.cts +1 -0
  395. package/dist/node_modules/trousse/dist/types.d.cts +1 -3
  396. package/dist/node_modules/trousse/dist/types.d.mts +1 -3
  397. package/dist/node_modules/trousse/dist/urls.cjs +14 -2
  398. package/dist/node_modules/trousse/dist/urls.d.cts +1 -0
  399. package/dist/node_modules/trousse/dist/urls.mjs +14 -2
  400. package/dist/opml/common/types.d.cts +1 -3
  401. package/dist/opml/common/types.d.mts +1 -3
  402. package/dist/opml/generate/config.cjs +1 -2
  403. package/dist/opml/generate/config.mjs +1 -2
  404. package/dist/opml/generate/index.cjs +5 -6
  405. package/dist/opml/generate/index.d.cts +1 -3
  406. package/dist/opml/generate/index.d.mts +1 -3
  407. package/dist/opml/generate/index.mjs +3 -4
  408. package/dist/opml/generate/utils.cjs +1 -2
  409. package/dist/opml/generate/utils.mjs +1 -2
  410. package/dist/opml/parse/config.cjs +1 -2
  411. package/dist/opml/parse/config.mjs +1 -2
  412. package/dist/opml/parse/index.cjs +6 -7
  413. package/dist/opml/parse/index.d.cts +1 -3
  414. package/dist/opml/parse/index.d.mts +1 -3
  415. package/dist/opml/parse/index.mjs +4 -5
  416. package/dist/opml/parse/utils.cjs +1 -2
  417. package/dist/opml/parse/utils.mjs +1 -2
  418. package/package.json +8 -8
@@ -1,9 +1,9 @@
1
- const require_is = require("../node_modules/trousse/dist/is.cjs");
2
1
  const require_coercions = require("../node_modules/trousse/dist/coercions.cjs");
2
+ const require_is = require("../node_modules/trousse/dist/is.cjs");
3
3
  const require_json = require("../node_modules/trousse/dist/json.cjs");
4
4
  const require_objects = require("../node_modules/trousse/dist/objects.cjs");
5
5
  let entities = require("entities");
6
- //#region src/common/utils.ts
6
+ // src/common/utils.ts
7
7
  const isNonEmptyStringOrNumber = (value) => {
8
8
  return require_is.isNumber(value) || require_is.isNonEmptyString(value);
9
9
  };
@@ -37,7 +37,8 @@ const trimArray = (value, parse) => {
37
37
  const item = parse ? parse(element) : element;
38
38
  if (require_is.isPresent(item)) result.push(item);
39
39
  }
40
- return result.length > 0 ? result : void 0;
40
+ if (result.length === 0) return;
41
+ return result;
41
42
  };
42
43
  const cdataStartTag = "<![CDATA[";
43
44
  const cdataEndTag = "]]>";
@@ -64,47 +65,51 @@ const stripComments = (text) => {
64
65
  };
65
66
  const decodeWithCdata = (text) => {
66
67
  let currentIndex = text.indexOf(cdataStartTag);
67
- if (currentIndex === -1) return hasEntities(text) ? (0, entities.decodeHTML)(text) : text;
68
+ if (currentIndex === -1) return hasEntities(text) ? (0, entities.decodeHTMLStrict)(text) : text;
68
69
  let result = "";
69
70
  let lastIndex = 0;
70
71
  while (currentIndex !== -1) {
71
72
  const textBefore = text.slice(lastIndex, currentIndex);
72
- result += hasEntities(textBefore) ? (0, entities.decodeHTML)(textBefore) : textBefore;
73
+ result += hasEntities(textBefore) ? (0, entities.decodeHTMLStrict)(textBefore) : textBefore;
73
74
  const endIndex = text.indexOf(cdataEndTag, currentIndex + 9);
74
- if (endIndex === -1) return hasEntities(text) ? (0, entities.decodeHTML)(text) : text;
75
+ if (endIndex === -1) return hasEntities(text) ? (0, entities.decodeHTMLStrict)(text) : text;
75
76
  result += text.slice(currentIndex + 9, endIndex);
76
77
  lastIndex = endIndex + 3;
77
78
  currentIndex = text.indexOf(cdataStartTag, lastIndex);
78
79
  }
79
80
  const textAfter = text.slice(lastIndex);
80
- result += hasEntities(textAfter) ? (0, entities.decodeHTML)(textAfter) : textAfter;
81
+ result += hasEntities(textAfter) ? (0, entities.decodeHTMLStrict)(textAfter) : textAfter;
81
82
  return result;
82
83
  };
83
84
  const parseString = (value) => {
84
- if (typeof value === "string") {
85
- if (value === "") return;
85
+ if (require_is.isString(value)) {
86
+ if (!value) return;
86
87
  return decodeWithCdata(stripComments(value)).trim() || void 0;
87
88
  }
88
- if (typeof value === "number") return value.toString();
89
+ if (require_is.isNumber(value)) return value.toString();
89
90
  };
90
91
  const parseVerbatimString = (value) => {
91
- if (typeof value === "string") {
92
- if (value === "") return;
92
+ if (require_is.isString(value)) {
93
+ if (!value) return;
93
94
  return value.trim() || void 0;
94
95
  }
95
- if (typeof value === "number") return value.toString();
96
+ if (require_is.isNumber(value)) return value.toString();
96
97
  };
97
98
  const parseNumber = (value) => {
99
+ if (require_is.isString(value)) return require_coercions.coerceNumber(parseString(value));
98
100
  return require_coercions.coerceNumber(value);
99
101
  };
100
102
  const yesRegex = /^\p{White_Space}*yes\p{White_Space}*$/iu;
101
103
  const parseBoolean = (value) => {
104
+ if (require_is.isString(value)) return require_coercions.coerceBoolean(parseString(value));
102
105
  return require_coercions.coerceBoolean(value);
103
106
  };
104
107
  const parseYesNoBoolean = (value) => {
105
108
  const boolean = parseBoolean(value);
106
109
  if (boolean !== void 0) return boolean;
107
- if (require_is.isNonEmptyString(value)) return yesRegex.test(value);
110
+ if (!require_is.isString(value)) return;
111
+ const string = parseString(value);
112
+ if (string) return yesRegex.test(string);
108
113
  };
109
114
  const parseDate = (value, parseDateFn) => {
110
115
  const raw = parseString(value);
@@ -168,10 +173,11 @@ const generateXmlStylesheet = (stylesheet) => {
168
173
  }
169
174
  return `<?xml-stylesheet${attributes}?>`;
170
175
  };
176
+ const aposEntityRegex = /&apos;/g;
171
177
  const generateXml = (builder, value, options) => {
172
178
  var _options$stylesheets;
173
179
  let body = builder.build(value);
174
- if (body.includes("&apos;")) body = body.replace(/&apos;/g, "'");
180
+ if (body.includes("&apos;")) body = body.replace(aposEntityRegex, "'");
175
181
  let declaration = "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
176
182
  if (options === null || options === void 0 || (_options$stylesheets = options.stylesheets) === null || _options$stylesheets === void 0 ? void 0 : _options$stylesheets.length) for (const stylesheetObject of options.stylesheets) {
177
183
  const stylesheetString = generateXmlStylesheet(stylesheetObject);
@@ -181,25 +187,25 @@ const generateXml = (builder, value, options) => {
181
187
  };
182
188
  const generateRfc822Date = (value) => {
183
189
  if (!require_is.isPresent(value)) return;
184
- const isString = typeof value === "string";
185
- if (isString && !require_is.isNonEmptyString(value)) return;
186
- const date = isString ? new Date(value) : value;
187
- if (!Number.isNaN(date.getTime())) return date.toUTCString();
188
- if (isString) return value;
190
+ const isStringValue = require_is.isString(value);
191
+ if (isStringValue && !require_is.isNonEmptyString(value)) return;
192
+ const date = isStringValue ? new Date(value) : value;
193
+ if (require_is.isValidDate(date)) return date.toUTCString();
194
+ if (isStringValue) return value;
189
195
  };
190
196
  const generateRfc3339Date = (value) => {
191
197
  if (!require_is.isPresent(value)) return;
192
- const isString = typeof value === "string";
193
- if (isString && !require_is.isNonEmptyString(value)) return;
194
- const date = isString ? new Date(value) : value;
195
- if (!Number.isNaN(date.getTime())) return date.toISOString();
196
- if (isString) return value;
198
+ const isStringValue = require_is.isString(value);
199
+ if (isStringValue && !require_is.isNonEmptyString(value)) return;
200
+ const date = isStringValue ? new Date(value) : value;
201
+ if (require_is.isValidDate(date)) return date.toISOString();
202
+ if (isStringValue) return value;
197
203
  };
198
204
  const generateBoolean = (value) => {
199
- if (typeof value === "boolean") return value;
205
+ if (require_is.isBoolean(value)) return value;
200
206
  };
201
207
  const generateYesNoBoolean = (value) => {
202
- if (typeof value !== "boolean") return;
208
+ if (!require_is.isBoolean(value)) return;
203
209
  return value ? "yes" : "no";
204
210
  };
205
211
  const detectNamespaces = (value, recursive = false) => {
@@ -238,7 +244,7 @@ const generatePlainString = (value) => {
238
244
  return value.trim();
239
245
  };
240
246
  const generateNumber = (value) => {
241
- if (typeof value === "number" && Number.isFinite(value)) return value;
247
+ if (require_is.isFiniteNumber(value)) return value;
242
248
  };
243
249
  const generateRdfResource = (value, generate) => {
244
250
  const rdfResource = generate(value);
@@ -256,6 +262,7 @@ const generateNamespaceAttrs = (value, namespaceUris) => {
256
262
  }
257
263
  return namespaceAttrs;
258
264
  };
265
+ const reservedPrefixes = ["xmlns", "xml"];
259
266
  const createNamespaceResolver = (options) => {
260
267
  const { namespaceUris, namespacePrefixes, primaryNamespaces } = options;
261
268
  const primaryUris = new Set(primaryNamespaces === null || primaryNamespaces === void 0 ? void 0 : primaryNamespaces.flatMap((key) => {
@@ -263,7 +270,8 @@ const createNamespaceResolver = (options) => {
263
270
  return ((_namespaceUris$key = namespaceUris[key]) === null || _namespaceUris$key === void 0 ? void 0 : _namespaceUris$key.map((uri) => uri.toLowerCase())) ?? [];
264
271
  }));
265
272
  const resolveUri = (uri) => {
266
- const normalized = uri.trim().toLowerCase();
273
+ const trimmed = uri.trim().toLowerCase();
274
+ const normalized = trimmed.startsWith("//") ? `http:${trimmed}` : trimmed;
267
275
  if (primaryUris.has(normalized)) return "";
268
276
  return namespacePrefixes[normalized];
269
277
  };
@@ -311,7 +319,7 @@ const createNamespaceResolver = (options) => {
311
319
  }
312
320
  const recordDeclaration = (rawAttrName, value) => {
313
321
  const firstCharCode = rawAttrName.charCodeAt(0);
314
- if (firstCharCode !== 120 && firstCharCode !== 88 || typeof value !== "string") return;
322
+ if (firstCharCode !== 120 && firstCharCode !== 88 || !require_is.isString(value)) return;
315
323
  const attrName = rawAttrName.toLowerCase();
316
324
  if (attrName === "xmlns") {
317
325
  if (tagsSeen === 1 && defaultCanonical === void 0) {
@@ -335,11 +343,11 @@ const createNamespaceResolver = (options) => {
335
343
  return lowered;
336
344
  }
337
345
  const prefix = lowered.slice(0, colonIndex);
338
- if (prefix === "xmlns" || prefix === "xml") return lowered;
346
+ if (reservedPrefixes.includes(prefix)) return lowered;
339
347
  const canonical = prefixMap.get(prefix);
340
348
  if (canonical === void 0) return lowered;
341
349
  const local = lowered.slice(colonIndex + 1);
342
- return canonical === "" ? local : `${canonical}:${local}`;
350
+ return canonical ? `${canonical}:${local}` : local;
343
351
  };
344
352
  const transformTagName = (name) => {
345
353
  tagsSeen++;
@@ -358,7 +366,7 @@ const createNamespaceResolver = (options) => {
358
366
  const canonical = prefixMap.get(prefix);
359
367
  if (canonical === void 0 || canonical === prefix) return tagName;
360
368
  const local = tagName.slice(colonIndex + 1);
361
- return canonical === "" ? local : `${canonical}:${local}`;
369
+ return canonical ? `${canonical}:${local}` : local;
362
370
  };
363
371
  return {
364
372
  transformTagName,
@@ -371,12 +379,12 @@ const createNamespaceResolver = (options) => {
371
379
  const parseJsonObject = (value) => {
372
380
  if (require_is.isPlainObject(value)) return value;
373
381
  if (!require_is.isNonEmptyString(value) || !require_json.isJsonLike(value)) return;
382
+ const json = value.startsWith("") ? value.slice(1) : value;
374
383
  try {
375
- const parsed = JSON.parse(value);
384
+ const parsed = JSON.parse(json);
376
385
  if (require_is.isPlainObject(parsed)) return parsed;
377
386
  } catch {}
378
387
  };
379
- //#endregion
380
388
  exports.createNamespaceResolver = createNamespaceResolver;
381
389
  exports.detectNamespaces = detectNamespaces;
382
390
  exports.generateBoolean = generateBoolean;
@@ -1,9 +1,9 @@
1
- import { isNonEmptyString, isNumber, isPlainObject, isPresent } from "../node_modules/trousse/dist/is.mjs";
2
1
  import { coerceBoolean, coerceNumber, coerceSingular } from "../node_modules/trousse/dist/coercions.mjs";
2
+ import { isBoolean, isFiniteNumber, isNonEmptyString, isNumber, isPlainObject, isPresent, isString, isValidDate } from "../node_modules/trousse/dist/is.mjs";
3
3
  import { isJsonLike } from "../node_modules/trousse/dist/json.mjs";
4
4
  import { trimObject } from "../node_modules/trousse/dist/objects.mjs";
5
- import { decodeHTML } from "entities";
6
- //#region src/common/utils.ts
5
+ import { decodeHTMLStrict } from "entities";
6
+ // src/common/utils.ts
7
7
  const isNonEmptyStringOrNumber = (value) => {
8
8
  return isNumber(value) || isNonEmptyString(value);
9
9
  };
@@ -37,7 +37,8 @@ const trimArray = (value, parse) => {
37
37
  const item = parse ? parse(element) : element;
38
38
  if (isPresent(item)) result.push(item);
39
39
  }
40
- return result.length > 0 ? result : void 0;
40
+ if (result.length === 0) return;
41
+ return result;
41
42
  };
42
43
  const cdataStartTag = "<![CDATA[";
43
44
  const cdataEndTag = "]]>";
@@ -64,47 +65,51 @@ const stripComments = (text) => {
64
65
  };
65
66
  const decodeWithCdata = (text) => {
66
67
  let currentIndex = text.indexOf(cdataStartTag);
67
- if (currentIndex === -1) return hasEntities(text) ? decodeHTML(text) : text;
68
+ if (currentIndex === -1) return hasEntities(text) ? decodeHTMLStrict(text) : text;
68
69
  let result = "";
69
70
  let lastIndex = 0;
70
71
  while (currentIndex !== -1) {
71
72
  const textBefore = text.slice(lastIndex, currentIndex);
72
- result += hasEntities(textBefore) ? decodeHTML(textBefore) : textBefore;
73
+ result += hasEntities(textBefore) ? decodeHTMLStrict(textBefore) : textBefore;
73
74
  const endIndex = text.indexOf(cdataEndTag, currentIndex + 9);
74
- if (endIndex === -1) return hasEntities(text) ? decodeHTML(text) : text;
75
+ if (endIndex === -1) return hasEntities(text) ? decodeHTMLStrict(text) : text;
75
76
  result += text.slice(currentIndex + 9, endIndex);
76
77
  lastIndex = endIndex + 3;
77
78
  currentIndex = text.indexOf(cdataStartTag, lastIndex);
78
79
  }
79
80
  const textAfter = text.slice(lastIndex);
80
- result += hasEntities(textAfter) ? decodeHTML(textAfter) : textAfter;
81
+ result += hasEntities(textAfter) ? decodeHTMLStrict(textAfter) : textAfter;
81
82
  return result;
82
83
  };
83
84
  const parseString = (value) => {
84
- if (typeof value === "string") {
85
- if (value === "") return;
85
+ if (isString(value)) {
86
+ if (!value) return;
86
87
  return decodeWithCdata(stripComments(value)).trim() || void 0;
87
88
  }
88
- if (typeof value === "number") return value.toString();
89
+ if (isNumber(value)) return value.toString();
89
90
  };
90
91
  const parseVerbatimString = (value) => {
91
- if (typeof value === "string") {
92
- if (value === "") return;
92
+ if (isString(value)) {
93
+ if (!value) return;
93
94
  return value.trim() || void 0;
94
95
  }
95
- if (typeof value === "number") return value.toString();
96
+ if (isNumber(value)) return value.toString();
96
97
  };
97
98
  const parseNumber = (value) => {
99
+ if (isString(value)) return coerceNumber(parseString(value));
98
100
  return coerceNumber(value);
99
101
  };
100
102
  const yesRegex = /^\p{White_Space}*yes\p{White_Space}*$/iu;
101
103
  const parseBoolean = (value) => {
104
+ if (isString(value)) return coerceBoolean(parseString(value));
102
105
  return coerceBoolean(value);
103
106
  };
104
107
  const parseYesNoBoolean = (value) => {
105
108
  const boolean = parseBoolean(value);
106
109
  if (boolean !== void 0) return boolean;
107
- if (isNonEmptyString(value)) return yesRegex.test(value);
110
+ if (!isString(value)) return;
111
+ const string = parseString(value);
112
+ if (string) return yesRegex.test(string);
108
113
  };
109
114
  const parseDate = (value, parseDateFn) => {
110
115
  const raw = parseString(value);
@@ -168,10 +173,11 @@ const generateXmlStylesheet = (stylesheet) => {
168
173
  }
169
174
  return `<?xml-stylesheet${attributes}?>`;
170
175
  };
176
+ const aposEntityRegex = /&apos;/g;
171
177
  const generateXml = (builder, value, options) => {
172
178
  var _options$stylesheets;
173
179
  let body = builder.build(value);
174
- if (body.includes("&apos;")) body = body.replace(/&apos;/g, "'");
180
+ if (body.includes("&apos;")) body = body.replace(aposEntityRegex, "'");
175
181
  let declaration = "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
176
182
  if (options === null || options === void 0 || (_options$stylesheets = options.stylesheets) === null || _options$stylesheets === void 0 ? void 0 : _options$stylesheets.length) for (const stylesheetObject of options.stylesheets) {
177
183
  const stylesheetString = generateXmlStylesheet(stylesheetObject);
@@ -181,25 +187,25 @@ const generateXml = (builder, value, options) => {
181
187
  };
182
188
  const generateRfc822Date = (value) => {
183
189
  if (!isPresent(value)) return;
184
- const isString = typeof value === "string";
185
- if (isString && !isNonEmptyString(value)) return;
186
- const date = isString ? new Date(value) : value;
187
- if (!Number.isNaN(date.getTime())) return date.toUTCString();
188
- if (isString) return value;
190
+ const isStringValue = isString(value);
191
+ if (isStringValue && !isNonEmptyString(value)) return;
192
+ const date = isStringValue ? new Date(value) : value;
193
+ if (isValidDate(date)) return date.toUTCString();
194
+ if (isStringValue) return value;
189
195
  };
190
196
  const generateRfc3339Date = (value) => {
191
197
  if (!isPresent(value)) return;
192
- const isString = typeof value === "string";
193
- if (isString && !isNonEmptyString(value)) return;
194
- const date = isString ? new Date(value) : value;
195
- if (!Number.isNaN(date.getTime())) return date.toISOString();
196
- if (isString) return value;
198
+ const isStringValue = isString(value);
199
+ if (isStringValue && !isNonEmptyString(value)) return;
200
+ const date = isStringValue ? new Date(value) : value;
201
+ if (isValidDate(date)) return date.toISOString();
202
+ if (isStringValue) return value;
197
203
  };
198
204
  const generateBoolean = (value) => {
199
- if (typeof value === "boolean") return value;
205
+ if (isBoolean(value)) return value;
200
206
  };
201
207
  const generateYesNoBoolean = (value) => {
202
- if (typeof value !== "boolean") return;
208
+ if (!isBoolean(value)) return;
203
209
  return value ? "yes" : "no";
204
210
  };
205
211
  const detectNamespaces = (value, recursive = false) => {
@@ -238,7 +244,7 @@ const generatePlainString = (value) => {
238
244
  return value.trim();
239
245
  };
240
246
  const generateNumber = (value) => {
241
- if (typeof value === "number" && Number.isFinite(value)) return value;
247
+ if (isFiniteNumber(value)) return value;
242
248
  };
243
249
  const generateRdfResource = (value, generate) => {
244
250
  const rdfResource = generate(value);
@@ -256,6 +262,7 @@ const generateNamespaceAttrs = (value, namespaceUris) => {
256
262
  }
257
263
  return namespaceAttrs;
258
264
  };
265
+ const reservedPrefixes = ["xmlns", "xml"];
259
266
  const createNamespaceResolver = (options) => {
260
267
  const { namespaceUris, namespacePrefixes, primaryNamespaces } = options;
261
268
  const primaryUris = new Set(primaryNamespaces === null || primaryNamespaces === void 0 ? void 0 : primaryNamespaces.flatMap((key) => {
@@ -263,7 +270,8 @@ const createNamespaceResolver = (options) => {
263
270
  return ((_namespaceUris$key = namespaceUris[key]) === null || _namespaceUris$key === void 0 ? void 0 : _namespaceUris$key.map((uri) => uri.toLowerCase())) ?? [];
264
271
  }));
265
272
  const resolveUri = (uri) => {
266
- const normalized = uri.trim().toLowerCase();
273
+ const trimmed = uri.trim().toLowerCase();
274
+ const normalized = trimmed.startsWith("//") ? `http:${trimmed}` : trimmed;
267
275
  if (primaryUris.has(normalized)) return "";
268
276
  return namespacePrefixes[normalized];
269
277
  };
@@ -311,7 +319,7 @@ const createNamespaceResolver = (options) => {
311
319
  }
312
320
  const recordDeclaration = (rawAttrName, value) => {
313
321
  const firstCharCode = rawAttrName.charCodeAt(0);
314
- if (firstCharCode !== 120 && firstCharCode !== 88 || typeof value !== "string") return;
322
+ if (firstCharCode !== 120 && firstCharCode !== 88 || !isString(value)) return;
315
323
  const attrName = rawAttrName.toLowerCase();
316
324
  if (attrName === "xmlns") {
317
325
  if (tagsSeen === 1 && defaultCanonical === void 0) {
@@ -335,11 +343,11 @@ const createNamespaceResolver = (options) => {
335
343
  return lowered;
336
344
  }
337
345
  const prefix = lowered.slice(0, colonIndex);
338
- if (prefix === "xmlns" || prefix === "xml") return lowered;
346
+ if (reservedPrefixes.includes(prefix)) return lowered;
339
347
  const canonical = prefixMap.get(prefix);
340
348
  if (canonical === void 0) return lowered;
341
349
  const local = lowered.slice(colonIndex + 1);
342
- return canonical === "" ? local : `${canonical}:${local}`;
350
+ return canonical ? `${canonical}:${local}` : local;
343
351
  };
344
352
  const transformTagName = (name) => {
345
353
  tagsSeen++;
@@ -358,7 +366,7 @@ const createNamespaceResolver = (options) => {
358
366
  const canonical = prefixMap.get(prefix);
359
367
  if (canonical === void 0 || canonical === prefix) return tagName;
360
368
  const local = tagName.slice(colonIndex + 1);
361
- return canonical === "" ? local : `${canonical}:${local}`;
369
+ return canonical ? `${canonical}:${local}` : local;
362
370
  };
363
371
  return {
364
372
  transformTagName,
@@ -371,10 +379,10 @@ const createNamespaceResolver = (options) => {
371
379
  const parseJsonObject = (value) => {
372
380
  if (isPlainObject(value)) return value;
373
381
  if (!isNonEmptyString(value) || !isJsonLike(value)) return;
382
+ const json = value.startsWith("") ? value.slice(1) : value;
374
383
  try {
375
- const parsed = JSON.parse(value);
384
+ const parsed = JSON.parse(json);
376
385
  if (isPlainObject(parsed)) return parsed;
377
386
  } catch {}
378
387
  };
379
- //#endregion
380
388
  export { createNamespaceResolver, detectNamespaces, generateBoolean, generateCdataString, generateCsvOf, generateNamespaceAttrs, generateNumber, generatePlainString, generateRdfResource, generateRfc3339Date, generateRfc822Date, generateTextOrCdataString, generateXml, generateXmlStylesheet, generateYesNoBoolean, hasEntities, isNonEmptyStringOrNumber, isXmlAttributeKey, limitArray, parseArray, parseArrayOf, parseBoolean, parseCsvOf, parseDate, parseJsonObject, parseNumber, parseSingular, parseSingularOf, parseString, parseVerbatimString, parseYesNoBoolean, retrieveRdfResourceOrText, retrieveText, trimArray };
@@ -6,6 +6,7 @@ import { CcNs } from "../../../namespaces/cc/common/types.cjs";
6
6
  import { CreativeCommonsNs } from "../../../namespaces/creativecommons/common/types.cjs";
7
7
  import { DcNs } from "../../../namespaces/dc/common/types.cjs";
8
8
  import { DcTermsNs } from "../../../namespaces/dcterms/common/types.cjs";
9
+ import { FeedBurnerNs } from "../../../namespaces/feedburner/common/types.cjs";
9
10
  import { GeoNs } from "../../../namespaces/geo/common/types.cjs";
10
11
  import { GeoRssNs } from "../../../namespaces/georss/common/types.cjs";
11
12
  import { GooglePlayNs } from "../../../namespaces/googleplay/common/types.cjs";
@@ -13,6 +14,7 @@ import { ItunesNs } from "../../../namespaces/itunes/common/types.cjs";
13
14
  import { MediaNs } from "../../../namespaces/media/common/types.cjs";
14
15
  import { OpenSearchNs } from "../../../namespaces/opensearch/common/types.cjs";
15
16
  import { PingbackNs } from "../../../namespaces/pingback/common/types.cjs";
17
+ import { PrismNs } from "../../../namespaces/prism/common/types.cjs";
16
18
  import { PscNs } from "../../../namespaces/psc/common/types.cjs";
17
19
  import { SlashNs } from "../../../namespaces/slash/common/types.cjs";
18
20
  import { SyNs } from "../../../namespaces/sy/common/types.cjs";
@@ -21,7 +23,6 @@ import { TrackbackNs } from "../../../namespaces/trackback/common/types.cjs";
21
23
  import { WfwNs } from "../../../namespaces/wfw/common/types.cjs";
22
24
  import { XmlNs } from "../../../namespaces/xml/common/types.cjs";
23
25
  import { YtNs } from "../../../namespaces/yt/common/types.cjs";
24
- //#region src/feeds/atom/common/types.d.ts
25
26
  export declare namespace AtomFeed {
26
27
  type Text = {
27
28
  value: string;
@@ -86,24 +87,26 @@ export declare namespace AtomFeed {
86
87
  summary?: Text;
87
88
  title: Requirable<Text>;
88
89
  updated: Requirable<TDate>;
89
- app?: AppNs.Entry<TDate>;
90
- arxiv?: ArxivNs.Entry;
91
- cc?: CcNs.ItemOrFeed;
92
90
  dc?: DcNs.ItemOrFeed<TDate>;
91
+ dcterms?: DcTermsNs.ItemOrFeed<TDate>;
93
92
  slash?: SlashNs.Item;
94
93
  itunes?: ItunesNs.Item;
95
- googleplay?: GooglePlayNs.Item<TStrict>;
96
94
  psc?: PscNs.Item<TStrict>;
97
95
  media?: MediaNs.ItemOrFeed<TStrict>;
98
- georss?: GeoRssNs.ItemOrFeed<TStrict>;
99
- geo?: GeoNs.ItemOrFeed;
100
- thr?: ThrNs.Item<TStrict>;
101
- dcterms?: DcTermsNs.ItemOrFeed<TDate>;
96
+ googleplay?: GooglePlayNs.Item<TStrict>;
97
+ feedburner?: FeedBurnerNs.Item;
98
+ arxiv?: ArxivNs.Entry;
99
+ prism?: PrismNs.ItemOrFeed<TDate>;
100
+ cc?: CcNs.ItemOrFeed;
102
101
  creativeCommons?: CreativeCommonsNs.ItemOrFeed;
102
+ thr?: ThrNs.Item<TStrict>;
103
+ app?: AppNs.Entry<TDate>;
103
104
  wfw?: WfwNs.Item;
104
- yt?: YtNs.Item;
105
105
  pingback?: PingbackNs.Item;
106
106
  trackback?: TrackbackNs.Item;
107
+ yt?: YtNs.Item;
108
+ geo?: GeoNs.ItemOrFeed;
109
+ georss?: GeoRssNs.ItemOrFeed<TStrict>;
107
110
  xml?: XmlNs.ItemOrFeed;
108
111
  }, TStrict>;
109
112
  type Feed<TDate, TStrict extends boolean = false> = Strict<{
@@ -120,21 +123,22 @@ export declare namespace AtomFeed {
120
123
  title: Requirable<Text>;
121
124
  updated: Requirable<TDate>;
122
125
  entries?: Array<Entry<TDate, TStrict>>;
123
- cc?: CcNs.ItemOrFeed;
124
126
  dc?: DcNs.ItemOrFeed<TDate>;
127
+ dcterms?: DcTermsNs.ItemOrFeed<TDate>;
125
128
  sy?: SyNs.Feed<TDate>;
126
129
  itunes?: ItunesNs.Feed<TStrict>;
127
- googleplay?: GooglePlayNs.Feed<TStrict>;
128
130
  media?: MediaNs.ItemOrFeed<TStrict>;
129
- georss?: GeoRssNs.ItemOrFeed<TStrict>;
130
- geo?: GeoNs.ItemOrFeed;
131
- dcterms?: DcTermsNs.ItemOrFeed<TDate>;
132
- creativeCommons?: CreativeCommonsNs.ItemOrFeed;
131
+ googleplay?: GooglePlayNs.Feed<TStrict>;
132
+ feedburner?: FeedBurnerNs.Feed<TStrict>;
133
133
  opensearch?: OpenSearchNs.Feed<TStrict>;
134
- yt?: YtNs.Feed;
134
+ prism?: PrismNs.ItemOrFeed<TDate>;
135
+ cc?: CcNs.ItemOrFeed;
136
+ creativeCommons?: CreativeCommonsNs.ItemOrFeed;
135
137
  admin?: AdminNs.Feed;
136
138
  pingback?: PingbackNs.Feed;
139
+ yt?: YtNs.Feed;
140
+ geo?: GeoNs.ItemOrFeed;
141
+ georss?: GeoRssNs.ItemOrFeed<TStrict>;
137
142
  xml?: XmlNs.ItemOrFeed;
138
143
  }, TStrict>;
139
- }
140
- //#endregion
144
+ }
@@ -6,6 +6,7 @@ import { CcNs } from "../../../namespaces/cc/common/types.mjs";
6
6
  import { CreativeCommonsNs } from "../../../namespaces/creativecommons/common/types.mjs";
7
7
  import { DcNs } from "../../../namespaces/dc/common/types.mjs";
8
8
  import { DcTermsNs } from "../../../namespaces/dcterms/common/types.mjs";
9
+ import { FeedBurnerNs } from "../../../namespaces/feedburner/common/types.mjs";
9
10
  import { GeoNs } from "../../../namespaces/geo/common/types.mjs";
10
11
  import { GeoRssNs } from "../../../namespaces/georss/common/types.mjs";
11
12
  import { GooglePlayNs } from "../../../namespaces/googleplay/common/types.mjs";
@@ -13,6 +14,7 @@ import { ItunesNs } from "../../../namespaces/itunes/common/types.mjs";
13
14
  import { MediaNs } from "../../../namespaces/media/common/types.mjs";
14
15
  import { OpenSearchNs } from "../../../namespaces/opensearch/common/types.mjs";
15
16
  import { PingbackNs } from "../../../namespaces/pingback/common/types.mjs";
17
+ import { PrismNs } from "../../../namespaces/prism/common/types.mjs";
16
18
  import { PscNs } from "../../../namespaces/psc/common/types.mjs";
17
19
  import { SlashNs } from "../../../namespaces/slash/common/types.mjs";
18
20
  import { SyNs } from "../../../namespaces/sy/common/types.mjs";
@@ -21,7 +23,6 @@ import { TrackbackNs } from "../../../namespaces/trackback/common/types.mjs";
21
23
  import { WfwNs } from "../../../namespaces/wfw/common/types.mjs";
22
24
  import { XmlNs } from "../../../namespaces/xml/common/types.mjs";
23
25
  import { YtNs } from "../../../namespaces/yt/common/types.mjs";
24
- //#region src/feeds/atom/common/types.d.ts
25
26
  export declare namespace AtomFeed {
26
27
  type Text = {
27
28
  value: string;
@@ -86,24 +87,26 @@ export declare namespace AtomFeed {
86
87
  summary?: Text;
87
88
  title: Requirable<Text>;
88
89
  updated: Requirable<TDate>;
89
- app?: AppNs.Entry<TDate>;
90
- arxiv?: ArxivNs.Entry;
91
- cc?: CcNs.ItemOrFeed;
92
90
  dc?: DcNs.ItemOrFeed<TDate>;
91
+ dcterms?: DcTermsNs.ItemOrFeed<TDate>;
93
92
  slash?: SlashNs.Item;
94
93
  itunes?: ItunesNs.Item;
95
- googleplay?: GooglePlayNs.Item<TStrict>;
96
94
  psc?: PscNs.Item<TStrict>;
97
95
  media?: MediaNs.ItemOrFeed<TStrict>;
98
- georss?: GeoRssNs.ItemOrFeed<TStrict>;
99
- geo?: GeoNs.ItemOrFeed;
100
- thr?: ThrNs.Item<TStrict>;
101
- dcterms?: DcTermsNs.ItemOrFeed<TDate>;
96
+ googleplay?: GooglePlayNs.Item<TStrict>;
97
+ feedburner?: FeedBurnerNs.Item;
98
+ arxiv?: ArxivNs.Entry;
99
+ prism?: PrismNs.ItemOrFeed<TDate>;
100
+ cc?: CcNs.ItemOrFeed;
102
101
  creativeCommons?: CreativeCommonsNs.ItemOrFeed;
102
+ thr?: ThrNs.Item<TStrict>;
103
+ app?: AppNs.Entry<TDate>;
103
104
  wfw?: WfwNs.Item;
104
- yt?: YtNs.Item;
105
105
  pingback?: PingbackNs.Item;
106
106
  trackback?: TrackbackNs.Item;
107
+ yt?: YtNs.Item;
108
+ geo?: GeoNs.ItemOrFeed;
109
+ georss?: GeoRssNs.ItemOrFeed<TStrict>;
107
110
  xml?: XmlNs.ItemOrFeed;
108
111
  }, TStrict>;
109
112
  type Feed<TDate, TStrict extends boolean = false> = Strict<{
@@ -120,21 +123,22 @@ export declare namespace AtomFeed {
120
123
  title: Requirable<Text>;
121
124
  updated: Requirable<TDate>;
122
125
  entries?: Array<Entry<TDate, TStrict>>;
123
- cc?: CcNs.ItemOrFeed;
124
126
  dc?: DcNs.ItemOrFeed<TDate>;
127
+ dcterms?: DcTermsNs.ItemOrFeed<TDate>;
125
128
  sy?: SyNs.Feed<TDate>;
126
129
  itunes?: ItunesNs.Feed<TStrict>;
127
- googleplay?: GooglePlayNs.Feed<TStrict>;
128
130
  media?: MediaNs.ItemOrFeed<TStrict>;
129
- georss?: GeoRssNs.ItemOrFeed<TStrict>;
130
- geo?: GeoNs.ItemOrFeed;
131
- dcterms?: DcTermsNs.ItemOrFeed<TDate>;
132
- creativeCommons?: CreativeCommonsNs.ItemOrFeed;
131
+ googleplay?: GooglePlayNs.Feed<TStrict>;
132
+ feedburner?: FeedBurnerNs.Feed<TStrict>;
133
133
  opensearch?: OpenSearchNs.Feed<TStrict>;
134
- yt?: YtNs.Feed;
134
+ prism?: PrismNs.ItemOrFeed<TDate>;
135
+ cc?: CcNs.ItemOrFeed;
136
+ creativeCommons?: CreativeCommonsNs.ItemOrFeed;
135
137
  admin?: AdminNs.Feed;
136
138
  pingback?: PingbackNs.Feed;
139
+ yt?: YtNs.Feed;
140
+ geo?: GeoNs.ItemOrFeed;
141
+ georss?: GeoRssNs.ItemOrFeed<TStrict>;
137
142
  xml?: XmlNs.ItemOrFeed;
138
143
  }, TStrict>;
139
- }
140
- //#endregion
144
+ }
@@ -1,6 +1,6 @@
1
1
  const require_is = require("../../../node_modules/trousse/dist/is.cjs");
2
2
  const require_config = require("../../../common/config.cjs");
3
- //#region src/feeds/atom/detect/index.ts
3
+ // src/feeds/atom/detect/index.ts
4
4
  const feedElementRegex = /(?:^|[\s>])<(?:\w+:)?feed[\s>]/im;
5
5
  const atomElementsRegex = /(<(?:\w+:)?(entry|title|link|id|updated|summary)[\s>])/i;
6
6
  const detect = (value) => {
@@ -10,5 +10,4 @@ const detect = (value) => {
10
10
  const hasAtomElements = atomElementsRegex.test(value);
11
11
  return hasAtomNamespace || hasAtomElements;
12
12
  };
13
- //#endregion
14
13
  exports.detect = detect;
@@ -1,3 +1 @@
1
- //#region src/feeds/atom/detect/index.d.ts
2
- export declare const detect: (value: unknown) => value is string;
3
- //#endregion
1
+ export declare const detect: (value: unknown) => value is string;
@@ -1,3 +1 @@
1
- //#region src/feeds/atom/detect/index.d.ts
2
- export declare const detect: (value: unknown) => value is string;
3
- //#endregion
1
+ export declare const detect: (value: unknown) => value is string;
@@ -1,6 +1,6 @@
1
1
  import { isNonEmptyString } from "../../../node_modules/trousse/dist/is.mjs";
2
2
  import { namespaceUris } from "../../../common/config.mjs";
3
- //#region src/feeds/atom/detect/index.ts
3
+ // src/feeds/atom/detect/index.ts
4
4
  const feedElementRegex = /(?:^|[\s>])<(?:\w+:)?feed[\s>]/im;
5
5
  const atomElementsRegex = /(<(?:\w+:)?(entry|title|link|id|updated|summary)[\s>])/i;
6
6
  const detect = (value) => {
@@ -10,5 +10,4 @@ const detect = (value) => {
10
10
  const hasAtomElements = atomElementsRegex.test(value);
11
11
  return hasAtomNamespace || hasAtomElements;
12
12
  };
13
- //#endregion
14
13
  export { detect };
@@ -1,9 +1,8 @@
1
- const require_config = require("../../../namespaces/atom/common/config.cjs");
2
- const require_config$1 = require("../../../common/config.cjs");
3
- //#region src/feeds/atom/generate/config.ts
1
+ const require_config = require("../../../common/config.cjs");
2
+ const require_config$1 = require("../../../namespaces/atom/common/config.cjs");
3
+ // src/feeds/atom/generate/config.ts
4
4
  const builder = new (require("fast-xml-parser")).XMLBuilder({
5
- ...require_config$1.builderConfig,
6
- stopNodes: require_config.textConstructs.map((element) => `..${element}[type=xhtml]`)
5
+ ...require_config.builderConfig,
6
+ stopNodes: require_config$1.textConstructs.map((element) => `..${element}[type=xhtml]`)
7
7
  });
8
- //#endregion
9
8
  exports.builder = builder;