feedcanon 0.9.0 → 0.9.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/exports.d.cts +2 -2
- package/dist/exports.d.ts +2 -2
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/types.d.cts +5 -2
- package/dist/types.d.ts +5 -2
- package/dist/utils.cjs +1 -3
- package/dist/utils.d.cts +2 -3
- package/dist/utils.d.ts +2 -3
- package/dist/utils.js +1 -3
- package/package.json +1 -1
package/dist/exports.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ExistsFn, FetchFn, FetchFnOptions, FetchFnResponse, FindCanonicalOptions, NormalizeOptions, OnExistsFn, OnFetchFn, OnMatchFn, ParserAdapter, PlatformHandler } from "./types.cjs";
|
|
1
|
+
import { ExistsFn, FeedsmithFeed, FetchFn, FetchFnOptions, FetchFnResponse, FindCanonicalOptions, NormalizeOptions, OnExistsFn, OnFetchFn, OnMatchFn, ParserAdapter, PlatformHandler } from "./types.cjs";
|
|
2
2
|
import { defaultPlatforms, defaultStrippedParams, defaultTiers } from "./defaults.cjs";
|
|
3
3
|
import { findCanonical } from "./index.cjs";
|
|
4
4
|
import { feedburnerHandler } from "./platforms/feedburner.cjs";
|
|
5
5
|
import { addMissingProtocol, feedsmithParser, normalizeUrl, resolveFeedProtocol, resolveUrl } from "./utils.cjs";
|
|
6
|
-
export { type ExistsFn, type FetchFn, type FetchFnOptions, type FetchFnResponse, type FindCanonicalOptions, type NormalizeOptions, type OnExistsFn, type OnFetchFn, type OnMatchFn, type ParserAdapter, type PlatformHandler, addMissingProtocol, defaultPlatforms, defaultStrippedParams, defaultTiers, feedburnerHandler, feedsmithParser, findCanonical, normalizeUrl, resolveFeedProtocol, resolveUrl };
|
|
6
|
+
export { type ExistsFn, type FeedsmithFeed, type FetchFn, type FetchFnOptions, type FetchFnResponse, type FindCanonicalOptions, type NormalizeOptions, type OnExistsFn, type OnFetchFn, type OnMatchFn, type ParserAdapter, type PlatformHandler, addMissingProtocol, defaultPlatforms, defaultStrippedParams, defaultTiers, feedburnerHandler, feedsmithParser, findCanonical, normalizeUrl, resolveFeedProtocol, resolveUrl };
|
package/dist/exports.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ExistsFn, FetchFn, FetchFnOptions, FetchFnResponse, FindCanonicalOptions, NormalizeOptions, OnExistsFn, OnFetchFn, OnMatchFn, ParserAdapter, PlatformHandler } from "./types.js";
|
|
1
|
+
import { ExistsFn, FeedsmithFeed, FetchFn, FetchFnOptions, FetchFnResponse, FindCanonicalOptions, NormalizeOptions, OnExistsFn, OnFetchFn, OnMatchFn, ParserAdapter, PlatformHandler } from "./types.js";
|
|
2
2
|
import { defaultPlatforms, defaultStrippedParams, defaultTiers } from "./defaults.js";
|
|
3
3
|
import { findCanonical } from "./index.js";
|
|
4
4
|
import { feedburnerHandler } from "./platforms/feedburner.js";
|
|
5
5
|
import { addMissingProtocol, feedsmithParser, normalizeUrl, resolveFeedProtocol, resolveUrl } from "./utils.js";
|
|
6
|
-
export { type ExistsFn, type FetchFn, type FetchFnOptions, type FetchFnResponse, type FindCanonicalOptions, type NormalizeOptions, type OnExistsFn, type OnFetchFn, type OnMatchFn, type ParserAdapter, type PlatformHandler, addMissingProtocol, defaultPlatforms, defaultStrippedParams, defaultTiers, feedburnerHandler, feedsmithParser, findCanonical, normalizeUrl, resolveFeedProtocol, resolveUrl };
|
|
6
|
+
export { type ExistsFn, type FeedsmithFeed, type FetchFn, type FetchFnOptions, type FetchFnResponse, type FindCanonicalOptions, type NormalizeOptions, type OnExistsFn, type OnFetchFn, type OnMatchFn, type ParserAdapter, type PlatformHandler, addMissingProtocol, defaultPlatforms, defaultStrippedParams, defaultTiers, feedburnerHandler, feedsmithParser, findCanonical, normalizeUrl, resolveFeedProtocol, resolveUrl };
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FindCanonicalOptions } from "./types.cjs";
|
|
1
|
+
import { FeedsmithFeed, FindCanonicalOptions } from "./types.cjs";
|
|
2
2
|
|
|
3
3
|
//#region src/index.d.ts
|
|
4
|
-
declare const findCanonical: <TFeed, TExisting>(inputUrl: string, options?: FindCanonicalOptions<TFeed, TExisting>) => Promise<string | undefined>;
|
|
4
|
+
declare const findCanonical: <TFeed = FeedsmithFeed, TExisting = unknown>(inputUrl: string, options?: FindCanonicalOptions<TFeed, TExisting>) => Promise<string | undefined>;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { findCanonical };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FindCanonicalOptions } from "./types.js";
|
|
1
|
+
import { FeedsmithFeed, FindCanonicalOptions } from "./types.js";
|
|
2
2
|
|
|
3
3
|
//#region src/index.d.ts
|
|
4
|
-
declare const findCanonical: <TFeed, TExisting>(inputUrl: string, options?: FindCanonicalOptions<TFeed, TExisting>) => Promise<string | undefined>;
|
|
4
|
+
declare const findCanonical: <TFeed = FeedsmithFeed, TExisting = unknown>(inputUrl: string, options?: FindCanonicalOptions<TFeed, TExisting>) => Promise<string | undefined>;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { findCanonical };
|
package/dist/types.d.cts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import * as feedsmith0 from "feedsmith";
|
|
2
|
+
|
|
1
3
|
//#region src/types.d.ts
|
|
4
|
+
type FeedsmithFeed = ReturnType<typeof feedsmith0.parseFeed>;
|
|
2
5
|
type ParserAdapter<T> = {
|
|
3
6
|
parse: (body: string) => T | undefined;
|
|
4
7
|
getSelfUrl: (parsed: T) => string | undefined;
|
|
@@ -39,7 +42,7 @@ type OnExistsFn<T> = (data: {
|
|
|
39
42
|
data: T;
|
|
40
43
|
}) => void;
|
|
41
44
|
type ExistsFn<T = unknown> = (url: string) => Promise<T | undefined>;
|
|
42
|
-
type FindCanonicalOptions<TFeed =
|
|
45
|
+
type FindCanonicalOptions<TFeed = FeedsmithFeed, TExisting = unknown> = {
|
|
43
46
|
parser?: ParserAdapter<TFeed>;
|
|
44
47
|
fetchFn?: FetchFn;
|
|
45
48
|
existsFn?: ExistsFn<TExisting>;
|
|
@@ -61,4 +64,4 @@ type FetchFnResponse = {
|
|
|
61
64
|
};
|
|
62
65
|
type FetchFn = (url: string, options?: FetchFnOptions) => Promise<FetchFnResponse>;
|
|
63
66
|
//#endregion
|
|
64
|
-
export { ExistsFn, FetchFn, FetchFnOptions, FetchFnResponse, FindCanonicalOptions, NormalizeOptions, OnExistsFn, OnFetchFn, OnMatchFn, ParserAdapter, PlatformHandler };
|
|
67
|
+
export { ExistsFn, FeedsmithFeed, FetchFn, FetchFnOptions, FetchFnResponse, FindCanonicalOptions, NormalizeOptions, OnExistsFn, OnFetchFn, OnMatchFn, ParserAdapter, PlatformHandler };
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import * as feedsmith0 from "feedsmith";
|
|
2
|
+
|
|
1
3
|
//#region src/types.d.ts
|
|
4
|
+
type FeedsmithFeed = ReturnType<typeof feedsmith0.parseFeed>;
|
|
2
5
|
type ParserAdapter<T> = {
|
|
3
6
|
parse: (body: string) => T | undefined;
|
|
4
7
|
getSelfUrl: (parsed: T) => string | undefined;
|
|
@@ -39,7 +42,7 @@ type OnExistsFn<T> = (data: {
|
|
|
39
42
|
data: T;
|
|
40
43
|
}) => void;
|
|
41
44
|
type ExistsFn<T = unknown> = (url: string) => Promise<T | undefined>;
|
|
42
|
-
type FindCanonicalOptions<TFeed =
|
|
45
|
+
type FindCanonicalOptions<TFeed = FeedsmithFeed, TExisting = unknown> = {
|
|
43
46
|
parser?: ParserAdapter<TFeed>;
|
|
44
47
|
fetchFn?: FetchFn;
|
|
45
48
|
existsFn?: ExistsFn<TExisting>;
|
|
@@ -61,4 +64,4 @@ type FetchFnResponse = {
|
|
|
61
64
|
};
|
|
62
65
|
type FetchFn = (url: string, options?: FetchFnOptions) => Promise<FetchFnResponse>;
|
|
63
66
|
//#endregion
|
|
64
|
-
export { ExistsFn, FetchFn, FetchFnOptions, FetchFnResponse, FindCanonicalOptions, NormalizeOptions, OnExistsFn, OnFetchFn, OnMatchFn, ParserAdapter, PlatformHandler };
|
|
67
|
+
export { ExistsFn, FeedsmithFeed, FetchFn, FetchFnOptions, FetchFnResponse, FindCanonicalOptions, NormalizeOptions, OnExistsFn, OnFetchFn, OnMatchFn, ParserAdapter, PlatformHandler };
|
package/dist/utils.cjs
CHANGED
package/dist/utils.d.cts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { NormalizeOptions, ParserAdapter } from "./types.cjs";
|
|
2
|
-
import { parseFeed } from "feedsmith";
|
|
1
|
+
import { FeedsmithFeed, NormalizeOptions, ParserAdapter } from "./types.cjs";
|
|
3
2
|
|
|
4
3
|
//#region src/utils.d.ts
|
|
5
4
|
declare const resolveFeedProtocol: (url: string, protocol?: "http" | "https") => string;
|
|
6
5
|
declare const addMissingProtocol: (url: string, protocol?: "http" | "https") => string;
|
|
7
6
|
declare const resolveUrl: (url: string, base?: string) => string | undefined;
|
|
8
7
|
declare const normalizeUrl: (url: string, options?: NormalizeOptions) => string;
|
|
9
|
-
declare const feedsmithParser: ParserAdapter<
|
|
8
|
+
declare const feedsmithParser: ParserAdapter<FeedsmithFeed>;
|
|
10
9
|
//#endregion
|
|
11
10
|
export { addMissingProtocol, feedsmithParser, normalizeUrl, resolveFeedProtocol, resolveUrl };
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { NormalizeOptions, ParserAdapter } from "./types.js";
|
|
2
|
-
import { parseFeed } from "feedsmith";
|
|
1
|
+
import { FeedsmithFeed, NormalizeOptions, ParserAdapter } from "./types.js";
|
|
3
2
|
|
|
4
3
|
//#region src/utils.d.ts
|
|
5
4
|
declare const resolveFeedProtocol: (url: string, protocol?: "http" | "https") => string;
|
|
6
5
|
declare const addMissingProtocol: (url: string, protocol?: "http" | "https") => string;
|
|
7
6
|
declare const resolveUrl: (url: string, base?: string) => string | undefined;
|
|
8
7
|
declare const normalizeUrl: (url: string, options?: NormalizeOptions) => string;
|
|
9
|
-
declare const feedsmithParser: ParserAdapter<
|
|
8
|
+
declare const feedsmithParser: ParserAdapter<FeedsmithFeed>;
|
|
10
9
|
//#endregion
|
|
11
10
|
export { addMissingProtocol, feedsmithParser, normalizeUrl, resolveFeedProtocol, resolveUrl };
|
package/dist/utils.js
CHANGED
package/package.json
CHANGED