@dan-uni/dan-any-plugin-detaolu 0.0.2 → 0.6.8

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.
@@ -12,6 +12,21 @@
12
12
  * @license MIT
13
13
  */
14
14
 
15
+ /*! *****************************************************************************
16
+ Copyright (C) Microsoft. All rights reserved.
17
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
18
+ this file except in compliance with the License. You may obtain a copy of the
19
+ License at http://www.apache.org/licenses/LICENSE-2.0
20
+
21
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
22
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
23
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
24
+ MERCHANTABLITY OR NON-INFRINGEMENT.
25
+
26
+ See the Apache Version 2.0 License for specific language governing permissions
27
+ and limitations under the License.
28
+ ***************************************************************************** */
29
+
15
30
  /*! For license information please see index.umd.min.js.LICENSE.txt */
16
31
 
17
32
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dan-uni/dan-any-plugin-detaolu",
3
- "version": "0.0.2",
3
+ "version": "0.6.8",
4
4
  "description": "A filter, dedupe and anti-spam plugin of dan-any, a danmaku transformer lib, based on pakku.js.",
5
5
  "keywords": [
6
6
  "bangumi",
@@ -17,8 +17,8 @@
17
17
  },
18
18
  "author": "rinne",
19
19
  "main": "dist/index.js",
20
- "module": "dist/index.js",
21
- "types": "dist/src/index.d.ts",
20
+ "module": "src/index.ts",
21
+ "types": "dist/index.d.ts",
22
22
  "browser": "dist/index.umd.min.js",
23
23
  "scripts": {
24
24
  "test": "vitest",
package/src/index.ts CHANGED
@@ -42,13 +42,15 @@ async function detaolu(that: UniPool, config?: DeTaoLuConfig) {
42
42
  content: p.chosen_str,
43
43
  weight: 10,
44
44
  pool: pool.shared.pool ?? pool.most.pool,
45
- attr: ['Protect'],
45
+ attr: [UniDMTools.DMAttr.Protect],
46
46
  platform: pool.shared.platform ?? pool.most.platform,
47
47
  extra: {
48
48
  danuni: {
49
49
  merge: {
50
50
  count: p.danuni_count,
51
- duration: Math.max(...progess) - Math.min(...progess),
51
+ duration: Number.parseFloat(
52
+ (Math.max(...progess) - Math.min(...progess)).toFixed(3),
53
+ ),
52
54
  senders: pool.dans
53
55
  .filter((d) => d.content === p.chosen_str)
54
56
  .map((d) => d.senderID),