urlpurify 1.4.0 → 1.4.2

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 (271) hide show
  1. package/dist/clean.d.mts +6 -0
  2. package/dist/{clean.js → clean.mjs} +3 -4
  3. package/dist/defaults.d.mts +8 -0
  4. package/dist/defaults.mjs +76 -0
  5. package/dist/index.d.mts +88 -0
  6. package/dist/index.mjs +87 -0
  7. package/dist/node_modules/trousse/dist/is.mjs +6 -0
  8. package/dist/node_modules/trousse/dist/{matching.js → matching.mjs} +4 -2
  9. package/dist/node_modules/trousse/dist/urls.mjs +36 -0
  10. package/dist/tracking/literals.d.mts +3 -0
  11. package/dist/tracking/patterns.d.mts +3 -0
  12. package/dist/types.d.mts +9 -0
  13. package/dist/unwraps/aceml.d.mts +4 -0
  14. package/dist/unwraps/{aceml.js → aceml.mjs} +1 -1
  15. package/dist/unwraps/adjust.d.mts +4 -0
  16. package/dist/unwraps/{adjust.js → adjust.mjs} +2 -1
  17. package/dist/unwraps/amazonAffiliate.d.mts +4 -0
  18. package/dist/unwraps/ampCache.d.mts +4 -0
  19. package/dist/unwraps/{ampCache.js → ampCache.mjs} +1 -1
  20. package/dist/unwraps/anonymTo.d.mts +4 -0
  21. package/dist/unwraps/{anonymTo.js → anonymTo.mjs} +2 -1
  22. package/dist/unwraps/awin.d.mts +4 -0
  23. package/dist/unwraps/{awin.js → awin.mjs} +1 -1
  24. package/dist/unwraps/bing.d.mts +4 -0
  25. package/dist/unwraps/{bing.js → bing.mjs} +1 -1
  26. package/dist/unwraps/bsky.d.mts +4 -0
  27. package/dist/unwraps/{bsky.js → bsky.mjs} +1 -1
  28. package/dist/unwraps/cjNetwork.d.mts +4 -0
  29. package/dist/unwraps/{cjNetwork.js → cjNetwork.mjs} +1 -1
  30. package/dist/unwraps/csdn.d.mts +4 -0
  31. package/dist/unwraps/{csdn.js → csdn.mjs} +1 -1
  32. package/dist/unwraps/deviantartOutgoing.d.mts +4 -0
  33. package/dist/unwraps/{deviantartOutgoing.js → deviantartOutgoing.mjs} +2 -1
  34. package/dist/unwraps/digidip.d.mts +4 -0
  35. package/dist/unwraps/{digidip.js → digidip.mjs} +1 -1
  36. package/dist/unwraps/disqus.d.mts +4 -0
  37. package/dist/unwraps/{disqus.js → disqus.mjs} +1 -1
  38. package/dist/unwraps/douban.d.mts +4 -0
  39. package/dist/unwraps/{douban.js → douban.mjs} +1 -1
  40. package/dist/unwraps/duckduckgo.d.mts +4 -0
  41. package/dist/unwraps/{duckduckgo.js → duckduckgo.mjs} +1 -1
  42. package/dist/unwraps/ebayRover.d.mts +4 -0
  43. package/dist/unwraps/{ebayRover.js → ebayRover.mjs} +1 -1
  44. package/dist/unwraps/effiliation.d.mts +4 -0
  45. package/dist/unwraps/{effiliation.js → effiliation.mjs} +1 -1
  46. package/dist/unwraps/embedly.d.mts +4 -0
  47. package/dist/unwraps/{embedly.js → embedly.mjs} +1 -1
  48. package/dist/unwraps/facebook.d.mts +4 -0
  49. package/dist/unwraps/{facebook.js → facebook.mjs} +1 -1
  50. package/dist/unwraps/feedsportal.d.mts +4 -0
  51. package/dist/unwraps/firebaseDynamicLinks.d.mts +4 -0
  52. package/dist/unwraps/{firebaseDynamicLinks.js → firebaseDynamicLinks.mjs} +1 -1
  53. package/dist/unwraps/flipboard.d.mts +4 -0
  54. package/dist/unwraps/{flipboard.js → flipboard.mjs} +1 -1
  55. package/dist/unwraps/gateSc.d.mts +4 -0
  56. package/dist/unwraps/{gateSc.js → gateSc.mjs} +1 -1
  57. package/dist/unwraps/georiot.d.mts +4 -0
  58. package/dist/unwraps/{georiot.js → georiot.mjs} +1 -1
  59. package/dist/unwraps/gitee.d.mts +4 -0
  60. package/dist/unwraps/{gitee.js → gitee.mjs} +1 -1
  61. package/dist/unwraps/google.d.mts +4 -0
  62. package/dist/unwraps/{google.js → google.mjs} +1 -1
  63. package/dist/unwraps/googleAmpViewer.d.mts +4 -0
  64. package/dist/unwraps/googleNews.d.mts +4 -0
  65. package/dist/unwraps/{googleNews.js → googleNews.mjs} +1 -1
  66. package/dist/unwraps/googleNewsModern.d.mts +4 -0
  67. package/dist/unwraps/{googleNewsModern.js → googleNewsModern.mjs} +4 -3
  68. package/dist/unwraps/googleScholar.d.mts +4 -0
  69. package/dist/unwraps/{googleScholar.js → googleScholar.mjs} +1 -1
  70. package/dist/unwraps/googleTranslate.d.mts +4 -0
  71. package/dist/unwraps/{googleTranslate.js → googleTranslate.mjs} +1 -1
  72. package/dist/unwraps/hashnode.d.mts +4 -0
  73. package/dist/unwraps/{hashnode.js → hashnode.mjs} +1 -1
  74. package/dist/unwraps/hrefLi.d.mts +4 -0
  75. package/dist/unwraps/{hrefLi.js → hrefLi.mjs} +2 -1
  76. package/dist/unwraps/icptrack.d.mts +4 -0
  77. package/dist/unwraps/{icptrack.js → icptrack.mjs} +1 -1
  78. package/dist/unwraps/idealoPartner.d.mts +4 -0
  79. package/dist/unwraps/{idealoPartner.js → idealoPartner.mjs} +1 -1
  80. package/dist/unwraps/instagram.d.mts +4 -0
  81. package/dist/unwraps/{instagram.js → instagram.mjs} +1 -1
  82. package/dist/unwraps/jianshuGo.d.mts +4 -0
  83. package/dist/unwraps/{jianshuGo.js → jianshuGo.mjs} +1 -1
  84. package/dist/unwraps/juejin.d.mts +4 -0
  85. package/dist/unwraps/{juejin.js → juejin.mjs} +1 -1
  86. package/dist/unwraps/leverAnalytics.d.mts +4 -0
  87. package/dist/unwraps/{leverAnalytics.js → leverAnalytics.mjs} +1 -1
  88. package/dist/unwraps/linksynergy.d.mts +4 -0
  89. package/dist/unwraps/{linksynergy.js → linksynergy.mjs} +1 -1
  90. package/dist/unwraps/mailchimp.d.mts +4 -0
  91. package/dist/unwraps/{mailchimp.js → mailchimp.mjs} +1 -1
  92. package/dist/unwraps/mailpanion.d.mts +4 -0
  93. package/dist/unwraps/{mailpanion.js → mailpanion.mjs} +1 -1
  94. package/dist/unwraps/mailpgn.d.mts +4 -0
  95. package/dist/unwraps/{mailpgn.js → mailpgn.mjs} +1 -1
  96. package/dist/unwraps/mailtrack.d.mts +4 -0
  97. package/dist/unwraps/{mailtrack.js → mailtrack.mjs} +1 -1
  98. package/dist/unwraps/medium.d.mts +4 -0
  99. package/dist/unwraps/{medium.js → medium.mjs} +1 -1
  100. package/dist/unwraps/mimecast.d.mts +4 -0
  101. package/dist/unwraps/mozillaOutgoing.d.mts +4 -0
  102. package/dist/unwraps/mozillaOutgoing.mjs +12 -0
  103. package/dist/unwraps/narrativ.d.mts +4 -0
  104. package/dist/unwraps/{narrativ.js → narrativ.mjs} +1 -1
  105. package/dist/unwraps/naverOutgoing.d.mts +4 -0
  106. package/dist/unwraps/{naverOutgoing.js → naverOutgoing.mjs} +1 -1
  107. package/dist/unwraps/nicoMs.d.mts +4 -0
  108. package/dist/unwraps/{nicoMs.js → nicoMs.mjs} +2 -1
  109. package/dist/unwraps/outlookSafelinks.d.mts +4 -0
  110. package/dist/unwraps/{outlookSafelinks.js → outlookSafelinks.mjs} +1 -1
  111. package/dist/unwraps/partnerAds.d.mts +4 -0
  112. package/dist/unwraps/{partnerAds.js → partnerAds.mjs} +1 -1
  113. package/dist/unwraps/pocket.d.mts +4 -0
  114. package/dist/unwraps/{pocket.js → pocket.mjs} +1 -1
  115. package/dist/unwraps/postmark.d.mts +4 -0
  116. package/dist/unwraps/{postmark.js → postmark.mjs} +3 -4
  117. package/dist/unwraps/proofpointV1.d.mts +4 -0
  118. package/dist/unwraps/{proofpointV1.js → proofpointV1.mjs} +1 -1
  119. package/dist/unwraps/proofpointV2.d.mts +4 -0
  120. package/dist/unwraps/{proofpointV2.js → proofpointV2.mjs} +1 -1
  121. package/dist/unwraps/proofpointV3.d.mts +4 -0
  122. package/dist/unwraps/{proofpointV3.js → proofpointV3.mjs} +8 -7
  123. package/dist/unwraps/pxf.d.mts +4 -0
  124. package/dist/unwraps/{pxf.js → pxf.mjs} +1 -1
  125. package/dist/unwraps/recruitics.d.mts +4 -0
  126. package/dist/unwraps/{recruitics.js → recruitics.mjs} +1 -1
  127. package/dist/unwraps/redditOut.d.mts +4 -0
  128. package/dist/unwraps/{redditOut.js → redditOut.mjs} +1 -1
  129. package/dist/unwraps/redirectingat.d.mts +4 -0
  130. package/dist/unwraps/{redirectingat.js → redirectingat.mjs} +1 -1
  131. package/dist/unwraps/segmentfault.d.mts +4 -0
  132. package/dist/unwraps/{segmentfault.js → segmentfault.mjs} +1 -1
  133. package/dist/unwraps/shareasale.d.mts +4 -0
  134. package/dist/unwraps/{shareasale.js → shareasale.mjs} +1 -1
  135. package/dist/unwraps/sjv.d.mts +4 -0
  136. package/dist/unwraps/{sjv.js → sjv.mjs} +1 -1
  137. package/dist/unwraps/skimlinks.d.mts +4 -0
  138. package/dist/unwraps/{skimlinks.js → skimlinks.mjs} +1 -1
  139. package/dist/unwraps/slack.d.mts +4 -0
  140. package/dist/unwraps/{slack.js → slack.mjs} +1 -1
  141. package/dist/unwraps/smartredirect.d.mts +4 -0
  142. package/dist/unwraps/{smartredirect.js → smartredirect.mjs} +1 -1
  143. package/dist/unwraps/sspai.d.mts +4 -0
  144. package/dist/unwraps/{sspai.js → sspai.mjs} +1 -1
  145. package/dist/unwraps/steamLinkfilter.d.mts +4 -0
  146. package/dist/unwraps/{steamLinkfilter.js → steamLinkfilter.mjs} +1 -1
  147. package/dist/unwraps/telegramIv.d.mts +4 -0
  148. package/dist/unwraps/{telegramIv.js → telegramIv.mjs} +1 -1
  149. package/dist/unwraps/threads.d.mts +4 -0
  150. package/dist/unwraps/{threads.js → threads.mjs} +1 -1
  151. package/dist/unwraps/tradedoubler.d.mts +4 -0
  152. package/dist/unwraps/{tradedoubler.js → tradedoubler.mjs} +1 -1
  153. package/dist/unwraps/tumblr.d.mts +4 -0
  154. package/dist/unwraps/{tumblr.js → tumblr.mjs} +1 -1
  155. package/dist/unwraps/valuecommerce.d.mts +4 -0
  156. package/dist/unwraps/{valuecommerce.js → valuecommerce.mjs} +1 -1
  157. package/dist/unwraps/viglink.d.mts +4 -0
  158. package/dist/unwraps/{viglink.js → viglink.mjs} +1 -1
  159. package/dist/unwraps/vkAway.d.mts +4 -0
  160. package/dist/unwraps/{vkAway.js → vkAway.mjs} +1 -1
  161. package/dist/unwraps/webArchive.d.mts +4 -0
  162. package/dist/unwraps/{webArchive.js → webArchive.mjs} +3 -4
  163. package/dist/unwraps/yahooSearch.d.mts +4 -0
  164. package/dist/unwraps/{yahooSearch.js → yahooSearch.mjs} +3 -4
  165. package/dist/unwraps/yandexTurbo.d.mts +4 -0
  166. package/dist/unwraps/youtube.d.mts +4 -0
  167. package/dist/unwraps/{youtube.js → youtube.mjs} +1 -1
  168. package/dist/unwraps/zhihu.d.mts +4 -0
  169. package/dist/unwraps/{zhihu.js → zhihu.mjs} +1 -1
  170. package/dist/utils.d.mts +9 -0
  171. package/dist/{utils.js → utils.mjs} +5 -6
  172. package/package.json +11 -8
  173. package/dist/clean.d.ts +0 -8
  174. package/dist/defaults.d.ts +0 -9
  175. package/dist/defaults.js +0 -76
  176. package/dist/index.d.ts +0 -88
  177. package/dist/index.js +0 -87
  178. package/dist/node_modules/trousse/dist/urls.js +0 -20
  179. package/dist/tracking/literals.d.ts +0 -4
  180. package/dist/tracking/patterns.d.ts +0 -4
  181. package/dist/types.d.ts +0 -10
  182. package/dist/unwraps/aceml.d.ts +0 -6
  183. package/dist/unwraps/adjust.d.ts +0 -6
  184. package/dist/unwraps/amazonAffiliate.d.ts +0 -6
  185. package/dist/unwraps/ampCache.d.ts +0 -6
  186. package/dist/unwraps/anonymTo.d.ts +0 -6
  187. package/dist/unwraps/awin.d.ts +0 -6
  188. package/dist/unwraps/bing.d.ts +0 -6
  189. package/dist/unwraps/bsky.d.ts +0 -6
  190. package/dist/unwraps/cjNetwork.d.ts +0 -6
  191. package/dist/unwraps/csdn.d.ts +0 -6
  192. package/dist/unwraps/deviantartOutgoing.d.ts +0 -6
  193. package/dist/unwraps/digidip.d.ts +0 -6
  194. package/dist/unwraps/disqus.d.ts +0 -6
  195. package/dist/unwraps/douban.d.ts +0 -6
  196. package/dist/unwraps/duckduckgo.d.ts +0 -6
  197. package/dist/unwraps/ebayRover.d.ts +0 -6
  198. package/dist/unwraps/effiliation.d.ts +0 -6
  199. package/dist/unwraps/embedly.d.ts +0 -6
  200. package/dist/unwraps/facebook.d.ts +0 -6
  201. package/dist/unwraps/feedsportal.d.ts +0 -6
  202. package/dist/unwraps/firebaseDynamicLinks.d.ts +0 -6
  203. package/dist/unwraps/flipboard.d.ts +0 -6
  204. package/dist/unwraps/gateSc.d.ts +0 -6
  205. package/dist/unwraps/georiot.d.ts +0 -6
  206. package/dist/unwraps/gitee.d.ts +0 -6
  207. package/dist/unwraps/google.d.ts +0 -6
  208. package/dist/unwraps/googleAmpViewer.d.ts +0 -6
  209. package/dist/unwraps/googleNews.d.ts +0 -6
  210. package/dist/unwraps/googleNewsModern.d.ts +0 -6
  211. package/dist/unwraps/googleScholar.d.ts +0 -6
  212. package/dist/unwraps/googleTranslate.d.ts +0 -6
  213. package/dist/unwraps/hashnode.d.ts +0 -6
  214. package/dist/unwraps/hrefLi.d.ts +0 -6
  215. package/dist/unwraps/icptrack.d.ts +0 -6
  216. package/dist/unwraps/idealoPartner.d.ts +0 -6
  217. package/dist/unwraps/instagram.d.ts +0 -6
  218. package/dist/unwraps/jianshuGo.d.ts +0 -6
  219. package/dist/unwraps/juejin.d.ts +0 -6
  220. package/dist/unwraps/leverAnalytics.d.ts +0 -6
  221. package/dist/unwraps/linksynergy.d.ts +0 -6
  222. package/dist/unwraps/mailchimp.d.ts +0 -6
  223. package/dist/unwraps/mailpanion.d.ts +0 -6
  224. package/dist/unwraps/mailpgn.d.ts +0 -6
  225. package/dist/unwraps/mailtrack.d.ts +0 -6
  226. package/dist/unwraps/medium.d.ts +0 -6
  227. package/dist/unwraps/mimecast.d.ts +0 -6
  228. package/dist/unwraps/mozillaOutgoing.d.ts +0 -6
  229. package/dist/unwraps/mozillaOutgoing.js +0 -13
  230. package/dist/unwraps/narrativ.d.ts +0 -6
  231. package/dist/unwraps/naverOutgoing.d.ts +0 -6
  232. package/dist/unwraps/nicoMs.d.ts +0 -6
  233. package/dist/unwraps/outlookSafelinks.d.ts +0 -6
  234. package/dist/unwraps/partnerAds.d.ts +0 -6
  235. package/dist/unwraps/pocket.d.ts +0 -6
  236. package/dist/unwraps/postmark.d.ts +0 -6
  237. package/dist/unwraps/proofpointV1.d.ts +0 -6
  238. package/dist/unwraps/proofpointV2.d.ts +0 -6
  239. package/dist/unwraps/proofpointV3.d.ts +0 -6
  240. package/dist/unwraps/pxf.d.ts +0 -6
  241. package/dist/unwraps/recruitics.d.ts +0 -6
  242. package/dist/unwraps/redditOut.d.ts +0 -6
  243. package/dist/unwraps/redirectingat.d.ts +0 -6
  244. package/dist/unwraps/segmentfault.d.ts +0 -6
  245. package/dist/unwraps/shareasale.d.ts +0 -6
  246. package/dist/unwraps/sjv.d.ts +0 -6
  247. package/dist/unwraps/skimlinks.d.ts +0 -6
  248. package/dist/unwraps/slack.d.ts +0 -6
  249. package/dist/unwraps/smartredirect.d.ts +0 -6
  250. package/dist/unwraps/sspai.d.ts +0 -6
  251. package/dist/unwraps/steamLinkfilter.d.ts +0 -6
  252. package/dist/unwraps/telegramIv.d.ts +0 -6
  253. package/dist/unwraps/threads.d.ts +0 -6
  254. package/dist/unwraps/tradedoubler.d.ts +0 -6
  255. package/dist/unwraps/tumblr.d.ts +0 -6
  256. package/dist/unwraps/valuecommerce.d.ts +0 -6
  257. package/dist/unwraps/viglink.d.ts +0 -6
  258. package/dist/unwraps/vkAway.d.ts +0 -6
  259. package/dist/unwraps/webArchive.d.ts +0 -6
  260. package/dist/unwraps/yahooSearch.d.ts +0 -6
  261. package/dist/unwraps/yandexTurbo.d.ts +0 -6
  262. package/dist/unwraps/youtube.d.ts +0 -6
  263. package/dist/unwraps/zhihu.d.ts +0 -6
  264. package/dist/utils.d.ts +0 -11
  265. /package/dist/tracking/{literals.js → literals.mjs} +0 -0
  266. /package/dist/tracking/{patterns.js → patterns.mjs} +0 -0
  267. /package/dist/unwraps/{amazonAffiliate.js → amazonAffiliate.mjs} +0 -0
  268. /package/dist/unwraps/{feedsportal.js → feedsportal.mjs} +0 -0
  269. /package/dist/unwraps/{googleAmpViewer.js → googleAmpViewer.mjs} +0 -0
  270. /package/dist/unwraps/{mimecast.js → mimecast.mjs} +0 -0
  271. /package/dist/unwraps/{yandexTurbo.js → yandexTurbo.mjs} +0 -0
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/facebook.d.ts
3
+ export declare const unwrapFacebookShim: UrlUnwrapper;
4
+ //#endregion
@@ -1,4 +1,4 @@
1
- import { createParamExtractor } from "../utils.js";
1
+ import { createParamExtractor } from "../utils.mjs";
2
2
  //#region src/unwraps/facebook.ts
3
3
  const unwrapFacebookShim = createParamExtractor({
4
4
  hosts: [
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/feedsportal.d.ts
3
+ export declare const unwrapFeedsportal: UrlUnwrapper;
4
+ //#endregion
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/firebaseDynamicLinks.d.ts
3
+ export declare const unwrapFirebaseDynamicLinks: UrlUnwrapper;
4
+ //#endregion
@@ -1,4 +1,4 @@
1
- import { createParamExtractor } from "../utils.js";
1
+ import { createParamExtractor } from "../utils.mjs";
2
2
  //#region src/unwraps/firebaseDynamicLinks.ts
3
3
  const unwrapFirebaseDynamicLinks = createParamExtractor({
4
4
  hosts: /\.page\.link$/,
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/flipboard.d.ts
3
+ export declare const unwrapFlipboard: UrlUnwrapper;
4
+ //#endregion
@@ -1,4 +1,4 @@
1
- import { createParamExtractor } from "../utils.js";
1
+ import { createParamExtractor } from "../utils.mjs";
2
2
  //#region src/unwraps/flipboard.ts
3
3
  const unwrapFlipboard = createParamExtractor({
4
4
  hosts: "flipboard.com",
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/gateSc.d.ts
3
+ export declare const unwrapGateSc: UrlUnwrapper;
4
+ //#endregion
@@ -1,4 +1,4 @@
1
- import { createParamExtractor } from "../utils.js";
1
+ import { createParamExtractor } from "../utils.mjs";
2
2
  //#region src/unwraps/gateSc.ts
3
3
  const unwrapGateSc = createParamExtractor({
4
4
  hosts: "gate.sc",
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/georiot.d.ts
3
+ export declare const unwrapGeoriot: UrlUnwrapper;
4
+ //#endregion
@@ -1,4 +1,4 @@
1
- import { createParamExtractor } from "../utils.js";
1
+ import { createParamExtractor } from "../utils.mjs";
2
2
  //#region src/unwraps/georiot.ts
3
3
  const unwrapGeoriot = createParamExtractor({
4
4
  hosts: "target.georiot.com",
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/gitee.d.ts
3
+ export declare const unwrapGitee: UrlUnwrapper;
4
+ //#endregion
@@ -1,4 +1,4 @@
1
- import { createParamExtractor } from "../utils.js";
1
+ import { createParamExtractor } from "../utils.mjs";
2
2
  //#region src/unwraps/gitee.ts
3
3
  const unwrapGitee = createParamExtractor({
4
4
  hosts: "gitee.com",
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/google.d.ts
3
+ export declare const unwrapGoogle: UrlUnwrapper;
4
+ //#endregion
@@ -1,4 +1,4 @@
1
- import { createParamExtractor } from "../utils.js";
1
+ import { createParamExtractor } from "../utils.mjs";
2
2
  const unwrapGoogle = createParamExtractor({
3
3
  hosts: /^(?:[a-z0-9-]+\.)*google\.(?:com|[a-z]{2,3}(?:\.[a-z]{2,3})?)$/,
4
4
  path: "/url",
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/googleAmpViewer.d.ts
3
+ export declare const unwrapGoogleAmpViewer: UrlUnwrapper;
4
+ //#endregion
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/googleNews.d.ts
3
+ export declare const unwrapGoogleNews: UrlUnwrapper;
4
+ //#endregion
@@ -1,4 +1,4 @@
1
- import { createParamExtractor } from "../utils.js";
1
+ import { createParamExtractor } from "../utils.mjs";
2
2
  const unwrapGoogleNews = createParamExtractor({
3
3
  hosts: /^news\.google\.(?:com|[a-z]{2,3}(?:\.[a-z]{2,3})?)$/,
4
4
  path: "/news/url",
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/googleNewsModern.d.ts
3
+ export declare const unwrapGoogleNewsModern: UrlUnwrapper;
4
+ //#endregion
@@ -1,5 +1,5 @@
1
- import { isHostOf } from "../node_modules/trousse/dist/urls.js";
2
- import { decodeBase64Binary } from "../utils.js";
1
+ import { isHostOf } from "../node_modules/trousse/dist/urls.mjs";
2
+ import { decodeBase64Binary } from "../utils.mjs";
3
3
  //#region src/unwraps/googleNewsModern.ts
4
4
  const articleIdRegex = /^\/(?:rss\/)?articles\/([\w-]+)/;
5
5
  const base64UrlMinusRegex = /-/g;
@@ -9,7 +9,8 @@ const unwrapGoogleNewsModern = (url) => {
9
9
  if (!isHostOf(url, "news.google.com")) return;
10
10
  const match = url.pathname.match(articleIdRegex);
11
11
  if (!match) return;
12
- return (decodeBase64Binary(match[1].replace(base64UrlMinusRegex, "+").replace(base64UrlUnderscoreRegex, "/"))?.match(protobufFramingRegex))?.[1];
12
+ const padded = match[1].replace(base64UrlMinusRegex, "+").replace(base64UrlUnderscoreRegex, "/");
13
+ return (decodeBase64Binary(padded)?.match(protobufFramingRegex))?.[1];
13
14
  };
14
15
  //#endregion
15
16
  export { unwrapGoogleNewsModern };
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/googleScholar.d.ts
3
+ export declare const unwrapGoogleScholar: UrlUnwrapper;
4
+ //#endregion
@@ -1,4 +1,4 @@
1
- import { createParamExtractor } from "../utils.js";
1
+ import { createParamExtractor } from "../utils.mjs";
2
2
  const unwrapGoogleScholar = createParamExtractor({
3
3
  hosts: /^scholar\.google\.(?:com|[a-z]{2,3}(?:\.[a-z]{2,3})?)$/,
4
4
  path: "/scholar_url",
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/googleTranslate.d.ts
3
+ export declare const unwrapGoogleTranslate: UrlUnwrapper;
4
+ //#endregion
@@ -1,4 +1,4 @@
1
- import { createParamExtractor } from "../utils.js";
1
+ import { createParamExtractor } from "../utils.mjs";
2
2
  const unwrapGoogleTranslate = createParamExtractor({
3
3
  hosts: /^translate\.google\.(?:com|[a-z]{2,3}(?:\.[a-z]{2,3})?)$/,
4
4
  path: "/translate",
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/hashnode.d.ts
3
+ export declare const unwrapHashnode: UrlUnwrapper;
4
+ //#endregion
@@ -1,4 +1,4 @@
1
- import { createParamExtractor } from "../utils.js";
1
+ import { createParamExtractor } from "../utils.mjs";
2
2
  //#region src/unwraps/hashnode.ts
3
3
  const unwrapHashnode = createParamExtractor({
4
4
  hosts: "hashnode.com",
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/hrefLi.d.ts
3
+ export declare const unwrapHrefLi: UrlUnwrapper;
4
+ //#endregion
@@ -1,6 +1,7 @@
1
+ import { isHostOf } from "../node_modules/trousse/dist/urls.mjs";
1
2
  //#region src/unwraps/hrefLi.ts
2
3
  const unwrapHrefLi = (url) => {
3
- if (url.hostname !== "href.li" && url.hostname !== "www.href.li") return;
4
+ if (!isHostOf(url, ["href.li", "www.href.li"])) return;
4
5
  return url.search.slice(1) || void 0;
5
6
  };
6
7
  //#endregion
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/icptrack.d.ts
3
+ export declare const unwrapIcptrack: UrlUnwrapper;
4
+ //#endregion
@@ -1,4 +1,4 @@
1
- import { createParamExtractor } from "../utils.js";
1
+ import { createParamExtractor } from "../utils.mjs";
2
2
  //#region src/unwraps/icptrack.ts
3
3
  const unwrapIcptrack = createParamExtractor({
4
4
  hosts: "click.icptrack.com",
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/idealoPartner.d.ts
3
+ export declare const unwrapIdealoPartner: UrlUnwrapper;
4
+ //#endregion
@@ -1,4 +1,4 @@
1
- import { createParamExtractor } from "../utils.js";
1
+ import { createParamExtractor } from "../utils.mjs";
2
2
  //#region src/unwraps/idealoPartner.ts
3
3
  const unwrapIdealoPartner = createParamExtractor({
4
4
  hosts: /\.idealo-partner\.com$/,
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/instagram.d.ts
3
+ export declare const unwrapInstagramShim: UrlUnwrapper;
4
+ //#endregion
@@ -1,4 +1,4 @@
1
- import { createParamExtractor } from "../utils.js";
1
+ import { createParamExtractor } from "../utils.mjs";
2
2
  //#region src/unwraps/instagram.ts
3
3
  const unwrapInstagramShim = createParamExtractor({
4
4
  hosts: ["l.instagram.com", "lm.instagram.com"],
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/jianshuGo.d.ts
3
+ export declare const unwrapJianshuGo: UrlUnwrapper;
4
+ //#endregion
@@ -1,4 +1,4 @@
1
- import { createParamExtractor } from "../utils.js";
1
+ import { createParamExtractor } from "../utils.mjs";
2
2
  //#region src/unwraps/jianshuGo.ts
3
3
  const unwrapJianshuGo = createParamExtractor({
4
4
  hosts: "links.jianshu.com",
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/juejin.d.ts
3
+ export declare const unwrapJuejin: UrlUnwrapper;
4
+ //#endregion
@@ -1,4 +1,4 @@
1
- import { createParamExtractor } from "../utils.js";
1
+ import { createParamExtractor } from "../utils.mjs";
2
2
  //#region src/unwraps/juejin.ts
3
3
  const unwrapJuejin = createParamExtractor({
4
4
  hosts: "link.juejin.cn",
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/leverAnalytics.d.ts
3
+ export declare const unwrapLeverAnalytics: UrlUnwrapper;
4
+ //#endregion
@@ -1,4 +1,4 @@
1
- import { createParamExtractor } from "../utils.js";
1
+ import { createParamExtractor } from "../utils.mjs";
2
2
  //#region src/unwraps/leverAnalytics.ts
3
3
  const unwrapLeverAnalytics = createParamExtractor({
4
4
  hosts: "t.lever-analytics.com",
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/linksynergy.d.ts
3
+ export declare const unwrapLinksynergy: UrlUnwrapper;
4
+ //#endregion
@@ -1,4 +1,4 @@
1
- import { createParamExtractor } from "../utils.js";
1
+ import { createParamExtractor } from "../utils.mjs";
2
2
  //#region src/unwraps/linksynergy.ts
3
3
  const unwrapLinksynergy = createParamExtractor({
4
4
  hosts: "click.linksynergy.com",
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/mailchimp.d.ts
3
+ export declare const unwrapMailchimp: UrlUnwrapper;
4
+ //#endregion
@@ -1,4 +1,4 @@
1
- import { createParamExtractor } from "../utils.js";
1
+ import { createParamExtractor } from "../utils.mjs";
2
2
  //#region src/unwraps/mailchimp.ts
3
3
  const unwrapMailchimp = createParamExtractor({
4
4
  hosts: /\.mailchimp\.com$/,
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/mailpanion.d.ts
3
+ export declare const unwrapMailpanion: UrlUnwrapper;
4
+ //#endregion
@@ -1,4 +1,4 @@
1
- import { createParamExtractor } from "../utils.js";
1
+ import { createParamExtractor } from "../utils.mjs";
2
2
  //#region src/unwraps/mailpanion.ts
3
3
  const unwrapMailpanion = createParamExtractor({
4
4
  hosts: "mailpanion.com",
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/mailpgn.d.ts
3
+ export declare const unwrapMailpgn: UrlUnwrapper;
4
+ //#endregion
@@ -1,4 +1,4 @@
1
- import { createParamExtractor } from "../utils.js";
1
+ import { createParamExtractor } from "../utils.mjs";
2
2
  //#region src/unwraps/mailpgn.ts
3
3
  const unwrapMailpgn = createParamExtractor({
4
4
  hosts: "t.mailpgn.com",
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/mailtrack.d.ts
3
+ export declare const unwrapMailtrack: UrlUnwrapper;
4
+ //#endregion
@@ -1,4 +1,4 @@
1
- import { createParamExtractor } from "../utils.js";
1
+ import { createParamExtractor } from "../utils.mjs";
2
2
  //#region src/unwraps/mailtrack.ts
3
3
  const unwrapMailtrack = createParamExtractor({
4
4
  hosts: "mailtrack.io",
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/medium.d.ts
3
+ export declare const unwrapMedium: UrlUnwrapper;
4
+ //#endregion
@@ -1,4 +1,4 @@
1
- import { createParamExtractor } from "../utils.js";
1
+ import { createParamExtractor } from "../utils.mjs";
2
2
  //#region src/unwraps/medium.ts
3
3
  const unwrapMedium = createParamExtractor({
4
4
  hosts: "medium.com",
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/mimecast.d.ts
3
+ export declare const unwrapMimecast: UrlUnwrapper;
4
+ //#endregion
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/mozillaOutgoing.d.ts
3
+ export declare const unwrapMozillaOutgoing: UrlUnwrapper;
4
+ //#endregion
@@ -0,0 +1,12 @@
1
+ import { decodeSegment, isHostOf } from "../node_modules/trousse/dist/urls.mjs";
2
+ //#region src/unwraps/mozillaOutgoing.ts
3
+ const pathRegex = /^\/v1\/[0-9a-f]{64}\/(.+)$/;
4
+ const mozillaOutgoingHosts = ["outgoing.prod.mozaws.net", "prod.outgoing.prod.webservices.mozgcp.net"];
5
+ const unwrapMozillaOutgoing = (url) => {
6
+ if (!isHostOf(url, mozillaOutgoingHosts)) return;
7
+ const match = url.pathname.match(pathRegex);
8
+ if (!match) return;
9
+ return decodeSegment(match[1]);
10
+ };
11
+ //#endregion
12
+ export { unwrapMozillaOutgoing };
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/narrativ.d.ts
3
+ export declare const unwrapNarrativ: UrlUnwrapper;
4
+ //#endregion
@@ -1,4 +1,4 @@
1
- import { createParamExtractor } from "../utils.js";
1
+ import { createParamExtractor } from "../utils.mjs";
2
2
  //#region src/unwraps/narrativ.ts
3
3
  const unwrapNarrativ = createParamExtractor({
4
4
  hosts: ["narrativ.com", "api.narrativ.com"],
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/naverOutgoing.d.ts
3
+ export declare const unwrapNaverOutgoing: UrlUnwrapper;
4
+ //#endregion
@@ -1,4 +1,4 @@
1
- import { createParamExtractor } from "../utils.js";
1
+ import { createParamExtractor } from "../utils.mjs";
2
2
  //#region src/unwraps/naverOutgoing.ts
3
3
  const unwrapNaverOutgoing = createParamExtractor({
4
4
  hosts: "cc.loginfra.com",
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/nicoMs.d.ts
3
+ export declare const unwrapNicoMs: UrlUnwrapper;
4
+ //#endregion
@@ -1,7 +1,8 @@
1
+ import { isHostOf } from "../node_modules/trousse/dist/urls.mjs";
1
2
  //#region src/unwraps/nicoMs.ts
2
3
  const nicoMsRegex = /^\/((?:sm|nm|so|im)\w+)$/;
3
4
  const unwrapNicoMs = (url) => {
4
- if (url.hostname !== "nico.ms") return;
5
+ if (!isHostOf(url, "nico.ms")) return;
5
6
  const match = url.pathname.match(nicoMsRegex);
6
7
  if (!match) return;
7
8
  const id = match[1];
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/outlookSafelinks.d.ts
3
+ export declare const unwrapOutlookSafelinks: UrlUnwrapper;
4
+ //#endregion
@@ -1,4 +1,4 @@
1
- import { createParamExtractor } from "../utils.js";
1
+ import { createParamExtractor } from "../utils.mjs";
2
2
  //#region src/unwraps/outlookSafelinks.ts
3
3
  const unwrapOutlookSafelinks = createParamExtractor({
4
4
  hosts: /\.safelinks\.protection\.outlook\.com$/,
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/partnerAds.d.ts
3
+ export declare const unwrapPartnerAds: UrlUnwrapper;
4
+ //#endregion
@@ -1,4 +1,4 @@
1
- import { createParamExtractor } from "../utils.js";
1
+ import { createParamExtractor } from "../utils.mjs";
2
2
  //#region src/unwraps/partnerAds.ts
3
3
  const unwrapPartnerAds = createParamExtractor({
4
4
  hosts: /\.partner-ads\.com$/,
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/pocket.d.ts
3
+ export declare const unwrapPocket: UrlUnwrapper;
4
+ //#endregion
@@ -1,4 +1,4 @@
1
- import { createParamExtractor } from "../utils.js";
1
+ import { createParamExtractor } from "../utils.mjs";
2
2
  //#region src/unwraps/pocket.ts
3
3
  const unwrapPocket = createParamExtractor({
4
4
  hosts: "getpocket.com",
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/postmark.d.ts
3
+ export declare const unwrapPostmark: UrlUnwrapper;
4
+ //#endregion
@@ -1,12 +1,11 @@
1
+ import { decodeSegment, isHostOf } from "../node_modules/trousse/dist/urls.mjs";
1
2
  //#region src/unwraps/postmark.ts
2
3
  const postmarkPathRegex = /^\/[23][st]\/([^/]+)\//;
3
4
  const unwrapPostmark = (url) => {
4
- if (url.hostname !== "click.pstmrk.it") return;
5
+ if (!isHostOf(url, "click.pstmrk.it")) return;
5
6
  const match = url.pathname.match(postmarkPathRegex);
6
7
  if (!match) return;
7
- try {
8
- return decodeURIComponent(match[1]);
9
- } catch {}
8
+ return decodeSegment(match[1]);
10
9
  };
11
10
  //#endregion
12
11
  export { unwrapPostmark };
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/proofpointV1.d.ts
3
+ export declare const unwrapProofpointV1: UrlUnwrapper;
4
+ //#endregion
@@ -1,4 +1,4 @@
1
- import { createParamExtractor } from "../utils.js";
1
+ import { createParamExtractor } from "../utils.mjs";
2
2
  //#region src/unwraps/proofpointV1.ts
3
3
  const baseExtractor = createParamExtractor({
4
4
  hosts: "urldefense.proofpoint.com",
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/proofpointV2.d.ts
3
+ export declare const unwrapProofpointV2: UrlUnwrapper;
4
+ //#endregion
@@ -1,4 +1,4 @@
1
- import { createParamExtractor } from "../utils.js";
1
+ import { createParamExtractor } from "../utils.mjs";
2
2
  //#region src/unwraps/proofpointV2.ts
3
3
  const baseExtractor = createParamExtractor({
4
4
  hosts: "urldefense.proofpoint.com",
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/proofpointV3.d.ts
3
+ export declare const unwrapProofpointV3: UrlUnwrapper;
4
+ //#endregion
@@ -1,11 +1,12 @@
1
- import { decodeBase64Url, getUtf8ByteLength } from "../utils.js";
1
+ import { isHostOf } from "../node_modules/trousse/dist/urls.mjs";
2
+ import { decodeBase64Url, getUtf8ByteLength } from "../utils.mjs";
2
3
  //#region src/unwraps/proofpointV3.ts
3
4
  const v3PathRegex = /^\/v3\/__(.+)__;([^!]*)!/;
4
- const v3HostSet = new Set([
5
+ const v3Hosts = [
5
6
  "urldefense.com",
6
7
  "urldefense.proofpoint.com",
7
8
  "urldefense.us"
8
- ]);
9
+ ];
9
10
  const runLengthMap = (() => {
10
11
  const map = {};
11
12
  const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
@@ -19,11 +20,11 @@ const decodeReplacements = (mangled, replacementBase64) => {
19
20
  const replacementChars = Array.from(replacement);
20
21
  const urlChars = Array.from(mangled);
21
22
  const result = [];
22
- const matcher = /(?<!\*)\*(?!\*)|\*{2}[A-Za-z0-9\-_]/g;
23
+ const markerRegex = /(?<!\*)\*(?!\*)|\*{2}[A-Za-z0-9\-_]/g;
23
24
  let lastIndex = 0;
24
25
  let savedBytes = 0;
25
26
  let match;
26
- match = matcher.exec(mangled);
27
+ match = markerRegex.exec(mangled);
27
28
  while (match !== null) {
28
29
  const startChar = positionInChars(mangled, match.index);
29
30
  const endChar = positionInChars(mangled, match.index + match[0].length);
@@ -53,7 +54,7 @@ const decodeReplacements = (mangled, replacementBase64) => {
53
54
  }
54
55
  }
55
56
  lastIndex = endChar;
56
- match = matcher.exec(mangled);
57
+ match = markerRegex.exec(mangled);
57
58
  }
58
59
  for (let charIndex = lastIndex; charIndex < urlChars.length; charIndex += 1) result.push(urlChars[charIndex]);
59
60
  return result.join("");
@@ -69,7 +70,7 @@ const positionInChars = (source, codeUnitIndex) => {
69
70
  return charIndex;
70
71
  };
71
72
  const unwrapProofpointV3 = (url) => {
72
- if (!v3HostSet.has(url.hostname)) return;
73
+ if (!isHostOf(url, v3Hosts)) return;
73
74
  const match = `${url.pathname}${url.search}`.match(v3PathRegex);
74
75
  if (!match) return;
75
76
  return decodeReplacements(match[1], match[2]);
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/pxf.d.ts
3
+ export declare const unwrapPxf: UrlUnwrapper;
4
+ //#endregion
@@ -1,4 +1,4 @@
1
- import { createParamExtractor } from "../utils.js";
1
+ import { createParamExtractor } from "../utils.mjs";
2
2
  //#region src/unwraps/pxf.ts
3
3
  const unwrapPxf = createParamExtractor({
4
4
  hosts: /\.pxf\.io$/,
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/recruitics.d.ts
3
+ export declare const unwrapRecruitics: UrlUnwrapper;
4
+ //#endregion
@@ -1,4 +1,4 @@
1
- import { createParamExtractor } from "../utils.js";
1
+ import { createParamExtractor } from "../utils.mjs";
2
2
  //#region src/unwraps/recruitics.ts
3
3
  const unwrapRecruitics = createParamExtractor({
4
4
  hosts: "jsv3.recruitics.com",
@@ -0,0 +1,4 @@
1
+ import { UrlUnwrapper } from "../types.mjs";
2
+ //#region src/unwraps/redditOut.d.ts
3
+ export declare const unwrapRedditOut: UrlUnwrapper;
4
+ //#endregion