j-templates 7.0.93 → 7.0.95

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.
@@ -1,12 +0,0 @@
1
- export type DistinctArray<T> = {
2
- id: (value: T) => unknown;
3
- distinct: Set<unknown> | null;
4
- array: T[];
5
- };
6
- export declare namespace DistinctArray {
7
- function Create<T>(id?: (value: T) => unknown): DistinctArray<T>;
8
- function Push<T>(distinctArr: DistinctArray<T>, value: T): void;
9
- function Get<T>({ array }: DistinctArray<T>): T[];
10
- function Size<T>(distinct: DistinctArray<T>): number;
11
- function Clear<T>(distinct: DistinctArray<T>): void;
12
- }
@@ -1,49 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DistinctArray = void 0;
4
- var DistinctArray;
5
- (function (DistinctArray) {
6
- function Create(id = (val) => val) {
7
- return {
8
- id,
9
- distinct: null,
10
- array: [],
11
- };
12
- }
13
- DistinctArray.Create = Create;
14
- function Push(distinctArr, value) {
15
- switch (distinctArr.array.length) {
16
- case 0:
17
- distinctArr.array.push(value);
18
- break;
19
- case 1: {
20
- if (distinctArr.distinct === null) {
21
- distinctArr.distinct = new Set([
22
- distinctArr.id(distinctArr.array[0]),
23
- ]);
24
- }
25
- }
26
- default: {
27
- const vId = distinctArr.id(value);
28
- if (!distinctArr.distinct.has(vId)) {
29
- distinctArr.distinct.add(vId);
30
- distinctArr.array.push(value);
31
- }
32
- }
33
- }
34
- }
35
- DistinctArray.Push = Push;
36
- function Get({ array }) {
37
- return array;
38
- }
39
- DistinctArray.Get = Get;
40
- function Size(distinct) {
41
- return distinct.distinct.size;
42
- }
43
- DistinctArray.Size = Size;
44
- function Clear(distinct) {
45
- distinct.array = [];
46
- distinct.distinct?.clear();
47
- }
48
- DistinctArray.Clear = Clear;
49
- })(DistinctArray || (exports.DistinctArray = DistinctArray = {}));
File without changes
File without changes
File without changes
File without changes