@nejs/basic-extensions 1.7.0 → 1.9.0
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/README.md +518 -103
- package/dist/@nejs/basic-extensions.bundle.1.8.0.js +4 -0
- package/dist/@nejs/basic-extensions.bundle.1.8.0.js.map +7 -0
- package/dist/cjs/functionextensions.d.ts +1 -0
- package/dist/cjs/functionextensions.js +128 -18
- package/dist/cjs/functionextensions.js.map +1 -1
- package/dist/cjs/index.d.ts +5 -2
- package/dist/cjs/index.js +28 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/newClasses/deferred.d.ts +126 -0
- package/dist/cjs/newClasses/deferred.js +306 -0
- package/dist/cjs/newClasses/deferred.js.map +1 -0
- package/dist/cjs/setextensions.d.ts +2 -0
- package/dist/cjs/setextensions.js +204 -0
- package/dist/cjs/setextensions.js.map +1 -0
- package/dist/mjs/functionextensions.d.ts +1 -0
- package/dist/mjs/functionextensions.js +127 -17
- package/dist/mjs/functionextensions.js.map +1 -1
- package/dist/mjs/index.d.ts +5 -2
- package/dist/mjs/index.js +29 -6
- package/dist/mjs/index.js.map +1 -1
- package/dist/mjs/newClasses/deferred.d.ts +126 -0
- package/dist/mjs/newClasses/deferred.js +230 -0
- package/dist/mjs/newClasses/deferred.js.map +1 -0
- package/dist/mjs/setextensions.d.ts +2 -0
- package/dist/mjs/setextensions.js +201 -0
- package/dist/mjs/setextensions.js.map +1 -0
- package/docs/index.html +6119 -3461
- package/package.json +7 -4
- package/src/functionextensions.js +150 -24
- package/src/index.js +35 -6
- package/src/newClasses/deferred.js +253 -0
- package/src/setextensions.js +242 -0
- package/tests/newClasses/deferred.test.js +86 -0
- package/tests/setextensions.test.js +89 -0
- package/dist/@nejs/basic-extensions.bundle.1.6.1.js +0 -4
- package/dist/@nejs/basic-extensions.bundle.1.6.1.js.map +0 -7
package/README.md
CHANGED
|
@@ -56,120 +56,148 @@ import { FunctionExtensions } from '@nejs/basic-extensions';
|
|
|
56
56
|
#### Table of Contents
|
|
57
57
|
|
|
58
58
|
* [FunctionExtensions](#functionextensions)
|
|
59
|
-
* [
|
|
59
|
+
* [isAsync](#isasync)
|
|
60
60
|
* [Parameters](#parameters)
|
|
61
|
-
* [
|
|
61
|
+
* [isAsyncGenerator](#isasyncgenerator)
|
|
62
62
|
* [Parameters](#parameters-1)
|
|
63
|
-
* [isAsync](#isasync)
|
|
64
|
-
* [Parameters](#parameters-2)
|
|
65
63
|
* [isBigArrow](#isbigarrow)
|
|
66
|
-
* [Parameters](#parameters-
|
|
64
|
+
* [Parameters](#parameters-2)
|
|
67
65
|
* [isBound](#isbound)
|
|
66
|
+
* [Parameters](#parameters-3)
|
|
67
|
+
* [isClass](#isclass)
|
|
68
68
|
* [Parameters](#parameters-4)
|
|
69
|
+
* [isFunction](#isfunction)
|
|
70
|
+
* [Parameters](#parameters-5)
|
|
71
|
+
* [isGenerator](#isgenerator)
|
|
72
|
+
* [Parameters](#parameters-6)
|
|
73
|
+
* [isAsync](#isasync-1)
|
|
74
|
+
* [isAsyncGenerator](#isasyncgenerator-1)
|
|
75
|
+
* [isBigArrow](#isbigarrow-1)
|
|
76
|
+
* [isBound](#isbound-1)
|
|
77
|
+
* [isClass](#isclass-1)
|
|
78
|
+
* [isFunction](#isfunction-1)
|
|
79
|
+
* [isGenerator](#isgenerator-1)
|
|
69
80
|
* [ObjectExtensions](#objectextensions)
|
|
70
81
|
* [isNullDefined](#isnulldefined)
|
|
71
|
-
* [Parameters](#parameters-
|
|
82
|
+
* [Parameters](#parameters-7)
|
|
72
83
|
* [hasStringTag](#hasstringtag)
|
|
73
|
-
* [Parameters](#parameters-
|
|
84
|
+
* [Parameters](#parameters-8)
|
|
74
85
|
* [getStringTag](#getstringtag)
|
|
75
|
-
* [Parameters](#parameters-
|
|
86
|
+
* [Parameters](#parameters-9)
|
|
76
87
|
* [getType](#gettype)
|
|
77
|
-
* [Parameters](#parameters-
|
|
88
|
+
* [Parameters](#parameters-10)
|
|
78
89
|
* [isObject](#isobject)
|
|
79
|
-
* [Parameters](#parameters-
|
|
90
|
+
* [Parameters](#parameters-11)
|
|
80
91
|
* [isPrimitive](#isprimitive)
|
|
81
|
-
* [Parameters](#parameters-
|
|
92
|
+
* [Parameters](#parameters-12)
|
|
82
93
|
* [isValidKey](#isvalidkey)
|
|
83
|
-
* [Parameters](#parameters-
|
|
94
|
+
* [Parameters](#parameters-13)
|
|
84
95
|
* [stripTo](#stripto)
|
|
85
|
-
* [Parameters](#parameters-
|
|
96
|
+
* [Parameters](#parameters-14)
|
|
86
97
|
* [stripTo](#stripto-1)
|
|
87
|
-
* [Parameters](#parameters-
|
|
98
|
+
* [Parameters](#parameters-15)
|
|
88
99
|
* [getKey](#getkey)
|
|
89
|
-
* [Parameters](#parameters-
|
|
100
|
+
* [Parameters](#parameters-16)
|
|
101
|
+
* [concat](#concat)
|
|
102
|
+
* [Parameters](#parameters-17)
|
|
103
|
+
* [contains](#contains)
|
|
104
|
+
* [Parameters](#parameters-18)
|
|
105
|
+
* [every](#every)
|
|
106
|
+
* [Parameters](#parameters-19)
|
|
107
|
+
* [find](#find)
|
|
108
|
+
* [Parameters](#parameters-20)
|
|
109
|
+
* [findLast](#findlast)
|
|
110
|
+
* [Parameters](#parameters-21)
|
|
111
|
+
* [length](#length)
|
|
112
|
+
* [map](#map)
|
|
113
|
+
* [Parameters](#parameters-22)
|
|
114
|
+
* [reduce](#reduce)
|
|
115
|
+
* [Parameters](#parameters-23)
|
|
116
|
+
* [some](#some)
|
|
117
|
+
* [Parameters](#parameters-24)
|
|
90
118
|
* [ReflectExtensions](#reflectextensions)
|
|
91
119
|
* [hasAll](#hasall)
|
|
92
|
-
* [Parameters](#parameters-
|
|
120
|
+
* [Parameters](#parameters-25)
|
|
93
121
|
* [ownDescriptors](#owndescriptors)
|
|
94
|
-
* [Parameters](#parameters-
|
|
122
|
+
* [Parameters](#parameters-26)
|
|
95
123
|
* [hasSome](#hassome)
|
|
96
|
-
* [Parameters](#parameters-
|
|
124
|
+
* [Parameters](#parameters-27)
|
|
97
125
|
* [entries](#entries)
|
|
98
|
-
* [Parameters](#parameters-
|
|
126
|
+
* [Parameters](#parameters-28)
|
|
99
127
|
* [values](#values)
|
|
100
|
-
* [Parameters](#parameters-
|
|
128
|
+
* [Parameters](#parameters-29)
|
|
101
129
|
* [StringExtensions](#stringextensions)
|
|
102
130
|
* [isString](#isstring)
|
|
103
|
-
* [Parameters](#parameters-
|
|
131
|
+
* [Parameters](#parameters-30)
|
|
104
132
|
* [SymbolExtensions](#symbolextensions)
|
|
105
133
|
* [isSymbol](#issymbol)
|
|
106
|
-
* [Parameters](#parameters-
|
|
134
|
+
* [Parameters](#parameters-31)
|
|
107
135
|
* [isRegistered](#isregistered)
|
|
108
|
-
* [Parameters](#parameters-
|
|
136
|
+
* [Parameters](#parameters-32)
|
|
109
137
|
* [isNonRegistered](#isnonregistered)
|
|
110
|
-
* [Parameters](#parameters-
|
|
138
|
+
* [Parameters](#parameters-33)
|
|
111
139
|
* [ArrayPrototypeExtensions](#arrayprototypeextensions)
|
|
112
|
-
* [contains](#contains)
|
|
113
|
-
* [Parameters](#parameters-
|
|
140
|
+
* [contains](#contains-1)
|
|
141
|
+
* [Parameters](#parameters-34)
|
|
114
142
|
* [findEntry](#findentry)
|
|
115
|
-
* [Parameters](#parameters-
|
|
143
|
+
* [Parameters](#parameters-35)
|
|
116
144
|
* [first](#first)
|
|
117
145
|
* [last](#last)
|
|
118
146
|
* [object](#object)
|
|
119
147
|
* [constructor](#constructor)
|
|
120
|
-
* [Parameters](#parameters-
|
|
148
|
+
* [Parameters](#parameters-36)
|
|
121
149
|
* [isAccessor](#isaccessor)
|
|
122
150
|
* [isData](#isdata)
|
|
123
151
|
* [isDescriptor](#isdescriptor)
|
|
124
152
|
* [configurable](#configurable)
|
|
125
153
|
* [configurable](#configurable-1)
|
|
126
|
-
* [Parameters](#parameters-
|
|
154
|
+
* [Parameters](#parameters-37)
|
|
127
155
|
* [enumerable](#enumerable)
|
|
128
156
|
* [enumerable](#enumerable-1)
|
|
129
|
-
* [Parameters](#parameters-
|
|
157
|
+
* [Parameters](#parameters-38)
|
|
130
158
|
* [writable](#writable)
|
|
131
159
|
* [writable](#writable-1)
|
|
132
|
-
* [Parameters](#parameters-
|
|
160
|
+
* [Parameters](#parameters-39)
|
|
133
161
|
* [value](#value)
|
|
134
162
|
* [value](#value-1)
|
|
135
|
-
* [Parameters](#parameters-
|
|
163
|
+
* [Parameters](#parameters-40)
|
|
136
164
|
* [get](#get)
|
|
137
165
|
* [get](#get-1)
|
|
138
|
-
* [Parameters](#parameters-
|
|
166
|
+
* [Parameters](#parameters-41)
|
|
139
167
|
* [boundGet](#boundget)
|
|
140
168
|
* [set](#set)
|
|
141
169
|
* [set](#set-1)
|
|
142
|
-
* [Parameters](#parameters-
|
|
170
|
+
* [Parameters](#parameters-42)
|
|
143
171
|
* [boundSet](#boundset)
|
|
144
172
|
* [hasObject](#hasobject)
|
|
145
173
|
* [object](#object-1)
|
|
146
174
|
* [object](#object-2)
|
|
147
|
-
* [Parameters](#parameters-
|
|
175
|
+
* [Parameters](#parameters-43)
|
|
148
176
|
* [for](#for)
|
|
149
|
-
* [Parameters](#parameters-
|
|
177
|
+
* [Parameters](#parameters-44)
|
|
150
178
|
* [applyTo](#applyto)
|
|
151
|
-
* [Parameters](#parameters-
|
|
179
|
+
* [Parameters](#parameters-45)
|
|
152
180
|
* [toPrimitive](#toprimitive)
|
|
153
|
-
* [Parameters](#parameters-
|
|
181
|
+
* [Parameters](#parameters-46)
|
|
154
182
|
* [toStringTag](#tostringtag)
|
|
155
183
|
* [for](#for-1)
|
|
156
|
-
* [Parameters](#parameters-
|
|
184
|
+
* [Parameters](#parameters-47)
|
|
157
185
|
* [getData](#getdata)
|
|
158
|
-
* [Parameters](#parameters-
|
|
186
|
+
* [Parameters](#parameters-48)
|
|
159
187
|
* [getAccessor](#getaccessor)
|
|
160
|
-
* [Parameters](#parameters-
|
|
188
|
+
* [Parameters](#parameters-49)
|
|
161
189
|
* [base](#base)
|
|
162
|
-
* [Parameters](#parameters-
|
|
190
|
+
* [Parameters](#parameters-50)
|
|
163
191
|
* [accessor](#accessor)
|
|
164
|
-
* [Parameters](#parameters-
|
|
192
|
+
* [Parameters](#parameters-51)
|
|
165
193
|
* [data](#data)
|
|
166
|
-
* [Parameters](#parameters-
|
|
194
|
+
* [Parameters](#parameters-52)
|
|
167
195
|
* [isDescriptor](#isdescriptor-1)
|
|
168
|
-
* [Parameters](#parameters-
|
|
196
|
+
* [Parameters](#parameters-53)
|
|
169
197
|
* [isData](#isdata-1)
|
|
170
|
-
* [Parameters](#parameters-
|
|
198
|
+
* [Parameters](#parameters-54)
|
|
171
199
|
* [isAccessor](#isaccessor-1)
|
|
172
|
-
* [Parameters](#parameters-
|
|
200
|
+
* [Parameters](#parameters-55)
|
|
173
201
|
* [flexible](#flexible)
|
|
174
202
|
* [enigmatic](#enigmatic)
|
|
175
203
|
* [intrinsic](#intrinsic)
|
|
@@ -178,85 +206,100 @@ import { FunctionExtensions } from '@nejs/basic-extensions';
|
|
|
178
206
|
* [ACCESSOR\_KEYS](#accessor_keys)
|
|
179
207
|
* [DATA\_KEYS](#data_keys)
|
|
180
208
|
* [maskAs](#maskas)
|
|
181
|
-
* [Parameters](#parameters-
|
|
209
|
+
* [Parameters](#parameters-56)
|
|
182
210
|
* [maskAsString](#maskasstring)
|
|
183
|
-
* [Parameters](#parameters-
|
|
211
|
+
* [Parameters](#parameters-57)
|
|
184
212
|
* [maskAsNumber](#maskasnumber)
|
|
185
|
-
* [Parameters](#parameters-
|
|
213
|
+
* [Parameters](#parameters-58)
|
|
186
214
|
* [GenericMask](#genericmask)
|
|
187
|
-
* [Parameters](#parameters-
|
|
215
|
+
* [Parameters](#parameters-59)
|
|
188
216
|
* [StringMask](#stringmask)
|
|
189
|
-
* [Parameters](#parameters-
|
|
217
|
+
* [Parameters](#parameters-60)
|
|
190
218
|
* [NumberMask](#numbermask)
|
|
191
|
-
* [Parameters](#parameters-
|
|
219
|
+
* [Parameters](#parameters-61)
|
|
192
220
|
* [RefSet](#refset)
|
|
193
221
|
* [objectifying](#objectifying)
|
|
194
|
-
* [Parameters](#parameters-
|
|
222
|
+
* [Parameters](#parameters-62)
|
|
195
223
|
* [objectifyValues](#objectifyvalues)
|
|
196
224
|
* [objectifyValues](#objectifyvalues-1)
|
|
197
|
-
* [Parameters](#parameters-
|
|
225
|
+
* [Parameters](#parameters-63)
|
|
198
226
|
* [add](#add)
|
|
199
|
-
* [Parameters](#parameters-
|
|
227
|
+
* [Parameters](#parameters-64)
|
|
200
228
|
* [addAll](#addall)
|
|
201
|
-
* [Parameters](#parameters-
|
|
229
|
+
* [Parameters](#parameters-65)
|
|
202
230
|
* [clean](#clean)
|
|
203
231
|
* [entries](#entries-1)
|
|
204
|
-
* [Parameters](#parameters-
|
|
232
|
+
* [Parameters](#parameters-66)
|
|
205
233
|
* [forEach](#foreach)
|
|
206
|
-
* [Parameters](#parameters-
|
|
234
|
+
* [Parameters](#parameters-67)
|
|
207
235
|
* [values](#values-1)
|
|
208
236
|
* [keys](#keys)
|
|
209
237
|
* [has](#has)
|
|
210
|
-
* [Parameters](#parameters-
|
|
211
|
-
* [contains](#contains-
|
|
212
|
-
* [Parameters](#parameters-
|
|
238
|
+
* [Parameters](#parameters-68)
|
|
239
|
+
* [contains](#contains-2)
|
|
240
|
+
* [Parameters](#parameters-69)
|
|
213
241
|
* [filter](#filter)
|
|
214
|
-
* [Parameters](#parameters-
|
|
215
|
-
* [find](#find)
|
|
216
|
-
* [Parameters](#parameters-
|
|
217
|
-
* [map](#map)
|
|
218
|
-
* [Parameters](#parameters-
|
|
242
|
+
* [Parameters](#parameters-70)
|
|
243
|
+
* [find](#find-1)
|
|
244
|
+
* [Parameters](#parameters-71)
|
|
245
|
+
* [map](#map-1)
|
|
246
|
+
* [Parameters](#parameters-72)
|
|
219
247
|
* [toStringTag](#tostringtag-1)
|
|
220
248
|
* [RefMap](#refmap)
|
|
221
|
-
* [Parameters](#parameters-
|
|
249
|
+
* [Parameters](#parameters-73)
|
|
222
250
|
* [objectifying](#objectifying-1)
|
|
223
|
-
* [Parameters](#parameters-
|
|
251
|
+
* [Parameters](#parameters-74)
|
|
224
252
|
* [asObject](#asobject)
|
|
225
253
|
* [objectifyValues](#objectifyvalues-2)
|
|
226
254
|
* [objectifyValues](#objectifyvalues-3)
|
|
227
|
-
* [Parameters](#parameters-
|
|
255
|
+
* [Parameters](#parameters-75)
|
|
228
256
|
* [get](#get-2)
|
|
229
|
-
* [Parameters](#parameters-
|
|
257
|
+
* [Parameters](#parameters-76)
|
|
230
258
|
* [set](#set-2)
|
|
231
|
-
* [Parameters](#parameters-
|
|
259
|
+
* [Parameters](#parameters-77)
|
|
232
260
|
* [setAll](#setall)
|
|
233
|
-
* [Parameters](#parameters-
|
|
261
|
+
* [Parameters](#parameters-78)
|
|
234
262
|
* [clean](#clean-1)
|
|
235
263
|
* [entries](#entries-2)
|
|
236
|
-
* [Parameters](#parameters-
|
|
264
|
+
* [Parameters](#parameters-79)
|
|
237
265
|
* [forEach](#foreach-1)
|
|
238
|
-
* [Parameters](#parameters-
|
|
266
|
+
* [Parameters](#parameters-80)
|
|
239
267
|
* [values](#values-2)
|
|
240
268
|
* [hasValue](#hasvalue)
|
|
241
|
-
* [Parameters](#parameters-
|
|
269
|
+
* [Parameters](#parameters-81)
|
|
242
270
|
* [filter](#filter-1)
|
|
243
|
-
* [Parameters](#parameters-
|
|
244
|
-
* [find](#find-
|
|
245
|
-
* [Parameters](#parameters-
|
|
246
|
-
* [map](#map-
|
|
247
|
-
* [Parameters](#parameters-
|
|
271
|
+
* [Parameters](#parameters-82)
|
|
272
|
+
* [find](#find-2)
|
|
273
|
+
* [Parameters](#parameters-83)
|
|
274
|
+
* [map](#map-2)
|
|
275
|
+
* [Parameters](#parameters-84)
|
|
248
276
|
* [iterator](#iterator)
|
|
249
277
|
* [toStringTag](#tostringtag-2)
|
|
250
278
|
* [isValidReference](#isvalidreference)
|
|
251
|
-
* [Parameters](#parameters-
|
|
279
|
+
* [Parameters](#parameters-85)
|
|
280
|
+
* [Deferred](#deferred)
|
|
281
|
+
* [Parameters](#parameters-86)
|
|
282
|
+
* [value](#value-2)
|
|
283
|
+
* [reason](#reason)
|
|
284
|
+
* [settled](#settled)
|
|
285
|
+
* [promise](#promise)
|
|
286
|
+
* [resolve](#resolve)
|
|
287
|
+
* [Parameters](#parameters-87)
|
|
288
|
+
* [reject](#reject)
|
|
289
|
+
* [Parameters](#parameters-88)
|
|
290
|
+
* [species](#species)
|
|
291
|
+
* [promise](#promise-1)
|
|
292
|
+
* [reject](#reject-1)
|
|
293
|
+
* [resolve](#resolve-1)
|
|
294
|
+
* [settled](#settled-1)
|
|
252
295
|
* [AsyncIterable](#asynciterable)
|
|
253
|
-
* [Parameters](#parameters-
|
|
296
|
+
* [Parameters](#parameters-89)
|
|
254
297
|
* [asyncIterator](#asynciterator)
|
|
255
298
|
* [toStringTag](#tostringtag-3)
|
|
256
299
|
* [isAsyncIterable](#isasynciterable)
|
|
257
|
-
* [Parameters](#parameters-
|
|
300
|
+
* [Parameters](#parameters-90)
|
|
258
301
|
* [AsyncIterator](#asynciterator-1)
|
|
259
|
-
* [Parameters](#parameters-
|
|
302
|
+
* [Parameters](#parameters-91)
|
|
260
303
|
* [asArray](#asarray)
|
|
261
304
|
* [asyncIterable](#asynciterable-1)
|
|
262
305
|
* [next](#next)
|
|
@@ -264,14 +307,14 @@ import { FunctionExtensions } from '@nejs/basic-extensions';
|
|
|
264
307
|
* [asyncIterator](#asynciterator-2)
|
|
265
308
|
* [toStringTag](#tostringtag-4)
|
|
266
309
|
* [Iterable](#iterable)
|
|
267
|
-
* [Parameters](#parameters-
|
|
310
|
+
* [Parameters](#parameters-92)
|
|
268
311
|
* [iterator](#iterator-1)
|
|
269
312
|
* [asArray](#asarray-1)
|
|
270
313
|
* [toStringTag](#tostringtag-5)
|
|
271
314
|
* [isIterable](#isiterable)
|
|
272
|
-
* [Parameters](#parameters-
|
|
315
|
+
* [Parameters](#parameters-93)
|
|
273
316
|
* [Iterator](#iterator-2)
|
|
274
|
-
* [Parameters](#parameters-
|
|
317
|
+
* [Parameters](#parameters-94)
|
|
275
318
|
* [asArray](#asarray-2)
|
|
276
319
|
* [iterable](#iterable-1)
|
|
277
320
|
* [next](#next-1)
|
|
@@ -290,6 +333,63 @@ async functions, and arrow functions in a more intuitive and straightforward
|
|
|
290
333
|
manner. This class is part of the `@nejs/extension` library and enhances the
|
|
291
334
|
capabilities of function handling and introspection in JavaScript.
|
|
292
335
|
|
|
336
|
+
#### isAsync
|
|
337
|
+
|
|
338
|
+
Determines if a given value is an asynchronous function. It checks if the
|
|
339
|
+
value is an instance of `Function` and if its string representation
|
|
340
|
+
includes the keyword 'Async'. This method is particularly useful for
|
|
341
|
+
identifying async functions.
|
|
342
|
+
|
|
343
|
+
##### Parameters
|
|
344
|
+
|
|
345
|
+
* `value` **any** The value to be checked.
|
|
346
|
+
|
|
347
|
+
Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Returns `true` if the value is an async function,
|
|
348
|
+
otherwise `false`.
|
|
349
|
+
|
|
350
|
+
#### isAsyncGenerator
|
|
351
|
+
|
|
352
|
+
The function checks if a given value is an async generator function
|
|
353
|
+
|
|
354
|
+
##### Parameters
|
|
355
|
+
|
|
356
|
+
* `value` **any** The `value` parameter is the value that we want to
|
|
357
|
+
check if it is a generator function.
|
|
358
|
+
|
|
359
|
+
Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** `true` if the value is an instance of a function and
|
|
360
|
+
its string tag is 'AsyncGeneratorFunction', otherwise it returns `false`.
|
|
361
|
+
|
|
362
|
+
#### isBigArrow
|
|
363
|
+
|
|
364
|
+
Checks if a given value is an arrow function. It verifies if the value is
|
|
365
|
+
an instance of `Function`, if its string representation includes the '=>'
|
|
366
|
+
symbol, and if it lacks a prototype, which is a characteristic of arrow
|
|
367
|
+
functions in JavaScript.
|
|
368
|
+
|
|
369
|
+
##### Parameters
|
|
370
|
+
|
|
371
|
+
* `value` **any** The value to be checked.
|
|
372
|
+
|
|
373
|
+
Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Returns `true` if the value is an arrow function,
|
|
374
|
+
otherwise `false`.
|
|
375
|
+
|
|
376
|
+
#### isBound
|
|
377
|
+
|
|
378
|
+
Determines if a given value is a bound function. Bound functions are
|
|
379
|
+
created using the `Function.prototype.bind` method, which allows setting
|
|
380
|
+
the `this` value at the time of binding. This method checks if the value
|
|
381
|
+
is an instance of `Function`, if its string representation starts with
|
|
382
|
+
'bound', and if it lacks a `prototype` property. These characteristics
|
|
383
|
+
are indicative of bound functions in JavaScript.
|
|
384
|
+
|
|
385
|
+
##### Parameters
|
|
386
|
+
|
|
387
|
+
* `value` **any** The value to be checked, typically a function.
|
|
388
|
+
|
|
389
|
+
Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Returns `true` if the value is a bound function,
|
|
390
|
+
otherwise `false`. Bound functions have a specific format in their
|
|
391
|
+
string representation and do not have their own `prototype` property.
|
|
392
|
+
|
|
293
393
|
#### isClass
|
|
294
394
|
|
|
295
395
|
Determines if a given value is a class. It checks if the value is an
|
|
@@ -317,35 +417,46 @@ classes, and async functions but excludes arrow functions.
|
|
|
317
417
|
Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Returns `true` if the value is a regular function,
|
|
318
418
|
otherwise `false`.
|
|
319
419
|
|
|
320
|
-
####
|
|
420
|
+
#### isGenerator
|
|
421
|
+
|
|
422
|
+
The function checks if a given value is a generator function
|
|
423
|
+
|
|
424
|
+
##### Parameters
|
|
425
|
+
|
|
426
|
+
* `value` **any** The `value` parameter is the value that we want to
|
|
427
|
+
check if it is a generator function.
|
|
428
|
+
|
|
429
|
+
Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** `true` if the value is an instance of a function and
|
|
430
|
+
its string tag is 'GeneratorFunction', otherwise it returns `false`.
|
|
431
|
+
|
|
432
|
+
### isAsync
|
|
321
433
|
|
|
322
434
|
Determines if a given value is an asynchronous function. It checks if the
|
|
323
435
|
value is an instance of `Function` and if its string representation
|
|
324
436
|
includes the keyword 'Async'. This method is particularly useful for
|
|
325
437
|
identifying async functions.
|
|
326
438
|
|
|
327
|
-
##### Parameters
|
|
328
|
-
|
|
329
|
-
* `value` **any** The value to be checked.
|
|
330
|
-
|
|
331
439
|
Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Returns `true` if the value is an async function,
|
|
332
440
|
otherwise `false`.
|
|
333
441
|
|
|
334
|
-
|
|
442
|
+
### isAsyncGenerator
|
|
443
|
+
|
|
444
|
+
The function checks if a given value is an async generator function
|
|
445
|
+
|
|
446
|
+
Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** `true` if the value is an instance of a function and
|
|
447
|
+
its string tag is 'AsyncGeneratorFunction', otherwise it returns `false`.
|
|
448
|
+
|
|
449
|
+
### isBigArrow
|
|
335
450
|
|
|
336
451
|
Checks if a given value is an arrow function. It verifies if the value is
|
|
337
452
|
an instance of `Function`, if its string representation includes the '=>'
|
|
338
453
|
symbol, and if it lacks a prototype, which is a characteristic of arrow
|
|
339
454
|
functions in JavaScript.
|
|
340
455
|
|
|
341
|
-
##### Parameters
|
|
342
|
-
|
|
343
|
-
* `value` **any** The value to be checked.
|
|
344
|
-
|
|
345
456
|
Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Returns `true` if the value is an arrow function,
|
|
346
457
|
otherwise `false`.
|
|
347
458
|
|
|
348
|
-
|
|
459
|
+
### isBound
|
|
349
460
|
|
|
350
461
|
Determines if a given value is a bound function. Bound functions are
|
|
351
462
|
created using the `Function.prototype.bind` method, which allows setting
|
|
@@ -354,14 +465,36 @@ is an instance of `Function`, if its string representation starts with
|
|
|
354
465
|
'bound', and if it lacks a `prototype` property. These characteristics
|
|
355
466
|
are indicative of bound functions in JavaScript.
|
|
356
467
|
|
|
357
|
-
##### Parameters
|
|
358
|
-
|
|
359
|
-
* `value` **any** The value to be checked, typically a function.
|
|
360
|
-
|
|
361
468
|
Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Returns `true` if the value is a bound function,
|
|
362
469
|
otherwise `false`. Bound functions have a specific format in their
|
|
363
470
|
string representation and do not have their own `prototype` property.
|
|
364
471
|
|
|
472
|
+
### isClass
|
|
473
|
+
|
|
474
|
+
Determines if a given value is a class. It checks if the value is an
|
|
475
|
+
instance of `Function` and if its string representation includes the
|
|
476
|
+
keyword 'class'. This method is useful for distinguishing classes from
|
|
477
|
+
other function types in JavaScript.
|
|
478
|
+
|
|
479
|
+
Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Returns `true` if the value is a class, otherwise
|
|
480
|
+
`false`.
|
|
481
|
+
|
|
482
|
+
### isFunction
|
|
483
|
+
|
|
484
|
+
Checks if a given value is a regular function. This method verifies if
|
|
485
|
+
the value is an instance of `Function`, which includes regular functions,
|
|
486
|
+
classes, and async functions but excludes arrow functions.
|
|
487
|
+
|
|
488
|
+
Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Returns `true` if the value is a regular function,
|
|
489
|
+
otherwise `false`.
|
|
490
|
+
|
|
491
|
+
### isGenerator
|
|
492
|
+
|
|
493
|
+
The function checks if a given value is a generator function
|
|
494
|
+
|
|
495
|
+
Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** `true` if the value is an instance of a function and
|
|
496
|
+
its string tag is 'GeneratorFunction', otherwise it returns `false`.
|
|
497
|
+
|
|
365
498
|
### ObjectExtensions
|
|
366
499
|
|
|
367
500
|
`ObjectExtensions` is a patch for the JavaScript built-in `Object` class.
|
|
@@ -529,6 +662,159 @@ in a map.
|
|
|
529
662
|
Returns **any** the key associated with the given value. If a matching key is
|
|
530
663
|
found, it is returned. If no matching key is found, null is returned.
|
|
531
664
|
|
|
665
|
+
### concat
|
|
666
|
+
|
|
667
|
+
Merges multiple iterables into the set. Each element from the iterables
|
|
668
|
+
is added to the set, ensuring uniqueness of all elements. This method
|
|
669
|
+
mutates the original set.
|
|
670
|
+
|
|
671
|
+
#### Parameters
|
|
672
|
+
|
|
673
|
+
* `iterables` **...[Iterable](#iterable)** One or more iterable objects (like Set
|
|
674
|
+
or Array) whose elements will be added to the set.
|
|
675
|
+
|
|
676
|
+
### contains
|
|
677
|
+
|
|
678
|
+
Checks to see if any value within the `Set` loosely equals the supplied
|
|
679
|
+
value.
|
|
680
|
+
|
|
681
|
+
#### Parameters
|
|
682
|
+
|
|
683
|
+
* `value` **any** any value that might be loosely equal to an item in the
|
|
684
|
+
set, as opposed to [Set.has](Set.has) which is the equivalent of a strict or
|
|
685
|
+
triple equals (`===`) check
|
|
686
|
+
|
|
687
|
+
Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** `true` if any value within the set is loosely equal to
|
|
688
|
+
the supplied value, `false` otherwise
|
|
689
|
+
|
|
690
|
+
### every
|
|
691
|
+
|
|
692
|
+
Checks if every element in the set passes the test implemented by the
|
|
693
|
+
provided function. The function is called with each element of the set.
|
|
694
|
+
Note: Since sets do not have indices, the index parameter is always NaN.
|
|
695
|
+
|
|
696
|
+
#### Parameters
|
|
697
|
+
|
|
698
|
+
* `everyFn` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** The function to test each element. Receives
|
|
699
|
+
the element, index (always NaN), and the set itself.
|
|
700
|
+
* `thisArg` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Optional. Value to use as `this` when executing
|
|
701
|
+
`everyFn`.
|
|
702
|
+
|
|
703
|
+
<!---->
|
|
704
|
+
|
|
705
|
+
* Throws **[TypeError](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypeError)** If `everyFn` is not a function.
|
|
706
|
+
|
|
707
|
+
Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** True if every element passes the test, false otherwise.
|
|
708
|
+
|
|
709
|
+
### find
|
|
710
|
+
|
|
711
|
+
Finds the first element in the set satisfying the provided testing
|
|
712
|
+
function. If no elements satisfy the testing function, undefined is
|
|
713
|
+
returned. The function is called with each element of the set.
|
|
714
|
+
Note: Since sets do not have indices, the index parameter is always NaN.
|
|
715
|
+
|
|
716
|
+
#### Parameters
|
|
717
|
+
|
|
718
|
+
* `findFn` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** The function to execute on each element. It
|
|
719
|
+
receives the element, index (always NaN), and the set itself.
|
|
720
|
+
* `thisArg` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Optional. Value to use as `this` when executing
|
|
721
|
+
`findFn`.
|
|
722
|
+
|
|
723
|
+
<!---->
|
|
724
|
+
|
|
725
|
+
* Throws **[TypeError](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypeError)** If `findFn` is not a function.
|
|
726
|
+
|
|
727
|
+
Returns **any** The first element that satisfies `findFn`, or undefined.
|
|
728
|
+
|
|
729
|
+
### findLast
|
|
730
|
+
|
|
731
|
+
Finds the last element in the set satisfying the provided testing function.
|
|
732
|
+
If no elements satisfy the testing function, undefined is returned. The
|
|
733
|
+
function is called with each element of the set in reverse order.
|
|
734
|
+
Note: Since sets do not have indices, the index parameter is always NaN.
|
|
735
|
+
|
|
736
|
+
#### Parameters
|
|
737
|
+
|
|
738
|
+
* `findFn` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** The function to execute on each element. It
|
|
739
|
+
receives the element, index (always NaN), and the set itself.
|
|
740
|
+
* `thisArg` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Optional. Value to use as `this` when executing
|
|
741
|
+
`findFn`.
|
|
742
|
+
|
|
743
|
+
<!---->
|
|
744
|
+
|
|
745
|
+
* Throws **[TypeError](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypeError)** If `findFn` is not a function.
|
|
746
|
+
|
|
747
|
+
Returns **any** The last element that satisfies `findFn`, or undefined.
|
|
748
|
+
|
|
749
|
+
### length
|
|
750
|
+
|
|
751
|
+
A getter property that returns the number of elements in the set.
|
|
752
|
+
This is an alias for the `size` property of the set.
|
|
753
|
+
|
|
754
|
+
Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** The number of elements in the set.
|
|
755
|
+
|
|
756
|
+
### map
|
|
757
|
+
|
|
758
|
+
Creates a new array populated with the results of calling the provided
|
|
759
|
+
function on every element in the set. The function is called with each
|
|
760
|
+
element of the set. Note: Since sets do not have indices, the index
|
|
761
|
+
parameter is always NaN.
|
|
762
|
+
|
|
763
|
+
#### Parameters
|
|
764
|
+
|
|
765
|
+
* `mapFn` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** The function to execute on each element. It
|
|
766
|
+
receives the element, index (always NaN), and the set itself.
|
|
767
|
+
* `thisArg` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Optional. Value to use as `this` when executing
|
|
768
|
+
`mapFn`.
|
|
769
|
+
|
|
770
|
+
<!---->
|
|
771
|
+
|
|
772
|
+
* Throws **[TypeError](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypeError)** If `mapFn` is not a function.
|
|
773
|
+
|
|
774
|
+
Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)** A new array with each element being the result of the
|
|
775
|
+
`mapFn`.
|
|
776
|
+
|
|
777
|
+
### reduce
|
|
778
|
+
|
|
779
|
+
Applies a function against an accumulator and each element in the set to
|
|
780
|
+
reduce it to a single value. The function is called with each element of
|
|
781
|
+
the set. Note: Since sets do not have indices, the index parameter is
|
|
782
|
+
always NaN.
|
|
783
|
+
|
|
784
|
+
#### Parameters
|
|
785
|
+
|
|
786
|
+
* `reduceFn` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** The function to execute on each element. It
|
|
787
|
+
receives the accumulator, element, index (always NaN), and the set itself.
|
|
788
|
+
* `initialValue` **any** The initial value to start reducing from.
|
|
789
|
+
* `thisArg` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Optional. Value to use as `this` when executing
|
|
790
|
+
`reduceFn`.
|
|
791
|
+
|
|
792
|
+
<!---->
|
|
793
|
+
|
|
794
|
+
* Throws **[TypeError](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypeError)** If `reduceFn` is not a function.
|
|
795
|
+
|
|
796
|
+
Returns **any** The reduced value.
|
|
797
|
+
|
|
798
|
+
### some
|
|
799
|
+
|
|
800
|
+
Tests whether at least one element in the set passes the test implemented
|
|
801
|
+
by the provided function. The function is called with each element of the
|
|
802
|
+
set. Note: Since sets do not have indices, the index parameter is always NaN.
|
|
803
|
+
|
|
804
|
+
#### Parameters
|
|
805
|
+
|
|
806
|
+
* `someFn` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** The function to test each element. It receives
|
|
807
|
+
the element, index (always NaN), and the set itself.
|
|
808
|
+
* `thisArg` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Optional. Value to use as `this` when executing
|
|
809
|
+
`someFn`.
|
|
810
|
+
|
|
811
|
+
<!---->
|
|
812
|
+
|
|
813
|
+
* Throws **[TypeError](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypeError)** If `someFn` is not a function.
|
|
814
|
+
|
|
815
|
+
Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** True if at least one element passes the test, false
|
|
816
|
+
otherwise.
|
|
817
|
+
|
|
532
818
|
### ReflectExtensions
|
|
533
819
|
|
|
534
820
|
The `ReflectExtensions` class is a patch applied to the built-in JavaScript
|
|
@@ -1841,6 +2127,135 @@ A static method to check if a given value is a valid target for a WeakRef.
|
|
|
1841
2127
|
Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** True if the value is a valid WeakRef target,
|
|
1842
2128
|
false otherwise.
|
|
1843
2129
|
|
|
2130
|
+
### Deferred
|
|
2131
|
+
|
|
2132
|
+
**Extends Promise**
|
|
2133
|
+
|
|
2134
|
+
Deferreds, which were first introduced by jQuery for browsers in the early
|
|
2135
|
+
2000s, are a way to manage asynchronous operations. They have been widely
|
|
2136
|
+
used and replicated by engineers since then. Although the Promise class in
|
|
2137
|
+
modern JavaScript provides a static method called `withResolvers` that
|
|
2138
|
+
returns an object with similar properties to a Deferred, it is not directly
|
|
2139
|
+
supported by Node.js.
|
|
2140
|
+
|
|
2141
|
+
const withResolvers = Promise.withResolvers()
|
|
2142
|
+
Reflect.has(withResolvers, 'promise') // true
|
|
2143
|
+
Reflect.has(withResolvers, 'resolve') // true
|
|
2144
|
+
Reflect.has(withResolvers, 'reject') // true
|
|
2145
|
+
|
|
2146
|
+
This Deferred class extends the Promise class, allowing it to capture the
|
|
2147
|
+
value or reason for easy access after resolution, akin to
|
|
2148
|
+
[Promise.withResolvers](Promise.withResolvers). As it extends [Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise), it is
|
|
2149
|
+
'thenable' and works with `await` as if it were a native Promise. This
|
|
2150
|
+
allows seamless integration with code expecting Promise-like objects.
|
|
2151
|
+
|
|
2152
|
+
#### Parameters
|
|
2153
|
+
|
|
2154
|
+
* `options` **[object](#object)** see above for examples on supported options, but
|
|
2155
|
+
when supplied, the constructor can take instructions on how to auto
|
|
2156
|
+
resolve or reject the deferred created here.
|
|
2157
|
+
|
|
2158
|
+
#### value
|
|
2159
|
+
|
|
2160
|
+
When the Deferred is settled with [Deferred.resolve](Deferred.resolve), the `value`
|
|
2161
|
+
passed to that function will be set here as well.
|
|
2162
|
+
|
|
2163
|
+
Type: any
|
|
2164
|
+
|
|
2165
|
+
#### reason
|
|
2166
|
+
|
|
2167
|
+
When the Deferred is settled with [Deferred.reject](Deferred.reject), the `reason`
|
|
2168
|
+
passed to that rejection will also be stored here.
|
|
2169
|
+
|
|
2170
|
+
Type: any
|
|
2171
|
+
|
|
2172
|
+
#### settled
|
|
2173
|
+
|
|
2174
|
+
Returns a boolean value that indicates whether or not this Deferred
|
|
2175
|
+
has been settled (either resolve or reject have been invoked).
|
|
2176
|
+
|
|
2177
|
+
Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** `true` if either [Deferred.resolve](Deferred.resolve) or
|
|
2178
|
+
[Deferred.reject](Deferred.reject) have been invoked; `false` otherwise
|
|
2179
|
+
|
|
2180
|
+
#### promise
|
|
2181
|
+
|
|
2182
|
+
Accessor for the promise managed by this Deferred instance.
|
|
2183
|
+
|
|
2184
|
+
This getter provides access to the internal promise which is controlled
|
|
2185
|
+
by the Deferred's resolve and reject methods. It allows external code to
|
|
2186
|
+
attach callbacks for the resolution or rejection of the Deferred without
|
|
2187
|
+
the ability to directly resolve or reject it.
|
|
2188
|
+
|
|
2189
|
+
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)** The promise controlled by this Deferred instance.
|
|
2190
|
+
|
|
2191
|
+
#### resolve
|
|
2192
|
+
|
|
2193
|
+
Resolves the Deferred with the given value. If the value is a thenable
|
|
2194
|
+
(i.e., has a "then" method), the Deferred will "follow" that thenable,
|
|
2195
|
+
adopting its eventual state; otherwise, the Deferred will be fulfilled
|
|
2196
|
+
with the value. This function behaves the same as Promise.resolve.
|
|
2197
|
+
|
|
2198
|
+
##### Parameters
|
|
2199
|
+
|
|
2200
|
+
* `value` **any** The value to resolve the Deferred with.
|
|
2201
|
+
|
|
2202
|
+
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A Promise that is resolved with the given value.
|
|
2203
|
+
|
|
2204
|
+
#### reject
|
|
2205
|
+
|
|
2206
|
+
Rejects the Deferred with the given reason. This function behaves the
|
|
2207
|
+
same as Promise.reject. The Deferred will be rejected with the provided
|
|
2208
|
+
reason.
|
|
2209
|
+
|
|
2210
|
+
##### Parameters
|
|
2211
|
+
|
|
2212
|
+
* `reason` **any** The reason to reject the Deferred with.
|
|
2213
|
+
|
|
2214
|
+
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A Promise that is rejected with the given reason.
|
|
2215
|
+
|
|
2216
|
+
#### species
|
|
2217
|
+
|
|
2218
|
+
A getter for the species symbol which returns a custom DeferredPromise
|
|
2219
|
+
class. This class extends from Deferred and is used to ensure that the
|
|
2220
|
+
constructor signature matches that of a Promise. The executor function
|
|
2221
|
+
passed to the constructor of this class is used to initialize the Deferred
|
|
2222
|
+
object with resolve and reject functions, similar to how a Promise would
|
|
2223
|
+
be initialized.
|
|
2224
|
+
|
|
2225
|
+
Returns **DeferredPromise** A DeferredPromise class that extends Deferred.
|
|
2226
|
+
|
|
2227
|
+
### promise
|
|
2228
|
+
|
|
2229
|
+
The promise backing this deferred object. Created when the constructor
|
|
2230
|
+
runs, this promise is what all `Promise.prototype` functions are routed
|
|
2231
|
+
to.
|
|
2232
|
+
|
|
2233
|
+
Type: [Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)
|
|
2234
|
+
|
|
2235
|
+
### reject
|
|
2236
|
+
|
|
2237
|
+
The reject() resolver that will be assigned when a new instance is
|
|
2238
|
+
created. Invoking this function with or without a `reason` will cause
|
|
2239
|
+
the deferred's promise to be settled.
|
|
2240
|
+
|
|
2241
|
+
Type: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)
|
|
2242
|
+
|
|
2243
|
+
### resolve
|
|
2244
|
+
|
|
2245
|
+
The resolve() resolver that will be assigned when a new instance is
|
|
2246
|
+
created. Invoking this function with or without a `value` will cause
|
|
2247
|
+
the deferred's promise to be settled.
|
|
2248
|
+
|
|
2249
|
+
Type: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)
|
|
2250
|
+
|
|
2251
|
+
### settled
|
|
2252
|
+
|
|
2253
|
+
When either [Deferred.resolve](Deferred.resolve) or [Deferred.reject](Deferred.reject) are called,
|
|
2254
|
+
this property is set to `true`. Its current status at any time can be
|
|
2255
|
+
queried using the [Deferred.settled](Deferred.settled) getter.
|
|
2256
|
+
|
|
2257
|
+
Type: [boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)
|
|
2258
|
+
|
|
1844
2259
|
### AsyncIterable
|
|
1845
2260
|
|
|
1846
2261
|
The AsyncIterable class extends the concept of Iterable to asynchronous
|