feedcanon 2.0.0-beta.1 → 2.0.0-beta.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.
- package/dist/defaults.d.ts +1 -2
- package/dist/defaults.js +3 -156
- package/dist/exports.d.ts +2 -2
- package/dist/exports.js +2 -2
- package/dist/index.js +3 -2
- package/package.json +5 -3
package/dist/defaults.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { DefaultParserResult, FetchFn, NormalizeOptions, ParserAdapter, Tier } from "./types.js";
|
|
2
2
|
|
|
3
3
|
//#region src/defaults.d.ts
|
|
4
|
-
declare const defaultStrippedParams: string[];
|
|
5
4
|
declare const defaultNormalizeOptions: NormalizeOptions;
|
|
6
5
|
declare const defaultFetch: FetchFn;
|
|
7
6
|
declare const defaultParser: ParserAdapter<DefaultParserResult>;
|
|
8
7
|
declare const defaultTiers: Array<Tier>;
|
|
9
8
|
//#endregion
|
|
10
|
-
export { defaultFetch, defaultNormalizeOptions, defaultParser,
|
|
9
|
+
export { defaultFetch, defaultNormalizeOptions, defaultParser, defaultTiers };
|
package/dist/defaults.js
CHANGED
|
@@ -1,160 +1,7 @@
|
|
|
1
1
|
import { createSignature, neutralizeUrls } from "./utils.js";
|
|
2
2
|
import { parseFeed } from "feedsmith";
|
|
3
|
+
import { defaultTrackingParams } from "urlpurify";
|
|
3
4
|
//#region src/defaults.ts
|
|
4
|
-
const defaultStrippedParams = [
|
|
5
|
-
"utm_source",
|
|
6
|
-
"utm_medium",
|
|
7
|
-
"utm_campaign",
|
|
8
|
-
"utm_term",
|
|
9
|
-
"utm_content",
|
|
10
|
-
"utm_reader",
|
|
11
|
-
"utm_name",
|
|
12
|
-
"utm_cid",
|
|
13
|
-
"utm_viz_id",
|
|
14
|
-
"gclid",
|
|
15
|
-
"dclid",
|
|
16
|
-
"gbraid",
|
|
17
|
-
"wbraid",
|
|
18
|
-
"gclsrc",
|
|
19
|
-
"gad_source",
|
|
20
|
-
"gad_campaignid",
|
|
21
|
-
"srsltid",
|
|
22
|
-
"fbclid",
|
|
23
|
-
"fb_action_ids",
|
|
24
|
-
"fb_action_types",
|
|
25
|
-
"fb_source",
|
|
26
|
-
"fb_ref",
|
|
27
|
-
"_ga",
|
|
28
|
-
"_gl",
|
|
29
|
-
"_bk",
|
|
30
|
-
"_ke",
|
|
31
|
-
"mc_cid",
|
|
32
|
-
"mc_eid",
|
|
33
|
-
"mc_tc",
|
|
34
|
-
"mkt_tok",
|
|
35
|
-
"msclkid",
|
|
36
|
-
"twclid",
|
|
37
|
-
"ttclid",
|
|
38
|
-
"igshid",
|
|
39
|
-
"mtm_campaign",
|
|
40
|
-
"mtm_cid",
|
|
41
|
-
"mtm_content",
|
|
42
|
-
"mtm_group",
|
|
43
|
-
"mtm_keyword",
|
|
44
|
-
"mtm_medium",
|
|
45
|
-
"mtm_placement",
|
|
46
|
-
"mtm_source",
|
|
47
|
-
"pk_campaign",
|
|
48
|
-
"pk_cid",
|
|
49
|
-
"pk_content",
|
|
50
|
-
"pk_keyword",
|
|
51
|
-
"pk_medium",
|
|
52
|
-
"pk_source",
|
|
53
|
-
"ncid",
|
|
54
|
-
"sr_share",
|
|
55
|
-
"hsa_acc",
|
|
56
|
-
"hsa_ad",
|
|
57
|
-
"hsa_cam",
|
|
58
|
-
"hsa_grp",
|
|
59
|
-
"hsa_kw",
|
|
60
|
-
"hsa_mt",
|
|
61
|
-
"hsa_net",
|
|
62
|
-
"hsa_src",
|
|
63
|
-
"hsa_tgt",
|
|
64
|
-
"hsa_ver",
|
|
65
|
-
"hsCtaTracking",
|
|
66
|
-
"_hsenc",
|
|
67
|
-
"_hsmi",
|
|
68
|
-
"__hstc",
|
|
69
|
-
"__hsfp",
|
|
70
|
-
"__hssc",
|
|
71
|
-
"cid",
|
|
72
|
-
"s_kwcid",
|
|
73
|
-
"sc_cid",
|
|
74
|
-
"ef_id",
|
|
75
|
-
"obOrigUrl",
|
|
76
|
-
"dicbo",
|
|
77
|
-
"yclid",
|
|
78
|
-
"ysclid",
|
|
79
|
-
"_openstat",
|
|
80
|
-
"awinaffid",
|
|
81
|
-
"awinmid",
|
|
82
|
-
"clickref",
|
|
83
|
-
"afftrack",
|
|
84
|
-
"itm_source",
|
|
85
|
-
"itm_medium",
|
|
86
|
-
"itm_campaign",
|
|
87
|
-
"itm_content",
|
|
88
|
-
"itm_channel",
|
|
89
|
-
"itm_audience",
|
|
90
|
-
"int_source",
|
|
91
|
-
"int_medium",
|
|
92
|
-
"int_campaign",
|
|
93
|
-
"int_content",
|
|
94
|
-
"int_placement",
|
|
95
|
-
"int_campaign_type",
|
|
96
|
-
"int_keycode",
|
|
97
|
-
"g2i_source",
|
|
98
|
-
"g2i_medium",
|
|
99
|
-
"g2i_campaign",
|
|
100
|
-
"g2i_or_o",
|
|
101
|
-
"g2i_or_p",
|
|
102
|
-
"doing_wp_cron",
|
|
103
|
-
"preview",
|
|
104
|
-
"preview_id",
|
|
105
|
-
"preview_nonce",
|
|
106
|
-
"replytocom",
|
|
107
|
-
"_",
|
|
108
|
-
"timestamp",
|
|
109
|
-
"ts",
|
|
110
|
-
"cb",
|
|
111
|
-
"cachebuster",
|
|
112
|
-
"nocache",
|
|
113
|
-
"rand",
|
|
114
|
-
"random",
|
|
115
|
-
"sbdcrw",
|
|
116
|
-
"forceByPassCache",
|
|
117
|
-
"sucurianticache",
|
|
118
|
-
"cleancache",
|
|
119
|
-
"rebuildcache",
|
|
120
|
-
"kontrol_health_check_timestamp",
|
|
121
|
-
"action_object_map",
|
|
122
|
-
"action_ref_map",
|
|
123
|
-
"action_type_map",
|
|
124
|
-
"algo_expid",
|
|
125
|
-
"algo_pvid",
|
|
126
|
-
"at_campaign",
|
|
127
|
-
"at_custom1",
|
|
128
|
-
"at_custom2",
|
|
129
|
-
"at_custom3",
|
|
130
|
-
"at_custom4",
|
|
131
|
-
"at_medium",
|
|
132
|
-
"at_preview_index",
|
|
133
|
-
"_bhlid",
|
|
134
|
-
"_branch_match_id",
|
|
135
|
-
"_branch_referrer",
|
|
136
|
-
"__readwiseLocation",
|
|
137
|
-
"campaign_id",
|
|
138
|
-
"click_sum",
|
|
139
|
-
"fref",
|
|
140
|
-
"gs_l",
|
|
141
|
-
"hmb_campaign",
|
|
142
|
-
"hmb_medium",
|
|
143
|
-
"hmb_source",
|
|
144
|
-
"ml_subscriber",
|
|
145
|
-
"ml_subscriber_hash",
|
|
146
|
-
"oly_anon_id",
|
|
147
|
-
"oly_enc_id",
|
|
148
|
-
"rb_clickid",
|
|
149
|
-
"referer",
|
|
150
|
-
"referrer",
|
|
151
|
-
"spm",
|
|
152
|
-
"trk",
|
|
153
|
-
"vero_conv",
|
|
154
|
-
"vero_id",
|
|
155
|
-
"wickedid",
|
|
156
|
-
"xtor"
|
|
157
|
-
];
|
|
158
5
|
const defaultNormalizeOptions = {
|
|
159
6
|
stripProtocol: true,
|
|
160
7
|
stripAuthentication: false,
|
|
@@ -164,7 +11,7 @@ const defaultNormalizeOptions = {
|
|
|
164
11
|
collapseSlashes: true,
|
|
165
12
|
stripHash: true,
|
|
166
13
|
sortQueryParams: true,
|
|
167
|
-
stripQueryParams:
|
|
14
|
+
stripQueryParams: defaultTrackingParams,
|
|
168
15
|
stripQuery: false,
|
|
169
16
|
stripEmptyQuery: true,
|
|
170
17
|
lowercaseQuery: false,
|
|
@@ -285,4 +132,4 @@ const defaultTiers = [
|
|
|
285
132
|
}
|
|
286
133
|
];
|
|
287
134
|
//#endregion
|
|
288
|
-
export { defaultFetch, defaultNormalizeOptions, defaultParser,
|
|
135
|
+
export { defaultFetch, defaultNormalizeOptions, defaultParser, defaultTiers };
|
package/dist/exports.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DefaultParserResult, ExistsFn, FetchFn, FetchFnOptions, FetchFnResponse, FindCanonicalOptions, NormalizeOptions, OnExistsFn, OnFetchFn, OnMatchFn, ParserAdapter, Probe, Rewrite, Tier } from "./types.js";
|
|
2
|
-
import { defaultFetch, defaultParser,
|
|
2
|
+
import { defaultFetch, defaultParser, defaultTiers } from "./defaults.js";
|
|
3
3
|
import { findCanonical } from "./index.js";
|
|
4
4
|
import { wordpressProbe } from "./probes/wordpress.js";
|
|
5
5
|
import { bloggerRewrite } from "./rewrites/blogger.js";
|
|
6
6
|
import { feedburnerRewrite } from "./rewrites/feedburner.js";
|
|
7
7
|
import { addMissingProtocol, fixMalformedProtocol, normalizeUrl, resolveFeedProtocol, resolveUrl, upgradeProtocol } from "./utils.js";
|
|
8
|
-
export { type DefaultParserResult, type ExistsFn, type FetchFn, type FetchFnOptions, type FetchFnResponse, type FindCanonicalOptions, type NormalizeOptions, type OnExistsFn, type OnFetchFn, type OnMatchFn, type ParserAdapter, type Probe, type Rewrite, type Tier, addMissingProtocol, bloggerRewrite, defaultFetch, defaultParser,
|
|
8
|
+
export { type DefaultParserResult, type ExistsFn, type FetchFn, type FetchFnOptions, type FetchFnResponse, type FindCanonicalOptions, type NormalizeOptions, type OnExistsFn, type OnFetchFn, type OnMatchFn, type ParserAdapter, type Probe, type Rewrite, type Tier, addMissingProtocol, bloggerRewrite, defaultFetch, defaultParser, defaultTiers, feedburnerRewrite, findCanonical, fixMalformedProtocol, normalizeUrl, resolveFeedProtocol, resolveUrl, upgradeProtocol, wordpressProbe };
|
package/dist/exports.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { addMissingProtocol, fixMalformedProtocol, normalizeUrl, resolveFeedProtocol, resolveUrl, upgradeProtocol } from "./utils.js";
|
|
2
|
-
import { defaultFetch, defaultParser,
|
|
2
|
+
import { defaultFetch, defaultParser, defaultTiers } from "./defaults.js";
|
|
3
3
|
import { findCanonical } from "./index.js";
|
|
4
4
|
import { wordpressProbe } from "./probes/wordpress.js";
|
|
5
5
|
import { bloggerRewrite } from "./rewrites/blogger.js";
|
|
6
6
|
import { feedburnerRewrite } from "./rewrites/feedburner.js";
|
|
7
|
-
export { addMissingProtocol, bloggerRewrite, defaultFetch, defaultParser,
|
|
7
|
+
export { addMissingProtocol, bloggerRewrite, defaultFetch, defaultParser, defaultTiers, feedburnerRewrite, findCanonical, fixMalformedProtocol, normalizeUrl, resolveFeedProtocol, resolveUrl, upgradeProtocol, wordpressProbe };
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { applyProbes, applyRewrites, normalizeUrl, resolveUrl } from "./utils.js";
|
|
2
|
-
import { defaultFetch, defaultParser,
|
|
2
|
+
import { defaultFetch, defaultParser, defaultTiers } from "./defaults.js";
|
|
3
|
+
import { defaultTrackingParams } from "urlpurify";
|
|
3
4
|
//#region src/index.ts
|
|
4
5
|
async function findCanonical(inputUrl, options) {
|
|
5
|
-
const { parser = defaultParser, fetchFn = defaultFetch, existsFn, tiers = defaultTiers, rewrites, probes, stripQueryParams =
|
|
6
|
+
const { parser = defaultParser, fetchFn = defaultFetch, existsFn, tiers = defaultTiers, rewrites, probes, stripQueryParams = defaultTrackingParams, onFetch, onMatch, onExists } = options ?? {};
|
|
6
7
|
const stripParams = (url) => {
|
|
7
8
|
return normalizeUrl(url, {
|
|
8
9
|
stripQueryParams,
|
package/package.json
CHANGED
|
@@ -45,14 +45,16 @@
|
|
|
45
45
|
"entities": "^8.0.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"feedsmith": "^3.0.0-beta.4"
|
|
48
|
+
"feedsmith": "^3.0.0-beta.4",
|
|
49
|
+
"urlpurify": "^1.0.0"
|
|
49
50
|
},
|
|
50
51
|
"devDependencies": {
|
|
51
52
|
"@types/bun": "^1.3.14",
|
|
52
53
|
"feedsmith": "^3.0.0-beta.4",
|
|
53
54
|
"kvalita": "^1.14.0",
|
|
54
55
|
"tsdown": "^0.22.2",
|
|
55
|
-
"vitepress": "^2.0.0-alpha.17"
|
|
56
|
+
"vitepress": "^2.0.0-alpha.17",
|
|
57
|
+
"urlpurify": "^1.0.0"
|
|
56
58
|
},
|
|
57
|
-
"version": "2.0.0-beta.
|
|
59
|
+
"version": "2.0.0-beta.2"
|
|
58
60
|
}
|