foxts 1.5.0 → 1.5.1
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/guard/index.cjs +1 -1
- package/guard/index.d.ts +1 -1
- package/guard/index.mjs +1 -1
- package/package.json +46 -46
package/guard/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function r(r){switch(r){case null:return r=>null!==r;case void 0:return r=>void 0!==r;case!1:return r=>!1!==r;case"nullish":return r=>null!=r;case"falsy":return r=>!!r;default:
|
|
1
|
+
"use strict";function r(r){switch(r){case null:return r=>null!==r;case void 0:return r=>void 0!==r;case!1:return r=>!1!==r;case"nullish":return r=>null!=r;case"falsy":return r=>!!r;default:l(r,"argument")}}function n(r){switch(r){case null:return r=>null===r;case void 0:return r=>void 0===r;case!1:return r=>!1===r;case"nullish":return r=>null==r;case"falsy":return r=>!r;case"truthy":return r=>!!r;default:l(r,"argument")}}const e=n("truthy"),t=n("falsy"),u=r(null),s=r("nullish");function l(r,n="value"){throw TypeError(`Unexpected ${n}: ${r} as ${JSON.stringify(typeof r)}, should be "never"`)}exports.invariant=function(r,n='[foxts/invariant] "value" is null or undefined'){if(null==r)throw TypeError(n)},exports.is=n,exports.isFalsy=t,exports.isNonNull=u,exports.isNonNullish=s,exports.isTruthy=e,exports.never=l,exports.not=r,exports.nullthrow=function(r,n='[foxts/invariant] "value" is null or undefined'){if(null==r)throw TypeError(n);return r};
|
package/guard/index.d.ts
CHANGED
|
@@ -15,6 +15,6 @@ declare const isNonNull: <T>(i: T | null) => i is T;
|
|
|
15
15
|
declare const isNonNullish: <T>(i: T | null | undefined) => i is T;
|
|
16
16
|
declare function nullthrow<T>(value: T | null | undefined, message?: string): T;
|
|
17
17
|
declare function invariant<T>(value: T | null | undefined, message?: string): asserts value is T;
|
|
18
|
-
declare function never(value: never): never;
|
|
18
|
+
declare function never(value: never, valueMetaName?: string): never;
|
|
19
19
|
|
|
20
20
|
export { invariant, is, isFalsy, isNonNull, isNonNullish, isTruthy, never, not, nullthrow };
|
package/guard/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function n(n){switch(n){case null:return n=>null!==n;case void 0:return n=>void 0!==n;case!1:return n=>!1!==n;case"nullish":return n=>null!=n;case"falsy":return n=>!!n;default:
|
|
1
|
+
function n(n){switch(n){case null:return n=>null!==n;case void 0:return n=>void 0!==n;case!1:return n=>!1!==n;case"nullish":return n=>null!=n;case"falsy":return n=>!!n;default:a(n,"argument")}}function r(n){switch(n){case null:return n=>null===n;case void 0:return n=>void 0===n;case!1:return n=>!1===n;case"nullish":return n=>null==n;case"falsy":return n=>!n;case"truthy":return n=>!!n;default:a(n,"argument")}}const e=r("truthy"),u=r("falsy"),l=n(null),t=n("nullish");function i(n,r='[foxts/invariant] "value" is null or undefined'){if(null==n)throw TypeError(r);return n}function s(n,r='[foxts/invariant] "value" is null or undefined'){if(null==n)throw TypeError(r)}function a(n,r="value"){throw TypeError(`Unexpected ${r}: ${n} as ${JSON.stringify(typeof n)}, should be "never"`)}export{s as invariant,r as is,u as isFalsy,l as isNonNull,t as isNonNullish,e as isTruthy,a as never,n as not,i as nullthrow};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "foxts",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"description": "Opinionated collection of common TypeScript utils by @SukkaW",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "https://github.com/SukkaW/foxts"
|
|
@@ -50,6 +50,15 @@
|
|
|
50
50
|
"require": "./ahocorasick/index.cjs",
|
|
51
51
|
"default": "./ahocorasick/index.cjs"
|
|
52
52
|
},
|
|
53
|
+
"./append-set-elements-to-array": {
|
|
54
|
+
"types": "./append-set-elements-to-array/index.d.ts",
|
|
55
|
+
"import": {
|
|
56
|
+
"types": "./append-set-elements-to-array/index.d.ts",
|
|
57
|
+
"default": "./append-set-elements-to-array/index.mjs"
|
|
58
|
+
},
|
|
59
|
+
"require": "./append-set-elements-to-array/index.cjs",
|
|
60
|
+
"default": "./append-set-elements-to-array/index.cjs"
|
|
61
|
+
},
|
|
53
62
|
"./async-write-to-stream": {
|
|
54
63
|
"types": "./async-write-to-stream/index.d.ts",
|
|
55
64
|
"import": {
|
|
@@ -77,15 +86,6 @@
|
|
|
77
86
|
"require": "./create-fixed-array/index.cjs",
|
|
78
87
|
"default": "./create-fixed-array/index.cjs"
|
|
79
88
|
},
|
|
80
|
-
"./append-set-elements-to-array": {
|
|
81
|
-
"types": "./append-set-elements-to-array/index.d.ts",
|
|
82
|
-
"import": {
|
|
83
|
-
"types": "./append-set-elements-to-array/index.d.ts",
|
|
84
|
-
"default": "./append-set-elements-to-array/index.mjs"
|
|
85
|
-
},
|
|
86
|
-
"require": "./append-set-elements-to-array/index.cjs",
|
|
87
|
-
"default": "./append-set-elements-to-array/index.cjs"
|
|
88
|
-
},
|
|
89
89
|
"./detect-eol": {
|
|
90
90
|
"types": "./detect-eol/index.d.ts",
|
|
91
91
|
"import": {
|
|
@@ -104,15 +104,6 @@
|
|
|
104
104
|
"require": "./escape-string-regexp/index.cjs",
|
|
105
105
|
"default": "./escape-string-regexp/index.cjs"
|
|
106
106
|
},
|
|
107
|
-
"./fast-string-array-join": {
|
|
108
|
-
"types": "./fast-string-array-join/index.d.ts",
|
|
109
|
-
"import": {
|
|
110
|
-
"types": "./fast-string-array-join/index.d.ts",
|
|
111
|
-
"default": "./fast-string-array-join/index.mjs"
|
|
112
|
-
},
|
|
113
|
-
"require": "./fast-string-array-join/index.cjs",
|
|
114
|
-
"default": "./fast-string-array-join/index.cjs"
|
|
115
|
-
},
|
|
116
107
|
"./fifo": {
|
|
117
108
|
"types": "./fifo/index.d.ts",
|
|
118
109
|
"import": {
|
|
@@ -131,14 +122,14 @@
|
|
|
131
122
|
"require": "./fnv1a/index.cjs",
|
|
132
123
|
"default": "./fnv1a/index.cjs"
|
|
133
124
|
},
|
|
134
|
-
"./
|
|
135
|
-
"types": "./
|
|
125
|
+
"./fnv1a52": {
|
|
126
|
+
"types": "./fnv1a52/index.d.ts",
|
|
136
127
|
"import": {
|
|
137
|
-
"types": "./
|
|
138
|
-
"default": "./
|
|
128
|
+
"types": "./fnv1a52/index.d.ts",
|
|
129
|
+
"default": "./fnv1a52/index.mjs"
|
|
139
130
|
},
|
|
140
|
-
"require": "./
|
|
141
|
-
"default": "./
|
|
131
|
+
"require": "./fnv1a52/index.cjs",
|
|
132
|
+
"default": "./fnv1a52/index.cjs"
|
|
142
133
|
},
|
|
143
134
|
"./guard": {
|
|
144
135
|
"types": "./guard/index.d.ts",
|
|
@@ -149,14 +140,14 @@
|
|
|
149
140
|
"require": "./guard/index.cjs",
|
|
150
141
|
"default": "./guard/index.cjs"
|
|
151
142
|
},
|
|
152
|
-
"./
|
|
153
|
-
"types": "./
|
|
143
|
+
"./headers-to-object": {
|
|
144
|
+
"types": "./headers-to-object/index.d.ts",
|
|
154
145
|
"import": {
|
|
155
|
-
"types": "./
|
|
156
|
-
"default": "./
|
|
146
|
+
"types": "./headers-to-object/index.d.ts",
|
|
147
|
+
"default": "./headers-to-object/index.mjs"
|
|
157
148
|
},
|
|
158
|
-
"require": "./
|
|
159
|
-
"default": "./
|
|
149
|
+
"require": "./headers-to-object/index.cjs",
|
|
150
|
+
"default": "./headers-to-object/index.cjs"
|
|
160
151
|
},
|
|
161
152
|
"./identity": {
|
|
162
153
|
"types": "./identity/index.d.ts",
|
|
@@ -167,14 +158,14 @@
|
|
|
167
158
|
"require": "./identity/index.cjs",
|
|
168
159
|
"default": "./identity/index.cjs"
|
|
169
160
|
},
|
|
170
|
-
"./
|
|
171
|
-
"types": "./
|
|
161
|
+
"./is-probably-ip": {
|
|
162
|
+
"types": "./is-probably-ip/index.d.ts",
|
|
172
163
|
"import": {
|
|
173
|
-
"types": "./
|
|
174
|
-
"default": "./
|
|
164
|
+
"types": "./is-probably-ip/index.d.ts",
|
|
165
|
+
"default": "./is-probably-ip/index.mjs"
|
|
175
166
|
},
|
|
176
|
-
"require": "./
|
|
177
|
-
"default": "./
|
|
167
|
+
"require": "./is-probably-ip/index.cjs",
|
|
168
|
+
"default": "./is-probably-ip/index.cjs"
|
|
178
169
|
},
|
|
179
170
|
"./merge-headers": {
|
|
180
171
|
"types": "./merge-headers/index.d.ts",
|
|
@@ -185,6 +176,15 @@
|
|
|
185
176
|
"require": "./merge-headers/index.cjs",
|
|
186
177
|
"default": "./merge-headers/index.cjs"
|
|
187
178
|
},
|
|
179
|
+
"./noop": {
|
|
180
|
+
"types": "./noop/index.d.ts",
|
|
181
|
+
"import": {
|
|
182
|
+
"types": "./noop/index.d.ts",
|
|
183
|
+
"default": "./noop/index.mjs"
|
|
184
|
+
},
|
|
185
|
+
"require": "./noop/index.cjs",
|
|
186
|
+
"default": "./noop/index.cjs"
|
|
187
|
+
},
|
|
188
188
|
"./once": {
|
|
189
189
|
"types": "./once/index.d.ts",
|
|
190
190
|
"import": {
|
|
@@ -203,15 +203,6 @@
|
|
|
203
203
|
"require": "./pick-random/index.cjs",
|
|
204
204
|
"default": "./pick-random/index.cjs"
|
|
205
205
|
},
|
|
206
|
-
"./fnv1a52": {
|
|
207
|
-
"types": "./fnv1a52/index.d.ts",
|
|
208
|
-
"import": {
|
|
209
|
-
"types": "./fnv1a52/index.d.ts",
|
|
210
|
-
"default": "./fnv1a52/index.mjs"
|
|
211
|
-
},
|
|
212
|
-
"require": "./fnv1a52/index.cjs",
|
|
213
|
-
"default": "./fnv1a52/index.cjs"
|
|
214
|
-
},
|
|
215
206
|
"./random-int": {
|
|
216
207
|
"types": "./random-int/index.d.ts",
|
|
217
208
|
"import": {
|
|
@@ -274,6 +265,15 @@
|
|
|
274
265
|
},
|
|
275
266
|
"require": "./wait/index.cjs",
|
|
276
267
|
"default": "./wait/index.cjs"
|
|
268
|
+
},
|
|
269
|
+
"./fast-string-array-join": {
|
|
270
|
+
"types": "./fast-string-array-join/index.d.ts",
|
|
271
|
+
"import": {
|
|
272
|
+
"types": "./fast-string-array-join/index.d.ts",
|
|
273
|
+
"default": "./fast-string-array-join/index.mjs"
|
|
274
|
+
},
|
|
275
|
+
"require": "./fast-string-array-join/index.cjs",
|
|
276
|
+
"default": "./fast-string-array-join/index.cjs"
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
279
|
}
|