@dan-uni/dan-any 1.1.1 → 1.2.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/browser/157.min.js +20 -4
- package/dist/browser/17.min.js +13289 -0
- package/dist/browser/898.min.js +10 -0
- package/dist/browser/index.min.js +1 -13248
- package/dist/browser/plugins/bili-dedupe.min.js +1 -1
- package/dist/browser/plugins/index.min.js +1 -0
- package/dist/browser/plugins/stats.min.js +1 -0
- package/dist/browser/src/index.d.ts +4 -4
- package/dist/browser/src/plugins/bili-dedupe/index.d.ts +3 -5
- package/dist/browser/src/plugins/index.d.ts +2 -2
- package/dist/browser/src/plugins/stats/getLatestDan.d.ts +6 -0
- package/dist/browser/src/plugins/stats/index.d.ts +1 -0
- package/dist/browser/src/plugins/stats/index.test.d.ts +1 -0
- package/dist/node/157.js +20 -4
- package/dist/node/17.js +1864 -0
- package/dist/node/898.js +10 -0
- package/dist/node/index.js +1 -1823
- package/dist/node/plugins/bili-dedupe.js +1 -1
- package/dist/node/plugins/index.js +1 -0
- package/dist/node/plugins/stats.js +1 -0
- package/dist/node/src/index.d.ts +4 -4
- package/dist/node/src/plugins/bili-dedupe/index.d.ts +3 -5
- package/dist/node/src/plugins/index.d.ts +2 -2
- package/dist/node/src/plugins/stats/getLatestDan.d.ts +6 -0
- package/dist/node/src/plugins/stats/index.d.ts +1 -0
- package/dist/node/src/plugins/stats/index.test.d.ts +1 -0
- package/dist/umd/index.umd.min.js +65 -62
- package/dist/umd/plugins/bili-dedupe.umd.min.js +24997 -48
- package/dist/umd/plugins/bili-dedupe.umd.min.js.LICENSE.txt +34 -0
- package/dist/umd/plugins/index.umd.min.js +24971 -21
- package/dist/umd/plugins/index.umd.min.js.LICENSE.txt +34 -0
- package/dist/umd/plugins/stats.umd.min.js +39 -0
- package/dist/umd/src/index.d.ts +4 -4
- package/dist/umd/src/plugins/bili-dedupe/index.d.ts +3 -5
- package/dist/umd/src/plugins/index.d.ts +2 -2
- package/dist/umd/src/plugins/stats/getLatestDan.d.ts +6 -0
- package/dist/umd/src/plugins/stats/index.d.ts +1 -0
- package/dist/umd/src/plugins/stats/index.test.d.ts +1 -0
- package/package.json +1 -1
- package/rslib.config.ts +1 -0
- package/src/index.ts +8 -4
- package/src/plugins/bili-dedupe/index.test.ts +5 -2
- package/src/plugins/bili-dedupe/index.ts +13 -3
- package/src/plugins/index.ts +2 -3
- package/src/plugins/stats/getLatestDan.ts +13 -0
- package/src/plugins/stats/index.test.ts +39 -0
- package/src/plugins/stats/index.ts +1 -0
- package/dist/browser/42.min.js +0 -45
- package/dist/node/42.js +0 -45
- /package/dist/browser/{index.min.js.LICENSE.txt → 17.min.js.LICENSE.txt} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { bili_dedupe_0 as bili_dedupe, to_bili_deduped } from "../157.min.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getLatestDan } from "../898.min.js";
|
|
@@ -120,8 +120,8 @@ export type DM_format = 'danuni.json' | 'danuni.pb.bin' | 'bili.xml' | 'bili.pb.
|
|
|
120
120
|
type shareItems = Partial<Pick<UniDMTools.UniDMObj, 'SOID' | 'senderID' | 'platform' | 'SOID' | 'pool' | 'mode' | 'color'>>;
|
|
121
121
|
type statItems = Partial<Pick<UniDMTools.UniDMObj, 'SOID' | 'mode' | 'fontsize' | 'color' | 'senderID' | 'content' | 'weight' | 'pool' | 'platform'>>;
|
|
122
122
|
type Stats<T extends keyof statItems> = Map<statItems[T], number>;
|
|
123
|
-
type UniPoolPipe = (that: UniPool) => Promise<
|
|
124
|
-
type UniPoolPipeSync = (that: UniPool) =>
|
|
123
|
+
type UniPoolPipe = (that: UniPool) => Promise<any>;
|
|
124
|
+
type UniPoolPipeSync = (that: UniPool) => any;
|
|
125
125
|
export interface Options {
|
|
126
126
|
dedupe?: boolean;
|
|
127
127
|
/**
|
|
@@ -145,8 +145,8 @@ export declare class UniPool {
|
|
|
145
145
|
*/
|
|
146
146
|
fromConverted: boolean;
|
|
147
147
|
});
|
|
148
|
-
pipe(fn:
|
|
149
|
-
pipeSync(fn:
|
|
148
|
+
pipe<T extends (...args: any) => any = UniPoolPipe>(fn: T): Promise<ReturnType<T>>;
|
|
149
|
+
pipeSync<T extends (...args: any) => any = UniPoolPipeSync>(fn: T): ReturnType<T>;
|
|
150
150
|
/**
|
|
151
151
|
* @deprecated 使用 `getShared` 代替
|
|
152
152
|
*/
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*/
|
|
5
|
-
export default function bili_dedupe(that: UniPool): UniPool;
|
|
1
|
+
import { UniPool } from '../..';
|
|
2
|
+
export declare function to_bili_deduped(that: UniPool): UniPool;
|
|
3
|
+
export declare function bili_dedupe(that: UniPool): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
export * as bili_dedupe from './bili-dedupe';
|
|
2
|
+
export * as stats from './stats';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as getLatestDan } from './getLatestDan';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/node/157.js
CHANGED
|
@@ -1,14 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
2
|
+
import { UniPool, platform_PlatformVideoSource } from "./17.js";
|
|
3
|
+
var bili_dedupe_namespaceObject = {};
|
|
4
|
+
__webpack_require__.r(bili_dedupe_namespaceObject);
|
|
5
|
+
__webpack_require__.d(bili_dedupe_namespaceObject, {
|
|
6
|
+
bili_dedupe: ()=>bili_dedupe,
|
|
7
|
+
to_bili_deduped: ()=>to_bili_deduped
|
|
8
|
+
});
|
|
9
|
+
function main(that) {
|
|
3
10
|
that.dans.forEach((d)=>{
|
|
4
11
|
if (d.platform !== platform_PlatformVideoSource.Bilibili) throw new Error('bili-dedupe: 仅支持B站(主站)的弹幕');
|
|
5
12
|
if (!d.extra.bili?.dmid) throw new Error('bili-dedupe: 弹幕缺少bili extra dmid字段');
|
|
6
13
|
});
|
|
7
14
|
const map = new Map();
|
|
8
15
|
that.dans.forEach((d)=>map.set(d.extra.bili.dmid, d));
|
|
16
|
+
return map;
|
|
17
|
+
}
|
|
18
|
+
function to_bili_deduped(that) {
|
|
19
|
+
const map = main(that);
|
|
20
|
+
return new UniPool([
|
|
21
|
+
...map.values()
|
|
22
|
+
], that.options, that.info);
|
|
23
|
+
}
|
|
24
|
+
function bili_dedupe(that) {
|
|
25
|
+
const map = main(that);
|
|
9
26
|
that.dans = [
|
|
10
27
|
...map.values()
|
|
11
28
|
];
|
|
12
|
-
return that;
|
|
13
29
|
}
|
|
14
|
-
export { bili_dedupe };
|
|
30
|
+
export { bili_dedupe as bili_dedupe_0, bili_dedupe_namespaceObject as bili_dedupe, to_bili_deduped };
|