foxts 1.0.7 → 1.0.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.
package/fifo/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var e;e=Symbol.iterator,exports.FIFO=class{head=null;tail=null;$size=0;constructor(){this.clear()}enqueue(e){const t=[e,null];this.head?this.tail[1]=t:this.head=t,this.tail=t,this.$size++}dequeue(){const e=this.head;if(e)return this.head=this.head[1],this.$size--,e[0]}peek(){return this.head?.[0]}clear(){this.head=null,this.tail=null,this.$size=0}get size(){return this.$size}*[e](){let e=this.head;for(;e;)yield e[0],e=e[1]}};
1
+ "use strict";var e;e=Symbol.iterator;class t{head=null;tail=null;$size=0;constructor(){this.clear()}enqueue(e){const t=[e,null];this.head?this.tail[1]=t:this.head=t,this.tail=t,this.$size++}push=this.enqueue;dequeue(){const e=this.head;if(e)return this.head=this.head[1],this.$size--,e[0]}shift=this.dequeue;peek(){return this.head?.[0]}clear(){this.head=null,this.tail=null,this.$size=0}get size(){return this.$size}*[e](){let e=this.head;for(;e;)yield e[0],e=e[1]}}exports.FIFO=t;
package/fifo/index.d.ts CHANGED
@@ -4,7 +4,9 @@ declare class FIFO<T> {
4
4
  $size: number;
5
5
  constructor();
6
6
  enqueue(value: T): void;
7
+ push: (value: T) => void;
7
8
  dequeue(): T | undefined;
9
+ shift: () => T | undefined;
8
10
  peek(): T | undefined;
9
11
  clear(): void;
10
12
  get size(): number;
package/fifo/index.mjs CHANGED
@@ -1 +1 @@
1
- var e;e=Symbol.iterator;class t{head=null;tail=null;$size=0;constructor(){this.clear()}enqueue(e){const t=[e,null];this.head?this.tail[1]=t:this.head=t,this.tail=t,this.$size++}dequeue(){const e=this.head;if(e)return this.head=this.head[1],this.$size--,e[0]}peek(){return this.head?.[0]}clear(){this.head=null,this.tail=null,this.$size=0}get size(){return this.$size}*[e](){let e=this.head;for(;e;)yield e[0],e=e[1]}}export{t as FIFO};
1
+ var e;e=Symbol.iterator;class t{head=null;tail=null;$size=0;constructor(){this.clear()}enqueue(e){const t=[e,null];this.head?this.tail[1]=t:this.head=t,this.tail=t,this.$size++}push=this.enqueue;dequeue(){const e=this.head;if(e)return this.head=this.head[1],this.$size--,e[0]}shift=this.dequeue;peek(){return this.head?.[0]}clear(){this.head=null,this.tail=null,this.$size=0}get size(){return this.$size}*[e](){let e=this.head;for(;e;)yield e[0],e=e[1]}}export{t as FIFO};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foxts",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "Opinionated collection of common TypeScript utils by @SukkaW",
5
5
  "repository": {
6
6
  "url": "https://github.com/SukkaW/foxts"
@@ -47,6 +47,24 @@
47
47
  "require": "./ahocorasick/index.cjs",
48
48
  "default": "./ahocorasick/index.cjs"
49
49
  },
50
+ "./async-write-to-stream": {
51
+ "types": "./async-write-to-stream/index.d.ts",
52
+ "import": {
53
+ "types": "./async-write-to-stream/index.d.ts",
54
+ "default": "./async-write-to-stream/index.mjs"
55
+ },
56
+ "require": "./async-write-to-stream/index.cjs",
57
+ "default": "./async-write-to-stream/index.cjs"
58
+ },
59
+ "./bitwise": {
60
+ "types": "./bitwise/index.d.ts",
61
+ "import": {
62
+ "types": "./bitwise/index.d.ts",
63
+ "default": "./bitwise/index.mjs"
64
+ },
65
+ "require": "./bitwise/index.cjs",
66
+ "default": "./bitwise/index.cjs"
67
+ },
50
68
  "./append-set-elements-to-array": {
51
69
  "types": "./append-set-elements-to-array/index.d.ts",
52
70
  "import": {
@@ -74,24 +92,6 @@
74
92
  "require": "./fifo/index.cjs",
75
93
  "default": "./fifo/index.cjs"
76
94
  },
77
- "./async-write-to-stream": {
78
- "types": "./async-write-to-stream/index.d.ts",
79
- "import": {
80
- "types": "./async-write-to-stream/index.d.ts",
81
- "default": "./async-write-to-stream/index.mjs"
82
- },
83
- "require": "./async-write-to-stream/index.cjs",
84
- "default": "./async-write-to-stream/index.cjs"
85
- },
86
- "./bitwise": {
87
- "types": "./bitwise/index.d.ts",
88
- "import": {
89
- "types": "./bitwise/index.d.ts",
90
- "default": "./bitwise/index.mjs"
91
- },
92
- "require": "./bitwise/index.cjs",
93
- "default": "./bitwise/index.cjs"
94
- },
95
95
  "./fnv1a": {
96
96
  "types": "./fnv1a/index.d.ts",
97
97
  "import": {
@@ -101,15 +101,6 @@
101
101
  "require": "./fnv1a/index.cjs",
102
102
  "default": "./fnv1a/index.cjs"
103
103
  },
104
- "./headers-to-object": {
105
- "types": "./headers-to-object/index.d.ts",
106
- "import": {
107
- "types": "./headers-to-object/index.d.ts",
108
- "default": "./headers-to-object/index.mjs"
109
- },
110
- "require": "./headers-to-object/index.cjs",
111
- "default": "./headers-to-object/index.cjs"
112
- },
113
104
  "./guard": {
114
105
  "types": "./guard/index.d.ts",
115
106
  "import": {
@@ -128,6 +119,15 @@
128
119
  "require": "./fnv1a52/index.cjs",
129
120
  "default": "./fnv1a52/index.cjs"
130
121
  },
122
+ "./headers-to-object": {
123
+ "types": "./headers-to-object/index.d.ts",
124
+ "import": {
125
+ "types": "./headers-to-object/index.d.ts",
126
+ "default": "./headers-to-object/index.mjs"
127
+ },
128
+ "require": "./headers-to-object/index.cjs",
129
+ "default": "./headers-to-object/index.cjs"
130
+ },
131
131
  "./identity": {
132
132
  "types": "./identity/index.d.ts",
133
133
  "import": {
@@ -137,15 +137,6 @@
137
137
  "require": "./identity/index.cjs",
138
138
  "default": "./identity/index.cjs"
139
139
  },
140
- "./merge-headers": {
141
- "types": "./merge-headers/index.d.ts",
142
- "import": {
143
- "types": "./merge-headers/index.d.ts",
144
- "default": "./merge-headers/index.mjs"
145
- },
146
- "require": "./merge-headers/index.cjs",
147
- "default": "./merge-headers/index.cjs"
148
- },
149
140
  "./is-probably-ip": {
150
141
  "types": "./is-probably-ip/index.d.ts",
151
142
  "import": {
@@ -164,6 +155,15 @@
164
155
  "require": "./noop/index.cjs",
165
156
  "default": "./noop/index.cjs"
166
157
  },
158
+ "./merge-headers": {
159
+ "types": "./merge-headers/index.d.ts",
160
+ "import": {
161
+ "types": "./merge-headers/index.d.ts",
162
+ "default": "./merge-headers/index.mjs"
163
+ },
164
+ "require": "./merge-headers/index.cjs",
165
+ "default": "./merge-headers/index.cjs"
166
+ },
167
167
  "./simple-string-hash": {
168
168
  "types": "./simple-string-hash/index.d.ts",
169
169
  "import": {