@dan-uni/dan-any 0.7.3 → 0.7.4

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/index.js CHANGED
@@ -1013,11 +1013,13 @@ class UniPool {
1013
1013
  }));
1014
1014
  }
1015
1015
  dedupe() {
1016
- const map = new Map();
1017
- this.dans.forEach((d)=>map.set(d.DMID || d.toDMID(), d));
1018
- this.dans = [
1019
- ...map.values()
1020
- ];
1016
+ if (false !== this.options.dmid) {
1017
+ const map = new Map();
1018
+ this.dans.forEach((d)=>map.set(d.DMID || d.toDMID(), d));
1019
+ this.dans = [
1020
+ ...map.values()
1021
+ ];
1022
+ }
1021
1023
  this.options.dedupe = false;
1022
1024
  }
1023
1025
  merge(lifetime = 0) {
@@ -1939,11 +1941,13 @@ class src_UniPool {
1939
1941
  }));
1940
1942
  }
1941
1943
  dedupe() {
1942
- const map = new Map();
1943
- this.dans.forEach((d)=>map.set(d.DMID || d.toDMID(), d));
1944
- this.dans = [
1945
- ...map.values()
1946
- ];
1944
+ if (false !== this.options.dmid) {
1945
+ const map = new Map();
1946
+ this.dans.forEach((d)=>map.set(d.DMID || d.toDMID(), d));
1947
+ this.dans = [
1948
+ ...map.values()
1949
+ ];
1950
+ }
1947
1951
  this.options.dedupe = false;
1948
1952
  }
1949
1953
  merge(lifetime = 0) {
@@ -23984,11 +23984,13 @@ and limitations under the License.
23984
23984
  }));
23985
23985
  }
23986
23986
  dedupe() {
23987
- const map = new Map();
23988
- this.dans.forEach((d)=>map.set(d.DMID || d.toDMID(), d));
23989
- this.dans = [
23990
- ...map.values()
23991
- ];
23987
+ if (false !== this.options.dmid) {
23988
+ const map = new Map();
23989
+ this.dans.forEach((d)=>map.set(d.DMID || d.toDMID(), d));
23990
+ this.dans = [
23991
+ ...map.values()
23992
+ ];
23993
+ }
23992
23994
  this.options.dedupe = false;
23993
23995
  }
23994
23996
  merge(lifetime = 0) {
@@ -24915,11 +24917,13 @@ and limitations under the License.
24915
24917
  }));
24916
24918
  }
24917
24919
  dedupe() {
24918
- const map = new Map();
24919
- this.dans.forEach((d)=>map.set(d.DMID || d.toDMID(), d));
24920
- this.dans = [
24921
- ...map.values()
24922
- ];
24920
+ if (false !== this.options.dmid) {
24921
+ const map = new Map();
24922
+ this.dans.forEach((d)=>map.set(d.DMID || d.toDMID(), d));
24923
+ this.dans = [
24924
+ ...map.values()
24925
+ ];
24926
+ }
24923
24927
  this.options.dedupe = false;
24924
24928
  }
24925
24929
  merge(lifetime = 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dan-uni/dan-any",
3
- "version": "0.7.3",
3
+ "version": "0.7.4",
4
4
  "description": "A danmaku transformer lib, supporting danmaku from different platforms.",
5
5
  "keywords": [
6
6
  "bangumi",
package/src/index.ts CHANGED
@@ -256,9 +256,11 @@ export class UniPool {
256
256
  * 基于DMID的基本去重功能,用于解决该class下dans为array而非Set的问题
257
257
  */
258
258
  private dedupe() {
259
- const map = new Map()
260
- this.dans.forEach((d) => map.set(d.DMID || d.toDMID(), d))
261
- this.dans = [...map.values()]
259
+ if (this.options.dmid !== false) {
260
+ const map = new Map()
261
+ this.dans.forEach((d) => map.set(d.DMID || d.toDMID(), d))
262
+ this.dans = [...map.values()]
263
+ }
262
264
  this.options.dedupe = false
263
265
  }
264
266
  /**