foxts 1.0.7 → 1.0.9

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.
@@ -0,0 +1 @@
1
+ "use strict";const e=/[$()*+.?[\\\]^{|}]/g;exports.escapeStringRegexp=function(r){return r.replaceAll(e,"\\$&").replaceAll("-","\\x2d")};
@@ -0,0 +1,3 @@
1
+ declare function escapeStringRegexp(string: string): string;
2
+
3
+ export { escapeStringRegexp };
@@ -0,0 +1 @@
1
+ const e=/[$()*+.?[\\\]^{|}]/g;function l(l){return l.replaceAll(e,"\\$&").replaceAll("-","\\x2d")}export{l as escapeStringRegexp};
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}get length(){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
@@ -1,13 +1,17 @@
1
+ /** Checkout https://npm.im/fast-fifo if performance is critical */
1
2
  declare class FIFO<T> {
2
3
  private head;
3
4
  private tail;
4
5
  $size: number;
5
6
  constructor();
6
7
  enqueue(value: T): void;
8
+ push: (value: T) => void;
7
9
  dequeue(): T | undefined;
10
+ shift: () => T | undefined;
8
11
  peek(): T | undefined;
9
12
  clear(): void;
10
13
  get size(): number;
14
+ get length(): number;
11
15
  [Symbol.iterator](): Generator<T, void, unknown>;
12
16
  }
13
17
 
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}get length(){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.9",
4
4
  "description": "Opinionated collection of common TypeScript utils by @SukkaW",
5
5
  "repository": {
6
6
  "url": "https://github.com/SukkaW/foxts"
@@ -38,6 +38,24 @@
38
38
  "require": "./add-array-elements-to-set/index.cjs",
39
39
  "default": "./add-array-elements-to-set/index.cjs"
40
40
  },
41
+ "./append-set-elements-to-array": {
42
+ "types": "./append-set-elements-to-array/index.d.ts",
43
+ "import": {
44
+ "types": "./append-set-elements-to-array/index.d.ts",
45
+ "default": "./append-set-elements-to-array/index.mjs"
46
+ },
47
+ "require": "./append-set-elements-to-array/index.cjs",
48
+ "default": "./append-set-elements-to-array/index.cjs"
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
+ },
41
59
  "./ahocorasick": {
42
60
  "types": "./ahocorasick/index.d.ts",
43
61
  "import": {
@@ -47,14 +65,14 @@
47
65
  "require": "./ahocorasick/index.cjs",
48
66
  "default": "./ahocorasick/index.cjs"
49
67
  },
50
- "./append-set-elements-to-array": {
51
- "types": "./append-set-elements-to-array/index.d.ts",
68
+ "./bitwise": {
69
+ "types": "./bitwise/index.d.ts",
52
70
  "import": {
53
- "types": "./append-set-elements-to-array/index.d.ts",
54
- "default": "./append-set-elements-to-array/index.mjs"
71
+ "types": "./bitwise/index.d.ts",
72
+ "default": "./bitwise/index.mjs"
55
73
  },
56
- "require": "./append-set-elements-to-array/index.cjs",
57
- "default": "./append-set-elements-to-array/index.cjs"
74
+ "require": "./bitwise/index.cjs",
75
+ "default": "./bitwise/index.cjs"
58
76
  },
59
77
  "./fast-string-array-join": {
60
78
  "types": "./fast-string-array-join/index.d.ts",
@@ -65,6 +83,15 @@
65
83
  "require": "./fast-string-array-join/index.cjs",
66
84
  "default": "./fast-string-array-join/index.cjs"
67
85
  },
86
+ "./escape-string-regexp": {
87
+ "types": "./escape-string-regexp/index.d.ts",
88
+ "import": {
89
+ "types": "./escape-string-regexp/index.d.ts",
90
+ "default": "./escape-string-regexp/index.mjs"
91
+ },
92
+ "require": "./escape-string-regexp/index.cjs",
93
+ "default": "./escape-string-regexp/index.cjs"
94
+ },
68
95
  "./fifo": {
69
96
  "types": "./fifo/index.d.ts",
70
97
  "import": {
@@ -74,24 +101,6 @@
74
101
  "require": "./fifo/index.cjs",
75
102
  "default": "./fifo/index.cjs"
76
103
  },
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
104
  "./fnv1a": {
96
105
  "types": "./fnv1a/index.d.ts",
97
106
  "import": {
@@ -101,15 +110,6 @@
101
110
  "require": "./fnv1a/index.cjs",
102
111
  "default": "./fnv1a/index.cjs"
103
112
  },
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
113
  "./guard": {
114
114
  "types": "./guard/index.d.ts",
115
115
  "import": {
@@ -137,14 +137,14 @@
137
137
  "require": "./identity/index.cjs",
138
138
  "default": "./identity/index.cjs"
139
139
  },
140
- "./merge-headers": {
141
- "types": "./merge-headers/index.d.ts",
140
+ "./headers-to-object": {
141
+ "types": "./headers-to-object/index.d.ts",
142
142
  "import": {
143
- "types": "./merge-headers/index.d.ts",
144
- "default": "./merge-headers/index.mjs"
143
+ "types": "./headers-to-object/index.d.ts",
144
+ "default": "./headers-to-object/index.mjs"
145
145
  },
146
- "require": "./merge-headers/index.cjs",
147
- "default": "./merge-headers/index.cjs"
146
+ "require": "./headers-to-object/index.cjs",
147
+ "default": "./headers-to-object/index.cjs"
148
148
  },
149
149
  "./is-probably-ip": {
150
150
  "types": "./is-probably-ip/index.d.ts",
@@ -155,6 +155,15 @@
155
155
  "require": "./is-probably-ip/index.cjs",
156
156
  "default": "./is-probably-ip/index.cjs"
157
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
+ },
158
167
  "./noop": {
159
168
  "types": "./noop/index.d.ts",
160
169
  "import": {