@knime/utils 2.0.1 → 2.0.3
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/CHANGELOG.md +15 -0
- package/LICENSE +7 -708
- package/dist/index.js.map +1 -1
- package/dist/src/fileExtensions.d.ts +9 -4
- package/dist/src/fileExtensions.d.ts.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @knime/utils
|
|
2
2
|
|
|
3
|
+
## 2.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 2352be0: Raise the `dompurify` dependency to `^3.4.16` to fix GHSA-p98j-92pf-mc4p.
|
|
8
|
+
|
|
9
|
+
## 2.0.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 2725ccb: Adjust API for file extension utils
|
|
14
|
+
|
|
15
|
+
No longer require a full `File` object instance, which is not really used. Instead, take an interface that
|
|
16
|
+
just declares the necessary properties required and used by the utils
|
|
17
|
+
|
|
3
18
|
## 2.0.1
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/LICENSE
CHANGED
|
@@ -1,710 +1,9 @@
|
|
|
1
|
+
Copyright (c) KNIME AG, Zurich, Switzerland. All rights reserved.
|
|
1
2
|
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
applying to the files in this folder:
|
|
3
|
+
This source code, its documentation and all appendant files
|
|
4
|
+
are protected by copyright law. All rights reserved.
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
|
12
|
-
Everyone is permitted to copy and distribute verbatim copies
|
|
13
|
-
of this license document, but changing it is not allowed.
|
|
14
|
-
|
|
15
|
-
Preamble
|
|
16
|
-
|
|
17
|
-
The GNU General Public License is a free, copyleft license for
|
|
18
|
-
software and other kinds of works.
|
|
19
|
-
|
|
20
|
-
The licenses for most software and other practical works are designed
|
|
21
|
-
to take away your freedom to share and change the works. By contrast,
|
|
22
|
-
the GNU General Public License is intended to guarantee your freedom to
|
|
23
|
-
share and change all versions of a program--to make sure it remains free
|
|
24
|
-
software for all its users. We, the Free Software Foundation, use the
|
|
25
|
-
GNU General Public License for most of our software; it applies also to
|
|
26
|
-
any other work released this way by its authors. You can apply it to
|
|
27
|
-
your programs, too.
|
|
28
|
-
|
|
29
|
-
When we speak of free software, we are referring to freedom, not
|
|
30
|
-
price. Our General Public Licenses are designed to make sure that you
|
|
31
|
-
have the freedom to distribute copies of free software (and charge for
|
|
32
|
-
them if you wish), that you receive source code or can get it if you
|
|
33
|
-
want it, that you can change the software or use pieces of it in new
|
|
34
|
-
free programs, and that you know you can do these things.
|
|
35
|
-
|
|
36
|
-
To protect your rights, we need to prevent others from denying you
|
|
37
|
-
these rights or asking you to surrender the rights. Therefore, you have
|
|
38
|
-
certain responsibilities if you distribute copies of the software, or if
|
|
39
|
-
you modify it: responsibilities to respect the freedom of others.
|
|
40
|
-
|
|
41
|
-
For example, if you distribute copies of such a program, whether
|
|
42
|
-
gratis or for a fee, you must pass on to the recipients the same
|
|
43
|
-
freedoms that you received. You must make sure that they, too, receive
|
|
44
|
-
or can get the source code. And you must show them these terms so they
|
|
45
|
-
know their rights.
|
|
46
|
-
|
|
47
|
-
Developers that use the GNU GPL protect your rights with two steps:
|
|
48
|
-
(1) assert copyright on the software, and (2) offer you this License
|
|
49
|
-
giving you legal permission to copy, distribute and/or modify it.
|
|
50
|
-
|
|
51
|
-
For the developers' and authors' protection, the GPL clearly explains
|
|
52
|
-
that there is no warranty for this free software. For both users' and
|
|
53
|
-
authors' sake, the GPL requires that modified versions be marked as
|
|
54
|
-
changed, so that their problems will not be attributed erroneously to
|
|
55
|
-
authors of previous versions.
|
|
56
|
-
|
|
57
|
-
Some devices are designed to deny users access to install or run
|
|
58
|
-
modified versions of the software inside them, although the manufacturer
|
|
59
|
-
can do so. This is fundamentally incompatible with the aim of
|
|
60
|
-
protecting users' freedom to change the software. The systematic
|
|
61
|
-
pattern of such abuse occurs in the area of products for individuals to
|
|
62
|
-
use, which is precisely where it is most unacceptable. Therefore, we
|
|
63
|
-
have designed this version of the GPL to prohibit the practice for those
|
|
64
|
-
products. If such problems arise substantially in other domains, we
|
|
65
|
-
stand ready to extend this provision to those domains in future versions
|
|
66
|
-
of the GPL, as needed to protect the freedom of users.
|
|
67
|
-
|
|
68
|
-
Finally, every program is threatened constantly by software patents.
|
|
69
|
-
States should not allow patents to restrict development and use of
|
|
70
|
-
software on general-purpose computers, but in those that do, we wish to
|
|
71
|
-
avoid the special danger that patents applied to a free program could
|
|
72
|
-
make it effectively proprietary. To prevent this, the GPL assures that
|
|
73
|
-
patents cannot be used to render the program non-free.
|
|
74
|
-
|
|
75
|
-
The precise terms and conditions for copying, distribution and
|
|
76
|
-
modification follow.
|
|
77
|
-
|
|
78
|
-
TERMS AND CONDITIONS
|
|
79
|
-
|
|
80
|
-
0. Definitions.
|
|
81
|
-
|
|
82
|
-
"This License" refers to version 3 of the GNU General Public License.
|
|
83
|
-
|
|
84
|
-
"Copyright" also means copyright-like laws that apply to other kinds of
|
|
85
|
-
works, such as semiconductor masks.
|
|
86
|
-
|
|
87
|
-
"The Program" refers to any copyrightable work licensed under this
|
|
88
|
-
License. Each licensee is addressed as "you". "Licensees" and
|
|
89
|
-
"recipients" may be individuals or organizations.
|
|
90
|
-
|
|
91
|
-
To "modify" a work means to copy from or adapt all or part of the work
|
|
92
|
-
in a fashion requiring copyright permission, other than the making of an
|
|
93
|
-
exact copy. The resulting work is called a "modified version" of the
|
|
94
|
-
earlier work or a work "based on" the earlier work.
|
|
95
|
-
|
|
96
|
-
A "covered work" means either the unmodified Program or a work based
|
|
97
|
-
on the Program.
|
|
98
|
-
|
|
99
|
-
To "propagate" a work means to do anything with it that, without
|
|
100
|
-
permission, would make you directly or secondarily liable for
|
|
101
|
-
infringement under applicable copyright law, except executing it on a
|
|
102
|
-
computer or modifying a private copy. Propagation includes copying,
|
|
103
|
-
distribution (with or without modification), making available to the
|
|
104
|
-
public, and in some countries other activities as well.
|
|
105
|
-
|
|
106
|
-
To "convey" a work means any kind of propagation that enables other
|
|
107
|
-
parties to make or receive copies. Mere interaction with a user through
|
|
108
|
-
a computer network, with no transfer of a copy, is not conveying.
|
|
109
|
-
|
|
110
|
-
An interactive user interface displays "Appropriate Legal Notices"
|
|
111
|
-
to the extent that it includes a convenient and prominently visible
|
|
112
|
-
feature that (1) displays an appropriate copyright notice, and (2)
|
|
113
|
-
tells the user that there is no warranty for the work (except to the
|
|
114
|
-
extent that warranties are provided), that licensees may convey the
|
|
115
|
-
work under this License, and how to view a copy of this License. If
|
|
116
|
-
the interface presents a list of user commands or options, such as a
|
|
117
|
-
menu, a prominent item in the list meets this criterion.
|
|
118
|
-
|
|
119
|
-
1. Source Code.
|
|
120
|
-
|
|
121
|
-
The "source code" for a work means the preferred form of the work
|
|
122
|
-
for making modifications to it. "Object code" means any non-source
|
|
123
|
-
form of a work.
|
|
124
|
-
|
|
125
|
-
A "Standard Interface" means an interface that either is an official
|
|
126
|
-
standard defined by a recognized standards body, or, in the case of
|
|
127
|
-
interfaces specified for a particular programming language, one that
|
|
128
|
-
is widely used among developers working in that language.
|
|
129
|
-
|
|
130
|
-
The "System Libraries" of an executable work include anything, other
|
|
131
|
-
than the work as a whole, that (a) is included in the normal form of
|
|
132
|
-
packaging a Major Component, but which is not part of that Major
|
|
133
|
-
Component, and (b) serves only to enable use of the work with that
|
|
134
|
-
Major Component, or to implement a Standard Interface for which an
|
|
135
|
-
implementation is available to the public in source code form. A
|
|
136
|
-
"Major Component", in this context, means a major essential component
|
|
137
|
-
(kernel, window system, and so on) of the specific operating system
|
|
138
|
-
(if any) on which the executable work runs, or a compiler used to
|
|
139
|
-
produce the work, or an object code interpreter used to run it.
|
|
140
|
-
|
|
141
|
-
The "Corresponding Source" for a work in object code form means all
|
|
142
|
-
the source code needed to generate, install, and (for an executable
|
|
143
|
-
work) run the object code and to modify the work, including scripts to
|
|
144
|
-
control those activities. However, it does not include the work's
|
|
145
|
-
System Libraries, or general-purpose tools or generally available free
|
|
146
|
-
programs which are used unmodified in performing those activities but
|
|
147
|
-
which are not part of the work. For example, Corresponding Source
|
|
148
|
-
includes interface definition files associated with source files for
|
|
149
|
-
the work, and the source code for shared libraries and dynamically
|
|
150
|
-
linked subprograms that the work is specifically designed to require,
|
|
151
|
-
such as by intimate data communication or control flow between those
|
|
152
|
-
subprograms and other parts of the work.
|
|
153
|
-
|
|
154
|
-
The Corresponding Source need not include anything that users
|
|
155
|
-
can regenerate automatically from other parts of the Corresponding
|
|
156
|
-
Source.
|
|
157
|
-
|
|
158
|
-
The Corresponding Source for a work in source code form is that
|
|
159
|
-
same work.
|
|
160
|
-
|
|
161
|
-
2. Basic Permissions.
|
|
162
|
-
|
|
163
|
-
All rights granted under this License are granted for the term of
|
|
164
|
-
copyright on the Program, and are irrevocable provided the stated
|
|
165
|
-
conditions are met. This License explicitly affirms your unlimited
|
|
166
|
-
permission to run the unmodified Program. The output from running a
|
|
167
|
-
covered work is covered by this License only if the output, given its
|
|
168
|
-
content, constitutes a covered work. This License acknowledges your
|
|
169
|
-
rights of fair use or other equivalent, as provided by copyright law.
|
|
170
|
-
|
|
171
|
-
You may make, run and propagate covered works that you do not
|
|
172
|
-
convey, without conditions so long as your license otherwise remains
|
|
173
|
-
in force. You may convey covered works to others for the sole purpose
|
|
174
|
-
of having them make modifications exclusively for you, or provide you
|
|
175
|
-
with facilities for running those works, provided that you comply with
|
|
176
|
-
the terms of this License in conveying all material for which you do
|
|
177
|
-
not control copyright. Those thus making or running the covered works
|
|
178
|
-
for you must do so exclusively on your behalf, under your direction
|
|
179
|
-
and control, on terms that prohibit them from making any copies of
|
|
180
|
-
your copyrighted material outside their relationship with you.
|
|
181
|
-
|
|
182
|
-
Conveying under any other circumstances is permitted solely under
|
|
183
|
-
the conditions stated below. Sublicensing is not allowed; section 10
|
|
184
|
-
makes it unnecessary.
|
|
185
|
-
|
|
186
|
-
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
|
187
|
-
|
|
188
|
-
No covered work shall be deemed part of an effective technological
|
|
189
|
-
measure under any applicable law fulfilling obligations under article
|
|
190
|
-
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
|
191
|
-
similar laws prohibiting or restricting circumvention of such
|
|
192
|
-
measures.
|
|
193
|
-
|
|
194
|
-
When you convey a covered work, you waive any legal power to forbid
|
|
195
|
-
circumvention of technological measures to the extent such circumvention
|
|
196
|
-
is effected by exercising rights under this License with respect to
|
|
197
|
-
the covered work, and you disclaim any intention to limit operation or
|
|
198
|
-
modification of the work as a means of enforcing, against the work's
|
|
199
|
-
users, your or third parties' legal rights to forbid circumvention of
|
|
200
|
-
technological measures.
|
|
201
|
-
|
|
202
|
-
4. Conveying Verbatim Copies.
|
|
203
|
-
|
|
204
|
-
You may convey verbatim copies of the Program's source code as you
|
|
205
|
-
receive it, in any medium, provided that you conspicuously and
|
|
206
|
-
appropriately publish on each copy an appropriate copyright notice;
|
|
207
|
-
keep intact all notices stating that this License and any
|
|
208
|
-
non-permissive terms added in accord with section 7 apply to the code;
|
|
209
|
-
keep intact all notices of the absence of any warranty; and give all
|
|
210
|
-
recipients a copy of this License along with the Program.
|
|
211
|
-
|
|
212
|
-
You may charge any price or no price for each copy that you convey,
|
|
213
|
-
and you may offer support or warranty protection for a fee.
|
|
214
|
-
|
|
215
|
-
5. Conveying Modified Source Versions.
|
|
216
|
-
|
|
217
|
-
You may convey a work based on the Program, or the modifications to
|
|
218
|
-
produce it from the Program, in the form of source code under the
|
|
219
|
-
terms of section 4, provided that you also meet all of these conditions:
|
|
220
|
-
|
|
221
|
-
a) The work must carry prominent notices stating that you modified
|
|
222
|
-
it, and giving a relevant date.
|
|
223
|
-
|
|
224
|
-
b) The work must carry prominent notices stating that it is
|
|
225
|
-
released under this License and any conditions added under section
|
|
226
|
-
7. This requirement modifies the requirement in section 4 to
|
|
227
|
-
"keep intact all notices".
|
|
228
|
-
|
|
229
|
-
c) You must license the entire work, as a whole, under this
|
|
230
|
-
License to anyone who comes into possession of a copy. This
|
|
231
|
-
License will therefore apply, along with any applicable section 7
|
|
232
|
-
additional terms, to the whole of the work, and all its parts,
|
|
233
|
-
regardless of how they are packaged. This License gives no
|
|
234
|
-
permission to license the work in any other way, but it does not
|
|
235
|
-
invalidate such permission if you have separately received it.
|
|
236
|
-
|
|
237
|
-
d) If the work has interactive user interfaces, each must display
|
|
238
|
-
Appropriate Legal Notices; however, if the Program has interactive
|
|
239
|
-
interfaces that do not display Appropriate Legal Notices, your
|
|
240
|
-
work need not make them do so.
|
|
241
|
-
|
|
242
|
-
A compilation of a covered work with other separate and independent
|
|
243
|
-
works, which are not by their nature extensions of the covered work,
|
|
244
|
-
and which are not combined with it such as to form a larger program,
|
|
245
|
-
in or on a volume of a storage or distribution medium, is called an
|
|
246
|
-
"aggregate" if the compilation and its resulting copyright are not
|
|
247
|
-
used to limit the access or legal rights of the compilation's users
|
|
248
|
-
beyond what the individual works permit. Inclusion of a covered work
|
|
249
|
-
in an aggregate does not cause this License to apply to the other
|
|
250
|
-
parts of the aggregate.
|
|
251
|
-
|
|
252
|
-
6. Conveying Non-Source Forms.
|
|
253
|
-
|
|
254
|
-
You may convey a covered work in object code form under the terms
|
|
255
|
-
of sections 4 and 5, provided that you also convey the
|
|
256
|
-
machine-readable Corresponding Source under the terms of this License,
|
|
257
|
-
in one of these ways:
|
|
258
|
-
|
|
259
|
-
a) Convey the object code in, or embodied in, a physical product
|
|
260
|
-
(including a physical distribution medium), accompanied by the
|
|
261
|
-
Corresponding Source fixed on a durable physical medium
|
|
262
|
-
customarily used for software interchange.
|
|
263
|
-
|
|
264
|
-
b) Convey the object code in, or embodied in, a physical product
|
|
265
|
-
(including a physical distribution medium), accompanied by a
|
|
266
|
-
written offer, valid for at least three years and valid for as
|
|
267
|
-
long as you offer spare parts or customer support for that product
|
|
268
|
-
model, to give anyone who possesses the object code either (1) a
|
|
269
|
-
copy of the Corresponding Source for all the software in the
|
|
270
|
-
product that is covered by this License, on a durable physical
|
|
271
|
-
medium customarily used for software interchange, for a price no
|
|
272
|
-
more than your reasonable cost of physically performing this
|
|
273
|
-
conveying of source, or (2) access to copy the
|
|
274
|
-
Corresponding Source from a network server at no charge.
|
|
275
|
-
|
|
276
|
-
c) Convey individual copies of the object code with a copy of the
|
|
277
|
-
written offer to provide the Corresponding Source. This
|
|
278
|
-
alternative is allowed only occasionally and noncommercially, and
|
|
279
|
-
only if you received the object code with such an offer, in accord
|
|
280
|
-
with subsection 6b.
|
|
281
|
-
|
|
282
|
-
d) Convey the object code by offering access from a designated
|
|
283
|
-
place (gratis or for a charge), and offer equivalent access to the
|
|
284
|
-
Corresponding Source in the same way through the same place at no
|
|
285
|
-
further charge. You need not require recipients to copy the
|
|
286
|
-
Corresponding Source along with the object code. If the place to
|
|
287
|
-
copy the object code is a network server, the Corresponding Source
|
|
288
|
-
may be on a different server (operated by you or a third party)
|
|
289
|
-
that supports equivalent copying facilities, provided you maintain
|
|
290
|
-
clear directions next to the object code saying where to find the
|
|
291
|
-
Corresponding Source. Regardless of what server hosts the
|
|
292
|
-
Corresponding Source, you remain obligated to ensure that it is
|
|
293
|
-
available for as long as needed to satisfy these requirements.
|
|
294
|
-
|
|
295
|
-
e) Convey the object code using peer-to-peer transmission, provided
|
|
296
|
-
you inform other peers where the object code and Corresponding
|
|
297
|
-
Source of the work are being offered to the general public at no
|
|
298
|
-
charge under subsection 6d.
|
|
299
|
-
|
|
300
|
-
A separable portion of the object code, whose source code is excluded
|
|
301
|
-
from the Corresponding Source as a System Library, need not be
|
|
302
|
-
included in conveying the object code work.
|
|
303
|
-
|
|
304
|
-
A "User Product" is either (1) a "consumer product", which means any
|
|
305
|
-
tangible personal property which is normally used for personal, family,
|
|
306
|
-
or household purposes, or (2) anything designed or sold for incorporation
|
|
307
|
-
into a dwelling. In determining whether a product is a consumer product,
|
|
308
|
-
doubtful cases shall be resolved in favor of coverage. For a particular
|
|
309
|
-
product received by a particular user, "normally used" refers to a
|
|
310
|
-
typical or common use of that class of product, regardless of the status
|
|
311
|
-
of the particular user or of the way in which the particular user
|
|
312
|
-
actually uses, or expects or is expected to use, the product. A product
|
|
313
|
-
is a consumer product regardless of whether the product has substantial
|
|
314
|
-
commercial, industrial or non-consumer uses, unless such uses represent
|
|
315
|
-
the only significant mode of use of the product.
|
|
316
|
-
|
|
317
|
-
"Installation Information" for a User Product means any methods,
|
|
318
|
-
procedures, authorization keys, or other information required to install
|
|
319
|
-
and execute modified versions of a covered work in that User Product from
|
|
320
|
-
a modified version of its Corresponding Source. The information must
|
|
321
|
-
suffice to ensure that the continued functioning of the modified object
|
|
322
|
-
code is in no case prevented or interfered with solely because
|
|
323
|
-
modification has been made.
|
|
324
|
-
|
|
325
|
-
If you convey an object code work under this section in, or with, or
|
|
326
|
-
specifically for use in, a User Product, and the conveying occurs as
|
|
327
|
-
part of a transaction in which the right of possession and use of the
|
|
328
|
-
User Product is transferred to the recipient in perpetuity or for a
|
|
329
|
-
fixed term (regardless of how the transaction is characterized), the
|
|
330
|
-
Corresponding Source conveyed under this section must be accompanied
|
|
331
|
-
by the Installation Information. But this requirement does not apply
|
|
332
|
-
if neither you nor any third party retains the ability to install
|
|
333
|
-
modified object code on the User Product (for example, the work has
|
|
334
|
-
been installed in ROM).
|
|
335
|
-
|
|
336
|
-
The requirement to provide Installation Information does not include a
|
|
337
|
-
requirement to continue to provide support service, warranty, or updates
|
|
338
|
-
for a work that has been modified or installed by the recipient, or for
|
|
339
|
-
the User Product in which it has been modified or installed. Access to a
|
|
340
|
-
network may be denied when the modification itself materially and
|
|
341
|
-
adversely affects the operation of the network or violates the rules and
|
|
342
|
-
protocols for communication across the network.
|
|
343
|
-
|
|
344
|
-
Corresponding Source conveyed, and Installation Information provided,
|
|
345
|
-
in accord with this section must be in a format that is publicly
|
|
346
|
-
documented (and with an implementation available to the public in
|
|
347
|
-
source code form), and must require no special password or key for
|
|
348
|
-
unpacking, reading or copying.
|
|
349
|
-
|
|
350
|
-
7. Additional Terms.
|
|
351
|
-
|
|
352
|
-
"Additional permissions" are terms that supplement the terms of this
|
|
353
|
-
License by making exceptions from one or more of its conditions.
|
|
354
|
-
Additional permissions that are applicable to the entire Program shall
|
|
355
|
-
be treated as though they were included in this License, to the extent
|
|
356
|
-
that they are valid under applicable law. If additional permissions
|
|
357
|
-
apply only to part of the Program, that part may be used separately
|
|
358
|
-
under those permissions, but the entire Program remains governed by
|
|
359
|
-
this License without regard to the additional permissions.
|
|
360
|
-
|
|
361
|
-
When you convey a copy of a covered work, you may at your option
|
|
362
|
-
remove any additional permissions from that copy, or from any part of
|
|
363
|
-
it. (Additional permissions may be written to require their own
|
|
364
|
-
removal in certain cases when you modify the work.) You may place
|
|
365
|
-
additional permissions on material, added by you to a covered work,
|
|
366
|
-
for which you have or can give appropriate copyright permission.
|
|
367
|
-
|
|
368
|
-
Notwithstanding any other provision of this License, for material you
|
|
369
|
-
add to a covered work, you may (if authorized by the copyright holders of
|
|
370
|
-
that material) supplement the terms of this License with terms:
|
|
371
|
-
|
|
372
|
-
a) Disclaiming warranty or limiting liability differently from the
|
|
373
|
-
terms of sections 15 and 16 of this License; or
|
|
374
|
-
|
|
375
|
-
b) Requiring preservation of specified reasonable legal notices or
|
|
376
|
-
author attributions in that material or in the Appropriate Legal
|
|
377
|
-
Notices displayed by works containing it; or
|
|
378
|
-
|
|
379
|
-
c) Prohibiting misrepresentation of the origin of that material, or
|
|
380
|
-
requiring that modified versions of such material be marked in
|
|
381
|
-
reasonable ways as different from the original version; or
|
|
382
|
-
|
|
383
|
-
d) Limiting the use for publicity purposes of names of licensors or
|
|
384
|
-
authors of the material; or
|
|
385
|
-
|
|
386
|
-
e) Declining to grant rights under trademark law for use of some
|
|
387
|
-
trade names, trademarks, or service marks; or
|
|
388
|
-
|
|
389
|
-
f) Requiring indemnification of licensors and authors of that
|
|
390
|
-
material by anyone who conveys the material (or modified versions of
|
|
391
|
-
it) with contractual assumptions of liability to the recipient, for
|
|
392
|
-
any liability that these contractual assumptions directly impose on
|
|
393
|
-
those licensors and authors.
|
|
394
|
-
|
|
395
|
-
All other non-permissive additional terms are considered "further
|
|
396
|
-
restrictions" within the meaning of section 10. If the Program as you
|
|
397
|
-
received it, or any part of it, contains a notice stating that it is
|
|
398
|
-
governed by this License along with a term that is a further
|
|
399
|
-
restriction, you may remove that term. If a license document contains
|
|
400
|
-
a further restriction but permits relicensing or conveying under this
|
|
401
|
-
License, you may add to a covered work material governed by the terms
|
|
402
|
-
of that license document, provided that the further restriction does
|
|
403
|
-
not survive such relicensing or conveying.
|
|
404
|
-
|
|
405
|
-
If you add terms to a covered work in accord with this section, you
|
|
406
|
-
must place, in the relevant source files, a statement of the
|
|
407
|
-
additional terms that apply to those files, or a notice indicating
|
|
408
|
-
where to find the applicable terms.
|
|
409
|
-
|
|
410
|
-
Additional terms, permissive or non-permissive, may be stated in the
|
|
411
|
-
form of a separately written license, or stated as exceptions;
|
|
412
|
-
the above requirements apply either way.
|
|
413
|
-
|
|
414
|
-
8. Termination.
|
|
415
|
-
|
|
416
|
-
You may not propagate or modify a covered work except as expressly
|
|
417
|
-
provided under this License. Any attempt otherwise to propagate or
|
|
418
|
-
modify it is void, and will automatically terminate your rights under
|
|
419
|
-
this License (including any patent licenses granted under the third
|
|
420
|
-
paragraph of section 11).
|
|
421
|
-
|
|
422
|
-
However, if you cease all violation of this License, then your
|
|
423
|
-
license from a particular copyright holder is reinstated (a)
|
|
424
|
-
provisionally, unless and until the copyright holder explicitly and
|
|
425
|
-
finally terminates your license, and (b) permanently, if the copyright
|
|
426
|
-
holder fails to notify you of the violation by some reasonable means
|
|
427
|
-
prior to 60 days after the cessation.
|
|
428
|
-
|
|
429
|
-
Moreover, your license from a particular copyright holder is
|
|
430
|
-
reinstated permanently if the copyright holder notifies you of the
|
|
431
|
-
violation by some reasonable means, this is the first time you have
|
|
432
|
-
received notice of violation of this License (for any work) from that
|
|
433
|
-
copyright holder, and you cure the violation prior to 30 days after
|
|
434
|
-
your receipt of the notice.
|
|
435
|
-
|
|
436
|
-
Termination of your rights under this section does not terminate the
|
|
437
|
-
licenses of parties who have received copies or rights from you under
|
|
438
|
-
this License. If your rights have been terminated and not permanently
|
|
439
|
-
reinstated, you do not qualify to receive new licenses for the same
|
|
440
|
-
material under section 10.
|
|
441
|
-
|
|
442
|
-
9. Acceptance Not Required for Having Copies.
|
|
443
|
-
|
|
444
|
-
You are not required to accept this License in order to receive or
|
|
445
|
-
run a copy of the Program. Ancillary propagation of a covered work
|
|
446
|
-
occurring solely as a consequence of using peer-to-peer transmission
|
|
447
|
-
to receive a copy likewise does not require acceptance. However,
|
|
448
|
-
nothing other than this License grants you permission to propagate or
|
|
449
|
-
modify any covered work. These actions infringe copyright if you do
|
|
450
|
-
not accept this License. Therefore, by modifying or propagating a
|
|
451
|
-
covered work, you indicate your acceptance of this License to do so.
|
|
452
|
-
|
|
453
|
-
10. Automatic Licensing of Downstream Recipients.
|
|
454
|
-
|
|
455
|
-
Each time you convey a covered work, the recipient automatically
|
|
456
|
-
receives a license from the original licensors, to run, modify and
|
|
457
|
-
propagate that work, subject to this License. You are not responsible
|
|
458
|
-
for enforcing compliance by third parties with this License.
|
|
459
|
-
|
|
460
|
-
An "entity transaction" is a transaction transferring control of an
|
|
461
|
-
organization, or substantially all assets of one, or subdividing an
|
|
462
|
-
organization, or merging organizations. If propagation of a covered
|
|
463
|
-
work results from an entity transaction, each party to that
|
|
464
|
-
transaction who receives a copy of the work also receives whatever
|
|
465
|
-
licenses to the work the party's predecessor in interest had or could
|
|
466
|
-
give under the previous paragraph, plus a right to possession of the
|
|
467
|
-
Corresponding Source of the work from the predecessor in interest, if
|
|
468
|
-
the predecessor has it or can get it with reasonable efforts.
|
|
469
|
-
|
|
470
|
-
You may not impose any further restrictions on the exercise of the
|
|
471
|
-
rights granted or affirmed under this License. For example, you may
|
|
472
|
-
not impose a license fee, royalty, or other charge for exercise of
|
|
473
|
-
rights granted under this License, and you may not initiate litigation
|
|
474
|
-
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
|
475
|
-
any patent claim is infringed by making, using, selling, offering for
|
|
476
|
-
sale, or importing the Program or any portion of it.
|
|
477
|
-
|
|
478
|
-
11. Patents.
|
|
479
|
-
|
|
480
|
-
A "contributor" is a copyright holder who authorizes use under this
|
|
481
|
-
License of the Program or a work on which the Program is based. The
|
|
482
|
-
work thus licensed is called the contributor's "contributor version".
|
|
483
|
-
|
|
484
|
-
A contributor's "essential patent claims" are all patent claims
|
|
485
|
-
owned or controlled by the contributor, whether already acquired or
|
|
486
|
-
hereafter acquired, that would be infringed by some manner, permitted
|
|
487
|
-
by this License, of making, using, or selling its contributor version,
|
|
488
|
-
but do not include claims that would be infringed only as a
|
|
489
|
-
consequence of further modification of the contributor version. For
|
|
490
|
-
purposes of this definition, "control" includes the right to grant
|
|
491
|
-
patent sublicenses in a manner consistent with the requirements of
|
|
492
|
-
this License.
|
|
493
|
-
|
|
494
|
-
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
|
495
|
-
patent license under the contributor's essential patent claims, to
|
|
496
|
-
make, use, sell, offer for sale, import and otherwise run, modify and
|
|
497
|
-
propagate the contents of its contributor version.
|
|
498
|
-
|
|
499
|
-
In the following three paragraphs, a "patent license" is any express
|
|
500
|
-
agreement or commitment, however denominated, not to enforce a patent
|
|
501
|
-
(such as an express permission to practice a patent or covenant not to
|
|
502
|
-
sue for patent infringement). To "grant" such a patent license to a
|
|
503
|
-
party means to make such an agreement or commitment not to enforce a
|
|
504
|
-
patent against the party.
|
|
505
|
-
|
|
506
|
-
If you convey a covered work, knowingly relying on a patent license,
|
|
507
|
-
and the Corresponding Source of the work is not available for anyone
|
|
508
|
-
to copy, free of charge and under the terms of this License, through a
|
|
509
|
-
publicly available network server or other readily accessible means,
|
|
510
|
-
then you must either (1) cause the Corresponding Source to be so
|
|
511
|
-
available, or (2) arrange to deprive yourself of the benefit of the
|
|
512
|
-
patent license for this particular work, or (3) arrange, in a manner
|
|
513
|
-
consistent with the requirements of this License, to extend the patent
|
|
514
|
-
license to downstream recipients. "Knowingly relying" means you have
|
|
515
|
-
actual knowledge that, but for the patent license, your conveying the
|
|
516
|
-
covered work in a country, or your recipient's use of the covered work
|
|
517
|
-
in a country, would infringe one or more identifiable patents in that
|
|
518
|
-
country that you have reason to believe are valid.
|
|
519
|
-
|
|
520
|
-
If, pursuant to or in connection with a single transaction or
|
|
521
|
-
arrangement, you convey, or propagate by procuring conveyance of, a
|
|
522
|
-
covered work, and grant a patent license to some of the parties
|
|
523
|
-
receiving the covered work authorizing them to use, propagate, modify
|
|
524
|
-
or convey a specific copy of the covered work, then the patent license
|
|
525
|
-
you grant is automatically extended to all recipients of the covered
|
|
526
|
-
work and works based on it.
|
|
527
|
-
|
|
528
|
-
A patent license is "discriminatory" if it does not include within
|
|
529
|
-
the scope of its coverage, prohibits the exercise of, or is
|
|
530
|
-
conditioned on the non-exercise of one or more of the rights that are
|
|
531
|
-
specifically granted under this License. You may not convey a covered
|
|
532
|
-
work if you are a party to an arrangement with a third party that is
|
|
533
|
-
in the business of distributing software, under which you make payment
|
|
534
|
-
to the third party based on the extent of your activity of conveying
|
|
535
|
-
the work, and under which the third party grants, to any of the
|
|
536
|
-
parties who would receive the covered work from you, a discriminatory
|
|
537
|
-
patent license (a) in connection with copies of the covered work
|
|
538
|
-
conveyed by you (or copies made from those copies), or (b) primarily
|
|
539
|
-
for and in connection with specific products or compilations that
|
|
540
|
-
contain the covered work, unless you entered into that arrangement,
|
|
541
|
-
or that patent license was granted, prior to 28 March 2007.
|
|
542
|
-
|
|
543
|
-
Nothing in this License shall be construed as excluding or limiting
|
|
544
|
-
any implied license or other defenses to infringement that may
|
|
545
|
-
otherwise be available to you under applicable patent law.
|
|
546
|
-
|
|
547
|
-
12. No Surrender of Others' Freedom.
|
|
548
|
-
|
|
549
|
-
If conditions are imposed on you (whether by court order, agreement or
|
|
550
|
-
otherwise) that contradict the conditions of this License, they do not
|
|
551
|
-
excuse you from the conditions of this License. If you cannot convey a
|
|
552
|
-
covered work so as to satisfy simultaneously your obligations under this
|
|
553
|
-
License and any other pertinent obligations, then as a consequence you may
|
|
554
|
-
not convey it at all. For example, if you agree to terms that obligate you
|
|
555
|
-
to collect a royalty for further conveying from those to whom you convey
|
|
556
|
-
the Program, the only way you could satisfy both those terms and this
|
|
557
|
-
License would be to refrain entirely from conveying the Program.
|
|
558
|
-
|
|
559
|
-
13. Use with the GNU Affero General Public License.
|
|
560
|
-
|
|
561
|
-
Notwithstanding any other provision of this License, you have
|
|
562
|
-
permission to link or combine any covered work with a work licensed
|
|
563
|
-
under version 3 of the GNU Affero General Public License into a single
|
|
564
|
-
combined work, and to convey the resulting work. The terms of this
|
|
565
|
-
License will continue to apply to the part which is the covered work,
|
|
566
|
-
but the special requirements of the GNU Affero General Public License,
|
|
567
|
-
section 13, concerning interaction through a network will apply to the
|
|
568
|
-
combination as such.
|
|
569
|
-
|
|
570
|
-
14. Revised Versions of this License.
|
|
571
|
-
|
|
572
|
-
The Free Software Foundation may publish revised and/or new versions of
|
|
573
|
-
the GNU General Public License from time to time. Such new versions will
|
|
574
|
-
be similar in spirit to the present version, but may differ in detail to
|
|
575
|
-
address new problems or concerns.
|
|
576
|
-
|
|
577
|
-
Each version is given a distinguishing version number. If the
|
|
578
|
-
Program specifies that a certain numbered version of the GNU General
|
|
579
|
-
Public License "or any later version" applies to it, you have the
|
|
580
|
-
option of following the terms and conditions either of that numbered
|
|
581
|
-
version or of any later version published by the Free Software
|
|
582
|
-
Foundation. If the Program does not specify a version number of the
|
|
583
|
-
GNU General Public License, you may choose any version ever published
|
|
584
|
-
by the Free Software Foundation.
|
|
585
|
-
|
|
586
|
-
If the Program specifies that a proxy can decide which future
|
|
587
|
-
versions of the GNU General Public License can be used, that proxy's
|
|
588
|
-
public statement of acceptance of a version permanently authorizes you
|
|
589
|
-
to choose that version for the Program.
|
|
590
|
-
|
|
591
|
-
Later license versions may give you additional or different
|
|
592
|
-
permissions. However, no additional obligations are imposed on any
|
|
593
|
-
author or copyright holder as a result of your choosing to follow a
|
|
594
|
-
later version.
|
|
595
|
-
|
|
596
|
-
15. Disclaimer of Warranty.
|
|
597
|
-
|
|
598
|
-
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
|
599
|
-
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
|
600
|
-
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
|
601
|
-
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
|
602
|
-
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
603
|
-
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
|
604
|
-
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
|
605
|
-
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
|
606
|
-
|
|
607
|
-
16. Limitation of Liability.
|
|
608
|
-
|
|
609
|
-
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
610
|
-
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
|
611
|
-
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
|
612
|
-
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
|
613
|
-
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
|
614
|
-
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
|
615
|
-
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
|
616
|
-
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
|
617
|
-
SUCH DAMAGES.
|
|
618
|
-
|
|
619
|
-
17. Interpretation of Sections 15 and 16.
|
|
620
|
-
|
|
621
|
-
If the disclaimer of warranty and limitation of liability provided
|
|
622
|
-
above cannot be given local legal effect according to their terms,
|
|
623
|
-
reviewing courts shall apply local law that most closely approximates
|
|
624
|
-
an absolute waiver of all civil liability in connection with the
|
|
625
|
-
Program, unless a warranty or assumption of liability accompanies a
|
|
626
|
-
copy of the Program in return for a fee.
|
|
627
|
-
|
|
628
|
-
END OF TERMS AND CONDITIONS
|
|
629
|
-
|
|
630
|
-
How to Apply These Terms to Your New Programs
|
|
631
|
-
|
|
632
|
-
If you develop a new program, and you want it to be of the greatest
|
|
633
|
-
possible use to the public, the best way to achieve this is to make it
|
|
634
|
-
free software which everyone can redistribute and change under these terms.
|
|
635
|
-
|
|
636
|
-
To do so, attach the following notices to the program. It is safest
|
|
637
|
-
to attach them to the start of each source file to most effectively
|
|
638
|
-
state the exclusion of warranty; and each file should have at least
|
|
639
|
-
the "copyright" line and a pointer to where the full notice is found.
|
|
640
|
-
|
|
641
|
-
<one line to give the program's name and a brief idea of what it does.>
|
|
642
|
-
Copyright (C) <year> <name of author>
|
|
643
|
-
|
|
644
|
-
This program is free software: you can redistribute it and/or modify
|
|
645
|
-
it under the terms of the GNU General Public License as published by
|
|
646
|
-
the Free Software Foundation, either version 3 of the License, or
|
|
647
|
-
(at your option) any later version.
|
|
648
|
-
|
|
649
|
-
This program is distributed in the hope that it will be useful,
|
|
650
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
651
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
652
|
-
GNU General Public License for more details.
|
|
653
|
-
|
|
654
|
-
You should have received a copy of the GNU General Public License
|
|
655
|
-
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
656
|
-
|
|
657
|
-
Also add information on how to contact you by electronic and paper mail.
|
|
658
|
-
|
|
659
|
-
If the program does terminal interaction, make it output a short
|
|
660
|
-
notice like this when it starts in an interactive mode:
|
|
661
|
-
|
|
662
|
-
<program> Copyright (C) <year> <name of author>
|
|
663
|
-
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
|
664
|
-
This is free software, and you are welcome to redistribute it
|
|
665
|
-
under certain conditions; type `show c' for details.
|
|
666
|
-
|
|
667
|
-
The hypothetical commands `show w' and `show c' should show the appropriate
|
|
668
|
-
parts of the General Public License. Of course, your program's commands
|
|
669
|
-
might be different; for a GUI interface, you would use an "about box".
|
|
670
|
-
|
|
671
|
-
You should also get your employer (if you work as a programmer) or school,
|
|
672
|
-
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
|
673
|
-
For more information on this, and how to apply and follow the GNU GPL, see
|
|
674
|
-
<http://www.gnu.org/licenses/>.
|
|
675
|
-
|
|
676
|
-
The GNU General Public License does not permit incorporating your program
|
|
677
|
-
into proprietary programs. If your program is a subroutine library, you
|
|
678
|
-
may consider it more useful to permit linking proprietary applications with
|
|
679
|
-
the library. If this is what you want to do, use the GNU Lesser General
|
|
680
|
-
Public License instead of this License. But first, please read
|
|
681
|
-
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
|
682
|
-
|
|
683
|
-
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
|
|
684
|
-
|
|
685
|
-
Additional permissions under GNU GPL Version 3 Section 7:
|
|
686
|
-
|
|
687
|
-
KNIME interoperates with ECLIPSE solely via ECLIPSE's plug-in APIs.
|
|
688
|
-
Hence, KNIME and ECLIPSE are both independent programs and are not
|
|
689
|
-
derived from each other. Should, however, the interpretation of the
|
|
690
|
-
GNU GPL Version 3 ("License") under any applicable laws result in
|
|
691
|
-
KNIME and ECLIPSE being a combined program, KNIME AG herewith grants
|
|
692
|
-
you the additional permission to use and propagate KNIME together with
|
|
693
|
-
ECLIPSE with only the license terms in place for ECLIPSE applying to
|
|
694
|
-
ECLIPSE and the GNU GPL Version 3 applying for KNIME, provided the
|
|
695
|
-
license terms of ECLIPSE themselves allow for the respective use and
|
|
696
|
-
propagation of ECLIPSE together with KNIME.
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
Additional permission relating to nodes for KNIME that extend the Node
|
|
700
|
-
Extension (and in particular that are based on subclasses of NodeModel,
|
|
701
|
-
NodeDialog, and NodeView) and that only interoperate with KNIME through
|
|
702
|
-
standard APIs ("Nodes"):
|
|
703
|
-
Nodes are deemed to be separate and independent programs and to not be
|
|
704
|
-
covered works. Notwithstanding anything to the contrary in the License,
|
|
705
|
-
the License does not apply to Nodes, you are not required to license Nodes
|
|
706
|
-
under the License, and you are granted a license to prepare and propagate
|
|
707
|
-
Nodes, in each case even if such Nodes are propagated with or for
|
|
708
|
-
interoperation with KNIME. The owner of a Node may freely choose the
|
|
709
|
-
license terms applicable to such Node, including when such Node is
|
|
710
|
-
propagated with or for interoperation with KNIME.
|
|
6
|
+
Confidential and proprietary information of KNIME AG.
|
|
7
|
+
Unauthorized copying, distribution, or use of this file, via
|
|
8
|
+
any medium, is strictly prohibited without prior written
|
|
9
|
+
consent from KNIME AG.
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/capitalize.ts","../src/updateDate.ts","../src/updateTime.ts","../src/dateMinMaxCheck.ts","../src/debounce.ts","../src/filters.ts","../src/localTimezone.ts","../src/format.ts","../src/getDeepActiveElement.ts","../src/getWrappedAroundIndex.ts","../src/intervalUtils.ts","../src/numIntegerDigits.ts","../src/promise/createAbortablePromise.ts","../src/promise/createUnwrappedPromise.ts","../src/sleep.ts","../src/promise/retryPromise.ts","../src/promise/index.ts","../src/sanitization.ts","../src/truncateString.ts","../src/fileExtensions.ts","../src/hotkeys/enums.ts","../src/platform/navigator.ts","../src/hotkeys/format.ts","../src/hotkeys/match.ts","../src/hotkeys/modifiers.ts","../src/hotkeys/index.ts"],"sourcesContent":["/**\n * Uppercases first letter of string\n * @param string to be capitalized first string, e.g. \"workflow\"\n * @return Capitalized String, e.g. \"Workflow\"\n */\nexport const capitalize = (input: string) =>\n input.charAt(0).toUpperCase() + input.substring(1);\n\nconst formats = {\n customFormat: (input: string, delimiter: string) =>\n capitalize(input.replace(delimiter, \" \").toLowerCase()),\n\n kebabFormat: (input: string) => formats.customFormat(input, \"-\"),\n snakeFormat: (input: string) => formats.customFormat(input, \"_\"),\n\n camelPascalCase: (input: string) =>\n capitalize(\n (input.match(/([A-Z]?[^A-Z]*)/g) ?? [])\n .slice(0, -1)\n .join(\" \")\n .toLowerCase(),\n ),\n} as const;\n\ntype CaseFormatterOptions = {\n string: string;\n delimiter?: string;\n format?: keyof typeof formats;\n};\n\nexport const caseFormatter = ({\n string,\n delimiter,\n format,\n}: CaseFormatterOptions) => {\n if (delimiter) {\n return formats.customFormat(string, delimiter);\n }\n\n if (format) {\n return formats[format](string, delimiter ?? \"\");\n }\n\n return capitalize(string);\n};\n","import { getDate, getMonth, getYear, isValid, set } from \"date-fns\";\n/**\n * Updates the date part (year, day and month) of a date object (base)\n * time, offset (timezone) and so on will be left untouched.\n *\n * @param base - Date which will be used (copied) to set day, month and year.\n * @param date - Extract day, month and year from this date object.\n * @returns Copy of base with day, month and year of date.\n */\nexport default (base: Date, date: Date | null) => {\n // ignore falsy dates\n if (date) {\n // allow invalid base and set time to 0\n base = isValid(base) ? base : new Date(Date.UTC(0, 0));\n return set(base, {\n year: getYear(date),\n month: getMonth(date),\n date: getDate(date),\n });\n }\n\n return base;\n};\n","/**\n * Updates the time part (hour, minute, second and millisecond) of a date object (base)\n * date, offset (timezone) and so on will be left untouched.\n *\n * @param base - Date which will be used (copied) to set day, month and year.\n * @param date - Extract hour, minute, second and millisecond from this date object.\n * @returns Copy of base with hour, minute, second and millisecond changed.\n */\nexport default (base: Date, date: Date | null) => {\n const d = new Date(base);\n // ignore falsy dates\n if (date) {\n d.setHours(date.getHours());\n d.setMinutes(date.getMinutes());\n d.setSeconds(date.getSeconds());\n d.setMilliseconds(date.getMilliseconds());\n }\n return d;\n};\n","import { isAfter, isBefore } from \"date-fns\";\n\nimport updateDate from \"./updateDate\";\nimport updateTime from \"./updateTime\";\n\n/**\n * Check if date is before min.\n * @param date\n * @param min\n * @param checkDate - check date part (year, day, month).\n * @param checkTime - check time part (hour, minutes etc.).\n * @returns whether limit is kept or not.\n */\nexport const isBeforeMinDate = (\n date: Date,\n min: Date | null,\n checkDate: boolean,\n checkTime: boolean,\n) => {\n if (min) {\n if (checkTime && checkDate) {\n return isBefore(date, min);\n }\n if (checkTime) {\n // only time is visible so ignore date: use same datre as base\n const base = new Date(0);\n return isBefore(updateTime(base, date), updateTime(base, min));\n }\n if (checkDate) {\n // only date is visible so ignore time: use same time as base\n const base = new Date(0);\n return isBefore(updateDate(base, date), updateDate(base, min));\n }\n }\n return false;\n};\n\n/**\n * Check\n * @param date - date to check.\n * @param max - maximum date.\n * @param checkDate - check date part (year, day, month).\n * @param checkTime - check time part (hour, minutes etc.).\n * @returns whether limit is kept or not.\n */\nexport const isAfterMaxDate = (\n date: Date,\n max: Date | null,\n checkDate: boolean,\n checkTime: boolean,\n) => {\n if (max) {\n if (checkTime && checkDate) {\n return isAfter(date, max);\n }\n if (checkTime) {\n // only time is visible so ignore date: use same datre as base\n const base = new Date(0);\n return isAfter(updateTime(base, date), updateTime(base, max));\n }\n if (checkDate) {\n // use same time base\n const base = new Date(0);\n return isAfter(updateDate(base, date), updateDate(base, max));\n }\n }\n return false;\n};\n","// Use this method to reduce many method calls to a few.\n// It's an 'immediate' implementation, so it will call the callbackindex: number once immediately an then again after the given wait.\n\ntype CallbackFunc<T> = (value: T, index: number) => void;\n\nconst debounce = <T>(callback: CallbackFunc<T>, wait: number) => {\n let timer: ReturnType<typeof setTimeout>;\n let lastCall = 0;\n\n return (...args: Parameters<typeof callback>) => {\n const [value, index] = args;\n clearTimeout(timer);\n const now = Date.now();\n const timeFromLastCall = now - lastCall;\n\n if (timeFromLastCall > wait) {\n lastCall = now;\n callback(value, index);\n } else {\n timer = setTimeout(() => {\n lastCall = now;\n callback(value, index);\n }, wait);\n }\n };\n};\n\nexport default debounce;\n","/**\n * These definitions can be used to filter an array. Each entry should contain a method normalize which can be used to\n * compile any filter settings and a method \"test\" which takes the compiled result, additional settings and the item to\n * be matched/filtered\n * */\ninterface FilterDefinition<SearchTerm, Normalized, Testable> {\n id: string;\n normalize: (\n searchTerm: SearchTerm,\n caseSensitiveSearch: boolean,\n ) => Normalized;\n test: (\n text: Testable,\n normalizedSearchTerm: Normalized,\n caseSensitiveSearch: boolean,\n inverseSearch: boolean,\n ) => boolean;\n}\n\ninterface StringTest {\n test(str: string): boolean;\n}\n\ntype SearchFilterDefinition = FilterDefinition<string, string, string>;\ntype PatternFilterDefinition = FilterDefinition<\n string,\n RegExp | StringTest,\n string\n>;\ntype TypeFilterDefinition = FilterDefinition<\n string[],\n StringTest,\n string | undefined\n>;\n\nconst modeDefinitions = [\n {\n id: \"search\",\n normalize(searchTerm, caseSensitiveSearch) {\n return caseSensitiveSearch ? searchTerm : searchTerm.toLowerCase();\n },\n test(text, normalizedSearchTerm, caseSensitiveSearch, inverseSearch) {\n const testText = caseSensitiveSearch ? text : text.toLowerCase();\n const matches = testText.includes(normalizedSearchTerm);\n return inverseSearch ? !matches : matches;\n },\n } satisfies SearchFilterDefinition,\n {\n id: \"wildcard\",\n normalize(searchTerm, caseSensitiveSearch) {\n // Do a regex search, explicitly matching start and end of the search term.\n // All regex special character except from \"* and ?\" (wildcards) are escaped.\n if (searchTerm.length > 0) {\n const escapedSearchTerm = searchTerm.replace(\n /[-[\\]{}()+.,\\\\^$|#\\s]/g,\n \"\\\\$&\",\n );\n const wildcardSearchTerm = escapedSearchTerm\n .replace(/\\*/g, \".*\")\n .replace(/\\?/g, \".?\");\n searchTerm = `^${wildcardSearchTerm}$`;\n } else {\n return { test: () => false };\n }\n try {\n const flags = caseSensitiveSearch ? \"\" : \"i\";\n return new RegExp(searchTerm, flags);\n } catch (_error) {\n // In case of an invalid regular expression, an impossible\n // regex is returned, not matching anything.\n return /$^/;\n }\n },\n test(text, normalizedSearchTerm, caseSensitiveSearch, inverseSearch) {\n const matches = normalizedSearchTerm.test(text);\n return inverseSearch ? !matches : matches;\n },\n } satisfies PatternFilterDefinition,\n {\n id: \"regex\",\n normalize(searchTerm, caseSensitiveSearch) {\n try {\n const flags = caseSensitiveSearch ? \"\" : \"i\";\n return new RegExp(`^(${searchTerm})$`, flags);\n } catch (_error) {\n // In case of an invalid regular expression, an impossible\n // regex is returned, not matching anything.\n return /$^/;\n }\n },\n test(text, normalizedSearchTerm, caseSensitiveSearch, inverseSearch) {\n const matches = normalizedSearchTerm.test(text);\n return inverseSearch ? !matches : matches;\n },\n } satisfies PatternFilterDefinition,\n {\n id: \"type\",\n normalize(selectedTypes) {\n return { test: (type: string) => selectedTypes.includes(type) };\n },\n test(type, normalizedSearchTerm) {\n if (typeof type === \"undefined\") {\n return false;\n }\n return normalizedSearchTerm.test(type);\n },\n } satisfies TypeFilterDefinition,\n];\n\n// convert [{id: \"key1\", text: \"asdf\"}, ...] to {\"key1\": {id:\"key1\", text: \"asdf\"} ... }\nexport const filters: Record<\n string,\n FilterDefinition<unknown, unknown, unknown>\n> = Object.assign({}, ...modeDefinitions.map((obj) => ({ [obj.id]: obj })));\n","/**\n * Get the users local timezone.\n *\n * @returns current users timezone (browser based) tz db string (e. g. Europe/Berlin).\n */\n// eslint-disable-next-line new-cap\nexport default () => Intl.DateTimeFormat().resolvedOptions().timeZone;\n","import prettyBytes from \"pretty-bytes\";\n\nimport getLocalTimeZone from \"./localTimezone\";\n/**\n * Converts the specified date String to human readable text containing the day, month, and year.\n * Example: '2018-07-31T09:44:31+00:00' => 'Jul 31, 2018'\n *\n * @param dateString String representation of the Date to format\n * @param useTimeZone to set the timeZone where the user is located, and display local date and time\n * @returns human readable date String\n */\nexport const formatDateString = (\n dateString: string | number,\n useTimeZone = false,\n) => {\n const date = new Date(dateString);\n\n // @ts-expect-error Argument of type 'Date' is not assignable to parameter of type 'number'\n if (isNaN(date)) {\n throw Error(\"Invalid Date format\");\n }\n\n const baseDateOptions: Intl.DateTimeFormatOptions = {\n day: \"numeric\",\n month: \"short\",\n year: \"numeric\",\n };\n\n // This only works for the default locale of en-US, as support of other locals in node js might not be available\n // See for example this issue https://github.com/nodejs/node/issues/8500\n const dateOptions: Intl.DateTimeFormatOptions = useTimeZone\n ? { ...baseDateOptions, timeZone: getLocalTimeZone() }\n : baseDateOptions;\n\n return date.toLocaleDateString(\"en-US\", dateOptions);\n};\n\n/**\n * Converts the specified time String to human readable text containing the hour (12-hour) and minute.\n * Example: '2018-07-31T09:44:31+00:00' => '9:44 AM'\n *\n * @param timeString String representation of the Date (including time) to format\n * @param useTimeZone to set the timeZone where the user is located, and display local date and time\n * @returns human readable time String\n */\nexport const formatTimeString = (\n timeString: string | number,\n useTimeZone = false,\n) => {\n const time = new Date(timeString);\n\n // @ts-expect-error Argument of type 'Date' is not assignable to parameter of type 'number'\n if (isNaN(time)) {\n throw Error(\"Invalid Date format\");\n }\n\n // This only works for the default locale of en-US, as support of other locals in node js might not be available\n // See for example this issue https://github.com/nodejs/node/issues/8500\n const baseTimeOptions: Intl.DateTimeFormatOptions = {\n hour: \"numeric\",\n minute: \"2-digit\",\n };\n\n const timeOptions: Intl.DateTimeFormatOptions = useTimeZone\n ? { ...baseTimeOptions, timeZone: getLocalTimeZone() }\n : baseTimeOptions;\n\n return time.toLocaleTimeString(\"en-US\", timeOptions);\n};\n\n/**\n * Converts the specified time String to human readable text containing the date (day, month, year) and time (hour,\n * minute; 12-hour).\n * Example: '2018-07-31T09:44:31+00:00' => 'Jul 31, 2018 9:44 AM'\n *\n * @param dateTimeString String representation of the Date (including time and date) to format\n * @param useTimeZone to set the timeZone where the user is located, and display local date and time\n * @returns human readable date/time String\n */\nexport const formatDateTimeString = (\n dateTimeString: string | number,\n useTimeZone = false,\n) => {\n return `${formatDateString(dateTimeString, useTimeZone)} ${formatTimeString(\n dateTimeString,\n useTimeZone,\n )}`;\n};\n\n/**\n * Converts the specified date and time to the user time zone with option to display (day, month, year) only or with time (hour,\n * minute; 12-hour).\n *\n * @param showTime String representation of the Date to convert and format\n * @param String | number} date String representation of the Date to convert and format\n * @returns human readable date/time String converted to user time zone\n */\nexport const formatLocalDateTimeString = (date: string, showTime: boolean) =>\n showTime ? formatDateTimeString(date, true) : formatDateString(date, true);\n\nexport const formatFileSize = (bytes: number): string => {\n const safeBytes = Number.isFinite(bytes) && bytes >= 0 ? bytes : 0;\n\n return prettyBytes(safeBytes);\n};\n","const getDeepActiveElement = () => {\n let element = document?.activeElement;\n while (element?.shadowRoot) {\n element = element?.shadowRoot?.activeElement;\n }\n return element;\n};\n\nexport default getDeepActiveElement;\n","/**\n * Since (a % b) yields a negative outcome for negative a, we need this method in order\n * to correctly compute wrapped around indices in lists\n * @param {number} index an arbitrary integer\n * @param {number} length a positive integer\n * @returns {number} the non-negative modulo outcome\n */\nexport default (index: number, length: number) =>\n ((index % length) + length) % length;\n","export type Period = {\n negative: boolean;\n years: number;\n months: number;\n weeks: number;\n days: number;\n};\n\nexport type Duration = {\n negative: boolean;\n hours: number;\n minutes: number;\n seconds: number;\n milliseconds: number;\n};\n\ntype AllowedIntervalTypes = \"DATE\" | \"TIME\";\ntype AllowedIntervalTypesOrEither = AllowedIntervalTypes | \"DATE_OR_TIME\";\n\ntype IntervalStringValidationResult =\n | {\n valid: true;\n type: AllowedIntervalTypes;\n negative: boolean;\n }\n | { valid: false };\n\nexport type PeriodOrDuration =\n | {\n interval: Period;\n type: \"DATE\";\n }\n | {\n interval: Duration;\n type: \"TIME\";\n };\n\nconst extractPeriodFromRegexMatch = (\n negative: boolean,\n match: RegExpExecArray,\n): Period => {\n return {\n negative,\n years: parseInt(match[1] ?? \"0\", 10),\n months: parseInt(match[2] ?? \"0\", 10),\n weeks: parseInt(match[3] ?? \"0\", 10),\n days: parseInt(match[4] ?? \"0\", 10),\n };\n};\n\nconst extractDurationFromRegexMatch = (\n negative: boolean,\n match: RegExpExecArray,\n): Duration => {\n // eslint-disable-next-line no-magic-numbers\n const milliseconds = parseInt(match[4]?.padEnd(3, \"0\") ?? \"0\", 10);\n\n return {\n negative,\n hours: parseInt(match[1] ?? \"0\", 10),\n minutes: parseInt(match[2] ?? \"0\", 10),\n seconds: parseInt(match[3] ?? \"0\", 10),\n milliseconds,\n };\n};\n\nexport const isZero = (interval: PeriodOrDuration): boolean => {\n if (interval.type === \"DATE\") {\n return (\n interval.interval.years === 0 &&\n interval.interval.months === 0 &&\n interval.interval.weeks === 0 &&\n interval.interval.days === 0\n );\n } else {\n return (\n interval.interval.hours === 0 &&\n interval.interval.minutes === 0 &&\n interval.interval.seconds === 0 &&\n interval.interval.milliseconds === 0\n );\n }\n};\n\n/**\n * Take an interval object and convert it to an ISO duration or period string. All parts of the\n * relevant part of the Interval object are included in the output, even if they are zero.\n *\n * Technically the ISO standard allows to mix period and duration parts, but we don't support that\n * here because it's incredibly hard to deal with all the edge cases. Maybe in a future ticket.\n *\n * The output here is allowed to be negative, in which case the minus sign is prepended to the\n * output.\n *\n * @param toFormat The PeriodOrDuration object to format\n */\nexport const formatIntervalToISOIntervalString = (\n toFormat: PeriodOrDuration,\n): string => {\n let output = \"P\";\n\n if (toFormat.type === \"DATE\") {\n output += `${toFormat.interval.years}Y${toFormat.interval.months}M${toFormat.interval.weeks}W${toFormat.interval.days}D`;\n } else {\n output += `T${toFormat.interval.hours}H${toFormat.interval.minutes}M${toFormat.interval.seconds}.${toFormat.interval.milliseconds\n .toString()\n // eslint-disable-next-line no-magic-numbers\n .padStart(3, \"0\")}S`;\n }\n\n if (toFormat.interval.negative) {\n output = `-${output}`;\n }\n return output;\n};\n\n/**\n * Take an interval object and convert it to a human readable string. Only non-zero parts are\n * included in the output (unless all parts are 0).\n *\n * The output here is allowed to be negative, in which case the minus sign is prepended to the\n * output and we wrap the whole thing in brackets e.g. -(1 year 2 days).\n *\n * @param toFormat The PeriodOrDuration object to format\n */\nexport const formatIntervalToHumanReadableIntervalString = (\n toFormat: PeriodOrDuration,\n): string => {\n const formatPart = (value: number, unit: string): string => {\n if (value === 0) {\n return \"\";\n } else if (value === 1) {\n return `${value} ${unit} `;\n } else {\n return `${value} ${unit}s `;\n }\n };\n\n let output = \"\";\n\n if (toFormat.type === \"DATE\") {\n if (isZero(toFormat)) {\n return \"0 days\";\n }\n\n output += formatPart(toFormat.interval.years, \"year\");\n output += formatPart(toFormat.interval.months, \"month\");\n output += formatPart(toFormat.interval.weeks, \"week\");\n output += formatPart(toFormat.interval.days, \"day\");\n } else {\n if (isZero(toFormat)) {\n return \"0 seconds\";\n }\n\n output += formatPart(toFormat.interval.hours, \"hour\");\n output += formatPart(toFormat.interval.minutes, \"minute\");\n\n const milliSecondsZero = toFormat.interval.milliseconds === 0;\n if (toFormat.interval.seconds !== 0 || !milliSecondsZero) {\n if (milliSecondsZero) {\n output += formatPart(toFormat.interval.seconds, \"second\");\n } else {\n output += `${toFormat.interval.seconds}.${toFormat.interval.milliseconds.toString().padStart(3, \"0\")} seconds `; // eslint-disable-line no-magic-numbers\n }\n }\n }\n\n if (toFormat.interval.negative) {\n output = `-(${output.trim()})`;\n }\n\n return output.trim();\n};\n\nconst yearsPart = \"(\\\\d+)\\\\s*y(?:ears?)?\";\nconst monthsPart = \"(\\\\d+)\\\\s*m(?:o(?:nths?)?)?\";\nconst weeksPart = \"(\\\\d+)\\\\s*w(?:eeks?)?\";\nconst daysPart = \"(\\\\d+)\\\\s*d(?:ays?)?\";\nconst hoursPart = \"(\\\\d+)\\\\s*h(?:ours?)?\";\nconst minutesPart = \"(\\\\d+)\\\\s*m(?:in(?:s|utes?)?)?\";\nconst secondsPart = \"(\\\\d+)(?:[,.](\\\\d{1,3}))?\\\\s*s(?:ec(?:s|onds?)?)?\";\n\n/**\n * Matches a human readable period string, e.g. \"1y 2mo 3weeks 4day\" (each part is optional)\n */\nconst humanReadablePeriodRegex = new RegExp(\n `^(?:${yearsPart})?\\\\s*(?:${monthsPart})?\\\\s*(?:${weeksPart})?\\\\s*(?:${daysPart})?\\\\s*$`,\n \"i\",\n);\n\n/**\n * Matches a human readable duration string, e.g. \"1h 2m 3.456s\" (each part is optional)\n */\nconst humanReadableDurationRegex = new RegExp(\n `^(?:${hoursPart})?\\\\s*(?:${minutesPart})?\\\\s*(?:${secondsPart})?$`,\n \"i\",\n);\n\n/**\n * Matches a negative human readable period string, e.g. \"-(1y 2mo 3weeks 4day)\" (each part is optional)\n */\nconst negativeHumanReadablePeriodRegex = new RegExp(\n `^\\\\s*-\\\\s*\\\\(\\\\s*${humanReadablePeriodRegex.source.replace(/[$^]/g, \"\")}\\\\s*\\\\)\\\\s*$`,\n \"i\",\n);\n\n/**\n * Matches a negative human readable period string with one field like \"-1y\" or \"-1w\"\n */\nconst negativeHumanReadablePeriodRegexWithSingleField = new RegExp(\n `^\\\\s*-\\\\s*(?:\\\\s*${yearsPart}|${monthsPart}|${weeksPart}|${daysPart})\\\\s*$`,\n \"i\",\n);\n\n/**\n * Matches a negative human readable duration string, e.g. \"-(1h 2m 3.456s)\" (each part is optional)\n */\nconst negativeHumanReadableDurationRegex = new RegExp(\n `^\\\\s*-\\\\s*\\\\(\\\\s*${humanReadableDurationRegex.source.replace(/[$^]/g, \"\")}\\\\s*\\\\)\\\\s*$`,\n \"i\",\n);\n\n/**\n * Matches a negative human readable duration string with one field like \"-1h\" or \"-1.5s\"\n */\nconst negativeHumanReadableDurationRegexWithSingleField = new RegExp(\n `^\\\\s*-\\\\s*(?:\\\\s*${hoursPart}|${minutesPart}|${secondsPart})\\\\s*$`,\n \"i\",\n);\n\n/**\n * Try to parse a human readable interval string into an Interval object. Any parts not specified\n * are assumed to be zero. Note that the string must be either a period or a duration, not a mix of\n * both. So for example, \"1y 2mo 3weeks 4day\" is fine, as is \"1h 2m 3.456s\". However, \"1y 2mo 1sec\"\n * is not, since it's a mix of both.\n *\n * Negative intervals are allowed, although if multiple fields are provided the string must include\n * brackets, so \"-(1y 2mo)\" is also valid, as is \"-5 seconds\".\n *\n * The string is required to have at least some content, any string that is blank will throw an error.\n *\n * @param intervalString The human readable time string\n */\nexport const parseHumanReadableIntervalString = (\n intervalString: string,\n): PeriodOrDuration => {\n intervalString = intervalString?.trim();\n\n if (!intervalString) {\n throw new Error(\"Empty interval string\");\n }\n\n const matchPositivePeriod = humanReadablePeriodRegex.exec(intervalString);\n const matchNegativePeriod =\n negativeHumanReadablePeriodRegex.exec(intervalString) ??\n negativeHumanReadablePeriodRegexWithSingleField.exec(intervalString);\n const matchPositiveDuration = humanReadableDurationRegex.exec(intervalString);\n const matchNegativeDuration =\n negativeHumanReadableDurationRegex.exec(intervalString) ??\n negativeHumanReadableDurationRegexWithSingleField.exec(intervalString);\n\n const matchPeriod = matchPositivePeriod ?? matchNegativePeriod;\n const matchDuration = matchPositiveDuration ?? matchNegativeDuration;\n const negative = (matchNegativePeriod ?? matchNegativeDuration) !== null;\n\n // I think this will happen only for the string \"1M\" or similar\n if (matchDuration && matchPeriod) {\n throw new Error(\"Ambiguous time format\");\n }\n\n if (matchPeriod) {\n return {\n type: \"DATE\",\n interval: extractPeriodFromRegexMatch(negative, matchPeriod),\n };\n } else if (matchDuration) {\n return {\n type: \"TIME\",\n interval: extractDurationFromRegexMatch(negative, matchDuration),\n };\n } else {\n throw new Error(`Invalid human readable time: ${intervalString}`);\n }\n};\n\n/**\n * Check if the given string can be understood as a human readable duration or period string. The\n * type parameter specifies whether the string should be a date, time, or either.\n *\n * @param time the string to check\n * @param expectedType the type of the string - either \"DATE\", \"TIME\", or \"ANY\"\n */\nexport const isValidHumanReadableIntervalString = (\n time: string,\n expectedType: AllowedIntervalTypesOrEither,\n): IntervalStringValidationResult => {\n try {\n const validationResult = parseHumanReadableIntervalString(time);\n const actualType = validationResult.type;\n const negative = validationResult.interval.negative;\n\n if (actualType === expectedType || expectedType === \"DATE_OR_TIME\") {\n return {\n valid: true,\n type: actualType,\n negative,\n };\n } else {\n return { valid: false };\n }\n } catch (_e) {\n return { valid: false };\n }\n};\n\n/**\n * Convert an ISO duration OR period string to an Interval object. So for example,\n * \"P1Y2M3W4D\" is fine, as is \"PT1H2M3.456S\". However, \"P1Y2M3W4D1H2M3.456S\" is not, since\n * it's a mix of both. We're more forgiving than the ISO standard, so we allow for missing parts.\n * Also, the string is allowed to be negative, so \"-P1Y2M3W4D\" is also valid.\n *\n * The string is required to have at least some content, so the strings \"\", \"P\", and \"PT\" are\n * considered invalid (also if they start with a -).\n *\n * @param isoString The ISO duration or period string.\n */\nexport const parseISOIntervalString = (isoString: string): PeriodOrDuration => {\n isoString = isoString?.trim();\n\n if ([\"\", \"P\", \"PT\", \"-\", \"-P\", \"-PT\"].includes(isoString)) {\n throw new Error(\"Empty ISO duration\");\n }\n\n const periodRegex = /^-?P(?:(\\d+)Y)?(?:(\\d+)M)?(?:(\\d+)W)?(?:(\\d+)D)?$/;\n const durationRegex =\n /^-?PT(?:(\\d+)H)?(?:(\\d+)M)?(?:(\\d+)(?:[,.](\\d{1,3}))?S)?$/;\n\n const matchPeriod = periodRegex.exec(isoString);\n const matchDuration = durationRegex.exec(isoString);\n\n if (matchPeriod) {\n return {\n type: \"DATE\",\n interval: extractPeriodFromRegexMatch(\n isoString.startsWith(\"-\"),\n matchPeriod,\n ),\n };\n } else if (matchDuration) {\n return {\n type: \"TIME\",\n interval: extractDurationFromRegexMatch(\n isoString.startsWith(\"-\"),\n matchDuration,\n ),\n };\n } else {\n throw new Error(`Invalid ISO duration: ${isoString}`);\n }\n};\n\n/**\n * Check if the given string is a valid duration or period ISO string. The type parameter\n * specifies whether the string should be a date, time, or either.\n *\n * @param isoString the string to check\n * @param type the type of the string - either \"DATE\", \"TIME\", or \"ANY\"\n */\nexport const isValidISOIntervalString = (\n isoString: string,\n type: AllowedIntervalTypesOrEither,\n): IntervalStringValidationResult => {\n try {\n const validationResult = parseISOIntervalString(isoString);\n const actualType = validationResult.type;\n const negative = validationResult.interval.negative;\n\n if (actualType === type || type === \"DATE_OR_TIME\") {\n return {\n valid: true,\n type: actualType,\n negative,\n };\n } else {\n return { valid: false };\n }\n } catch (_e) {\n return { valid: false };\n }\n};\n\n/**\n * Try to convert an interval string to an Interval object. The string can be either an ISO\n * duration/period string or a human readable string. If the string is not valid, an error is\n * thrown.\n *\n * @param time the time string, either ISO or human readable\n */\nexport const parseGenericIntervalString = (time: string): PeriodOrDuration => {\n const validISO = isValidISOIntervalString(time, \"DATE_OR_TIME\");\n const validHumanReadable = isValidHumanReadableIntervalString(\n time,\n \"DATE_OR_TIME\",\n );\n if (validISO.valid) {\n return parseISOIntervalString(time);\n } else if (validHumanReadable.valid) {\n return parseHumanReadableIntervalString(time);\n } else {\n throw new Error(`Invalid interval string: ${time}`);\n }\n};\n\n/**\n * Check if the given string is a valid interval string, either human readable or ISO. The type parameter\n * specifies whether the string should be a period, duration, or either.\n *\n * @param time the time string to check\n * @param type the type of the string - either \"DATE\", \"TIME\", or \"ANY\"\n */\nexport const isValidIntervalString = (\n time: string,\n type: AllowedIntervalTypesOrEither,\n): IntervalStringValidationResult => {\n const validISO = isValidISOIntervalString(time, type);\n const validHumanReadable = isValidHumanReadableIntervalString(time, type);\n if (validISO.valid) {\n return validISO;\n } else if (validHumanReadable.valid) {\n return validHumanReadable;\n } else {\n return { valid: false };\n }\n};\n","/**\n * Count the number of integer digits for a given number.\n *\n * @param input number.\n * @returns number of integer digits x has. 1234 = 4 but 1234.44 is also 4.\n */\nexport default (input: number) =>\n Math.max(Math.floor(Math.log10(Math.abs(input))), 0) + 1;\n","export class AbortError extends Error {}\n\n/**\n * Helper to create an abortable promise. Returns an AbortController and a Function\n * that you can pass your async handler to. Whenever the AbortController signal is\n * aborted then the async handler's promise will reject with an AbortError\n *\n * Example:\n * ```\n * import { abortUtils } from \"@knime/utils\"\n * const myFetchCall = async (params...) => {...};\n *\n * try {\n * const { runAbortablePromise, abortController } = createAbortablePromise(() =>\n * myFetchCall(params...),\n * );\n * } catch (e) {\n * if (e instanceof abortUtils.AbortError) {\n * console.info('ignore due to abort');\n * return;\n * }\n * }\n *\n * // somewhere else (while request is in-flight)\n * abortController.abort(new abortUtils.AbortError('reason here'))\n * ```\n */\nexport const createAbortablePromise = () => {\n const abortController: AbortController = new AbortController();\n\n const runAbortablePromise = <T = unknown>(request: () => Promise<T>) => {\n return new Promise<T>((resolve, reject) => {\n // abort logic\n const abortListener = ({ target }: Event) => {\n abortController.signal.removeEventListener(\"abort\", abortListener);\n const reason = (target as AbortSignal).reason;\n reject(reason instanceof AbortError ? reason : new AbortError(reason));\n };\n\n // the actual call\n request()\n .then(resolve)\n .catch((error) => {\n if (error instanceof AbortError) {\n return;\n }\n\n reject(error);\n });\n\n abortController.signal.addEventListener(\"abort\", abortListener);\n });\n };\n\n return { abortController, runAbortablePromise };\n};\n","export type UnwrappedPromise<T = unknown> = {\n resolve: (value: T | PromiseLike<T>) => void;\n reject: (reason?: unknown) => void;\n promise: Promise<T>;\n};\n\nexport const createUnwrappedPromise = <T>(): UnwrappedPromise<T> => {\n let resolve: (value: T | PromiseLike<T>) => void = () => {};\n let reject: (reason?: unknown) => void = () => {};\n\n const promise = new Promise<T>((res, rej) => {\n resolve = res;\n reject = rej;\n });\n\n return { resolve, reject, promise };\n};\n","/**\n * Returns promise that resolves after ms.\n */\nexport default function sleep(ms: number) {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n","import sleep from \"../sleep\";\n\nexport const DEFAULT_RETRY_DELAY_MS = 0;\nexport const DEFAULT_RETRY_COUNT = 5;\n\n/**\n * Helper to add retry capability to an async function\n * @param fn async function\n * @param retryCount max number of retries. defaults to 5\n * @param retryDelayMS delay in-between retries in millisecs. defaults to 0\n * @param excludeError predicate fn to exclude specific errors from causing a retry\n */\nexport async function retryPromise<T>({\n fn,\n retryCount = DEFAULT_RETRY_COUNT,\n retryDelayMS = DEFAULT_RETRY_DELAY_MS,\n excludeError,\n}: {\n fn: () => Promise<T>;\n retryCount?: number;\n retryDelayMS?: number;\n excludeError?: (error: Error) => boolean;\n}) {\n try {\n return await fn();\n } catch (error) {\n if (excludeError?.(error as Error)) {\n throw error;\n }\n\n if (retryCount > 0) {\n await sleep(retryDelayMS);\n\n // eslint-disable-next-line no-return-await\n return await retryPromise({\n fn,\n retryCount: retryCount - 1,\n retryDelayMS,\n excludeError,\n });\n }\n\n throw error;\n }\n}\n","export * from \"./createAbortablePromise\";\nexport * from \"./createUnwrappedPromise\";\nexport * from \"./retryPromise\";\n","import DomPurify from \"dompurify\";\n\nconst ALLOWED_TAGS = [\n \"p\",\n \"div\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n \"h6\",\n \"ul\",\n \"ol\",\n \"li\",\n \"blockquote\",\n \"b\",\n \"i\",\n \"s\",\n \"u\",\n \"sup\",\n \"sub\",\n \"ins\",\n \"del\",\n \"strong\",\n \"strike\",\n \"tt\",\n \"code\",\n \"big\",\n \"small\",\n \"br\",\n \"span\",\n \"em\",\n];\n\n/**\n * Sanitizes Raw HTML and only allow specific tags to be used, as per OWASP standards.\n * @param rawHTML\n * @param options.allowStyleAttribute - Allow the style attribute on elements\n * @param options.allowHyperlinks - Allow anchor tags with href attribute\n * @returns sanitized html\n */\nconst sanitizeHTML = (\n rawHTML: string,\n options: { allowStyleAttribute?: boolean; allowHyperlinks?: boolean } = {\n allowStyleAttribute: false,\n allowHyperlinks: false,\n },\n) => {\n const { allowStyleAttribute, allowHyperlinks } = options;\n const ALLOWED_ATTR = [\n ...(allowStyleAttribute ? [\"style\"] : []),\n ...(allowHyperlinks ? [\"href\"] : []),\n ];\n const allowedTags = allowHyperlinks ? [...ALLOWED_TAGS, \"a\"] : ALLOWED_TAGS;\n\n return DomPurify.sanitize(rawHTML, {\n ALLOWED_TAGS: allowedTags,\n ALLOWED_ATTR,\n });\n};\n\n/**\n * Removes any HTML tag from the input string. Keeps HTML entities\n * (e.g because these can be considered plain text)\n * @param rawHTML\n * @returns plain text\n */\nconst stripHTML = (rawHTML: string) => {\n return DomPurify.sanitize(rawHTML, { ALLOWED_TAGS: [], ALLOWED_ATTR: [] });\n};\n\nexport const sanitization = { sanitizeHTML, stripHTML };\n","const defaultMaxLength = 160;\n\n// truncates a string to a given max length\nexport default (string = \"\", maxLength = defaultMaxLength) => {\n const dots = string.length > maxLength ? \"…\" : \"\";\n return `${string.substring(0, maxLength - 1)}${dots}`;\n};\n","/**\n * Gets the file extension\n * @param nameOrPath can take a full file name (e.g \"file.txt\") or a path to a file\n * (e.g \"file://path/to/file.txt\" OR \"/path/to/file.txt\")\n * @returns just the file extension (e.g \"txt\")\n */\nexport const getFileExtension = (nameOrPath: string): string => {\n const basename = nameOrPath.split(/[\\\\/]/).pop() ?? \"\";\n\n const parts = basename.split(\".\");\n\n if (basename === \"\" || parts.length === 1) {\n return \"\";\n }\n\n return parts.at(-1) ?? \"\";\n};\n\n/**\n * Metadata for .knar files, which corresponds to exported KNIME Workflow Groups\n * or Components\n */\nconst KNAR = Object.freeze({\n extension: \"knar\",\n mimeType: \"application/vnd.knime.workflow-group+zip\",\n matches(file: File) {\n const extension = getFileExtension(file.name);\n return extension === this.extension;\n },\n});\n\n/**\n * Metadata for .knwf files, which corresponds to exported KNIME Workflows\n */\nconst KNWF = Object.freeze({\n extension: \"knwf\",\n mimeType: \"application/vnd.knime.workflow+zip\",\n matches(file: File) {\n const extension = getFileExtension(file.name);\n return extension === this.extension;\n },\n /**\n * Gets the name of a .knwf file without the extension. If the file is not\n * matched as a .knwf file then this function will return the default value,\n * which is empty string (\"\") if param is not provided\n */\n getNameOrDefault(file: File, defaultValue = \"\"): string {\n if (!this.matches(file)) {\n return defaultValue;\n }\n\n return file.name.replace(`.${this.extension}`, \"\");\n },\n});\n\nexport const knimeFileFormats = { KNAR, KNWF };\n\n/**\n * Gets the mime type from a given file. Defaults to `application/octet-stream`\n * if mimeType cannot be detected\n * @param file File\n * @returns mimeType\n */\nexport const getFileMimeType = (file: File): string => {\n const DEFAULT_MIMETYPE = \"application/octet-stream\";\n\n const extension = getFileExtension(file.name);\n\n if (!extension) {\n return DEFAULT_MIMETYPE;\n }\n\n if (KNWF.matches(file)) {\n return KNWF.mimeType;\n }\n\n if (KNAR.matches(file)) {\n return KNAR.mimeType;\n }\n\n // file has extension but unrecognizable mime type\n if (!file.type) {\n return DEFAULT_MIMETYPE;\n }\n\n return file.type;\n};\n","/**\n * Platforms that influence how modifier keys are rendered. macOS substitutes\n * dedicated glyphs (`⌘`, `⌥`, `⇧`, …), every other platform uses the textual\n * rendering (`Ctrl`, `Alt`, `Shift`, …).\n */\nexport const hotkeyPlatform = {\n MAC_OS: \"macOS\",\n OTHER: \"other\",\n} as const;\n\nexport const hotkeyPlatforms = Object.values(hotkeyPlatform);\n","/**\n *\n * @returns true if the platform of the user is Mac\n */\nexport const isMac = (): boolean =>\n navigator?.userAgent?.toLowerCase()?.includes(\"mac\");\n\n/**\n *\n * @returns true if the platform of the user is Windows\n */\nexport const isWindows = (): boolean =>\n navigator?.userAgent?.toLowerCase()?.includes(\"windows\");\n","import { isMac } from \"../platform/navigator\";\n\nimport { hotkeyPlatform } from \"./enums\";\nimport type { Hotkey, HotkeyPlatform } from \"./types\";\n\nconst globalKeyMap = {\n ArrowUp: \"↑\",\n ArrowDown: \"↓\",\n ArrowLeft: \"←\",\n ArrowRight: \"→\",\n Enter: \"↵\",\n \" \": \"Space\", // we use event.key and there space is an actual space not the code \"Space\"\n CtrlOrCmd: \"Ctrl\",\n} as const;\n\nconst MacOSkeyMap = {\n Shift: \"⇧\",\n Delete: \"⌫\",\n CtrlOrCmd: \"⌘\",\n Ctrl: \"⌃\",\n Alt: \"⌥\",\n Enter: \"↩\",\n} as const;\n\ntype KeyFormatMap = typeof MacOSkeyMap | typeof globalKeyMap;\n\n/**\n * Returns a string representation of a single hotkey. Replaces some special key names with symbols.\n *\n * By default the platform is auto-detected from the user agent via `isMac()`.\n * Pass `platform` to force a specific platform's glyphs — useful for SSR,\n * tests, or rendering multiple platforms on the same page.\n */\nexport const formatHotkey = (\n hotkey: Hotkey,\n platform?: HotkeyPlatform,\n): string => {\n /**\n * Returns the symbol corresponding to the `key` based on the given\n * `formatMap`. Otherwise, if not found, returns the same `key` value given\n */\n const mapSymbols = (formatMap: KeyFormatMap) => (key: Hotkey) =>\n formatMap[key as keyof KeyFormatMap] ?? key;\n\n /**\n * Pipe function implementation. Receives a list of functions to execute in order\n * and will pipe the parameter passed at the end to each function returning the final output\n */\n const pipe = <T extends () => string>(\n ...fns: Array<(...args: Hotkey[]) => ReturnType<T>>\n ) =>\n fns.reduce(\n (f, g) => (arg) => g(f(arg)),\n (arg: Hotkey) => arg as ReturnType<T>,\n );\n\n const macKeyFormatter = pipe(\n mapSymbols(MacOSkeyMap),\n mapSymbols(globalKeyMap),\n );\n\n const generalKeyFormatter = mapSymbols(globalKeyMap);\n\n const useMacFormatter =\n platform === undefined ? isMac() : platform === hotkeyPlatform.MAC_OS;\n return useMacFormatter\n ? macKeyFormatter(hotkey)\n : generalKeyFormatter(hotkey);\n};\n\nexport const getDefaultSeparator = () => (isMac() ? \" \" : \"+\");\n\n/**\n * Returns a string representation of a list of hotkeys. Replaces some special key names with symbols\n */\nexport const formatHotkeys = (\n hotkeys: Array<Hotkey>,\n getSeparator = getDefaultSeparator,\n) => hotkeys.map((hotkey) => formatHotkey(hotkey)).join(getSeparator());\n\n/**\n * Appends a formatted hotkey shortcut to the given string. Useful for tooltips\n */\nexport const textWithHotkeys = (text: string, hotkeys: Array<Hotkey>) => {\n return `${text} – ${formatHotkeys(hotkeys)}`;\n};\n","import * as navigatorUtils from \"../platform/navigator\";\n\nimport type { Hotkey } from \"./types\";\n\n/**\n * Checks whether a pressed `Digit` key falls within a numeric hotkey range such\n * as `1-9`.\n * @param keyCode - The `KeyboardEvent.code` to check (e.g. `Digit5`).\n * @param hotkey - The hotkey token, expected to be a single-digit range like `1-9`.\n * @returns True if the pressed digit lies within the inclusive range.\n */\nconst isDigitKeyInRange = (keyCode: string, hotkey: Hotkey): boolean => {\n // Digit keys exist from 0 to 9, so valid ranges always have length 3\n const digitRangeLength = 3;\n if (hotkey.length !== digitRangeLength || !keyCode?.startsWith(\"Digit\")) {\n return false;\n }\n\n const keyNumber = Number(keyCode.slice(\"Digit\".length));\n const [lower, upper] = hotkey.split(\"-\");\n\n return (\n Boolean(lower) &&\n Boolean(upper) &&\n Number.parseInt(lower, 10) <= keyNumber &&\n keyNumber <= Number.parseInt(upper, 10)\n );\n};\n\n/**\n * Checks whether a keyboard event matches a hotkey definition. The last token is\n * treated as the character; any preceding tokens are modifiers. The special\n * `CtrlOrCmd` modifier resolves to the platform's primary modifier (Meta/`⌘` on\n * macOS, Ctrl elsewhere).\n * @param event - The keyboard event to check.\n * @param hotkeys - The ordered hotkey tokens (modifiers followed by the character).\n * @returns True if the event matches the given hotkey, otherwise false.\n */\nexport const match = (event: KeyboardEvent, hotkeys: Hotkey[]): boolean => {\n const { key, code, metaKey, ctrlKey, shiftKey, altKey } = event;\n\n const modifiers = hotkeys.slice(); // copy so pop() doesn't mutate the caller's array\n const character = modifiers.pop() ?? \"\";\n\n // our special CtrlOrCmd has to match \"Command ⌘\" (metaKey) on Mac, and Ctrl-Key on other systems\n const ctrlOrMeta = navigatorUtils.isMac() ? \"Meta\" : \"Ctrl\";\n const platformModifiers = new Set(\n modifiers.map((modifier) =>\n modifier === \"CtrlOrCmd\" ? ctrlOrMeta : modifier,\n ),\n );\n\n const metaMatches = Boolean(metaKey) === platformModifiers.has(\"Meta\");\n const ctrlMatches = Boolean(ctrlKey) === platformModifiers.has(\"Ctrl\");\n const shiftMatches = Boolean(shiftKey) === platformModifiers.has(\"Shift\");\n const altMatches = Boolean(altKey) === platformModifiers.has(\"Alt\");\n\n const keysMatch =\n // keys are matched case insensitively\n key.toUpperCase() === character.toUpperCase() ||\n (character.includes(\"-\") && isDigitKeyInRange(code, character)) ||\n // on mac 'backspace' can be used instead of delete\n (navigatorUtils.isMac() && character === \"Delete\" && key === \"Backspace\");\n\n return metaMatches && ctrlMatches && shiftMatches && altMatches && keysMatch;\n};\n","import * as navigatorUtils from \"../platform/navigator\";\n\n/**\n * Checks if any modifier key (Ctrl, Meta, Alt, or Shift) is pressed.\n * @param event - The keyboard event to check.\n * @returns True if a modifier key is pressed, otherwise false.\n */\nexport const isModifierKeyPressed = (event: KeyboardEvent): boolean => {\n return event.ctrlKey || event.metaKey || event.altKey || event.shiftKey;\n};\n\n/**\n * Checks if a specific key (or keys) were pressed without any modifier keys.\n * @param event - The keyboard event to check.\n * @param keys - The key or keys to check for.\n * @returns True if the specified key(s) were pressed without modifiers, otherwise false.\n */\nexport const isKeyWithoutModifiers = (\n event: KeyboardEvent,\n keys: string | string[],\n): boolean => {\n const keyList = Array.isArray(keys) ? keys : [keys];\n return keyList.includes(event.key) && !isModifierKeyPressed(event);\n};\n\n/**\n * Returns the name of the primary modifier key for the current platform.\n */\nexport const getMetaOrCtrlKey = (): \"ctrlKey\" | \"metaKey\" => {\n return navigatorUtils.isMac() ? \"metaKey\" : \"ctrlKey\";\n};\n","import { hotkeyPlatform } from \"./enums\";\nimport {\n formatHotkey,\n formatHotkeys,\n getDefaultSeparator,\n textWithHotkeys,\n} from \"./format\";\nimport { match } from \"./match\";\n\n/**\n * Grouped keyboard-shortcut helpers, exposed as a single namespace for\n * ergonomic access (e.g. `hotkeys.formatHotkey`).\n */\nexport const hotkeys = {\n formatHotkeys,\n formatHotkey,\n getDefaultSeparator,\n hotkeyPlatform,\n textWithHotkeys,\n match,\n};\n\nexport { match };\nexport {\n getMetaOrCtrlKey,\n isKeyWithoutModifiers,\n isModifierKeyPressed,\n} from \"./modifiers\";\nexport type { Hotkey, HotkeyPlatform, KnownHotkey } from \"./types\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAKA,IAAa,cAAc,UACzB,MAAM,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,MAAM,UAAU,CAAC;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AAS,GAAG,KAAK,kBAAkB,MAAM,SAAS,KAE5D,MAAqB,KAAK,cAAc,YAAY,QAAQ;CAE/D,OAAO,eAAe,eAAe,gBAAgB,cAAc;AACrE;;;;;;;;AC1DA,IAAa,wBAAwB,UAAkC;CACrE,OAAO,MAAM,WAAW,MAAM,WAAW,MAAM,UAAU,MAAM;AACjE;;;;;;;AAQA,IAAa,yBACX,OACA,SACY;CAEZ,QADgB,MAAM,QAAQ,IAAI,IAAI,OAAO,CAAC,IAAI,EAAA,CACnC,SAAS,MAAM,GAAG,KAAK,CAAC,qBAAqB,KAAK;AACnE;;;;AAKA,IAAa,yBAAgD;CAC3D,OAAO,MAAqB,IAAI,YAAY;AAC9C;;;;;;;ACjBA,IAAa,UAAU;CACrB;CACA;CACA;CACA;CACA;CACA;AACF"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/capitalize.ts","../src/updateDate.ts","../src/updateTime.ts","../src/dateMinMaxCheck.ts","../src/debounce.ts","../src/filters.ts","../src/localTimezone.ts","../src/format.ts","../src/getDeepActiveElement.ts","../src/getWrappedAroundIndex.ts","../src/intervalUtils.ts","../src/numIntegerDigits.ts","../src/promise/createAbortablePromise.ts","../src/promise/createUnwrappedPromise.ts","../src/sleep.ts","../src/promise/retryPromise.ts","../src/promise/index.ts","../src/sanitization.ts","../src/truncateString.ts","../src/fileExtensions.ts","../src/hotkeys/enums.ts","../src/platform/navigator.ts","../src/hotkeys/format.ts","../src/hotkeys/match.ts","../src/hotkeys/modifiers.ts","../src/hotkeys/index.ts"],"sourcesContent":["/**\n * Uppercases first letter of string\n * @param string to be capitalized first string, e.g. \"workflow\"\n * @return Capitalized String, e.g. \"Workflow\"\n */\nexport const capitalize = (input: string) =>\n input.charAt(0).toUpperCase() + input.substring(1);\n\nconst formats = {\n customFormat: (input: string, delimiter: string) =>\n capitalize(input.replace(delimiter, \" \").toLowerCase()),\n\n kebabFormat: (input: string) => formats.customFormat(input, \"-\"),\n snakeFormat: (input: string) => formats.customFormat(input, \"_\"),\n\n camelPascalCase: (input: string) =>\n capitalize(\n (input.match(/([A-Z]?[^A-Z]*)/g) ?? [])\n .slice(0, -1)\n .join(\" \")\n .toLowerCase(),\n ),\n} as const;\n\ntype CaseFormatterOptions = {\n string: string;\n delimiter?: string;\n format?: keyof typeof formats;\n};\n\nexport const caseFormatter = ({\n string,\n delimiter,\n format,\n}: CaseFormatterOptions) => {\n if (delimiter) {\n return formats.customFormat(string, delimiter);\n }\n\n if (format) {\n return formats[format](string, delimiter ?? \"\");\n }\n\n return capitalize(string);\n};\n","import { getDate, getMonth, getYear, isValid, set } from \"date-fns\";\n/**\n * Updates the date part (year, day and month) of a date object (base)\n * time, offset (timezone) and so on will be left untouched.\n *\n * @param base - Date which will be used (copied) to set day, month and year.\n * @param date - Extract day, month and year from this date object.\n * @returns Copy of base with day, month and year of date.\n */\nexport default (base: Date, date: Date | null) => {\n // ignore falsy dates\n if (date) {\n // allow invalid base and set time to 0\n base = isValid(base) ? base : new Date(Date.UTC(0, 0));\n return set(base, {\n year: getYear(date),\n month: getMonth(date),\n date: getDate(date),\n });\n }\n\n return base;\n};\n","/**\n * Updates the time part (hour, minute, second and millisecond) of a date object (base)\n * date, offset (timezone) and so on will be left untouched.\n *\n * @param base - Date which will be used (copied) to set day, month and year.\n * @param date - Extract hour, minute, second and millisecond from this date object.\n * @returns Copy of base with hour, minute, second and millisecond changed.\n */\nexport default (base: Date, date: Date | null) => {\n const d = new Date(base);\n // ignore falsy dates\n if (date) {\n d.setHours(date.getHours());\n d.setMinutes(date.getMinutes());\n d.setSeconds(date.getSeconds());\n d.setMilliseconds(date.getMilliseconds());\n }\n return d;\n};\n","import { isAfter, isBefore } from \"date-fns\";\n\nimport updateDate from \"./updateDate\";\nimport updateTime from \"./updateTime\";\n\n/**\n * Check if date is before min.\n * @param date\n * @param min\n * @param checkDate - check date part (year, day, month).\n * @param checkTime - check time part (hour, minutes etc.).\n * @returns whether limit is kept or not.\n */\nexport const isBeforeMinDate = (\n date: Date,\n min: Date | null,\n checkDate: boolean,\n checkTime: boolean,\n) => {\n if (min) {\n if (checkTime && checkDate) {\n return isBefore(date, min);\n }\n if (checkTime) {\n // only time is visible so ignore date: use same datre as base\n const base = new Date(0);\n return isBefore(updateTime(base, date), updateTime(base, min));\n }\n if (checkDate) {\n // only date is visible so ignore time: use same time as base\n const base = new Date(0);\n return isBefore(updateDate(base, date), updateDate(base, min));\n }\n }\n return false;\n};\n\n/**\n * Check\n * @param date - date to check.\n * @param max - maximum date.\n * @param checkDate - check date part (year, day, month).\n * @param checkTime - check time part (hour, minutes etc.).\n * @returns whether limit is kept or not.\n */\nexport const isAfterMaxDate = (\n date: Date,\n max: Date | null,\n checkDate: boolean,\n checkTime: boolean,\n) => {\n if (max) {\n if (checkTime && checkDate) {\n return isAfter(date, max);\n }\n if (checkTime) {\n // only time is visible so ignore date: use same datre as base\n const base = new Date(0);\n return isAfter(updateTime(base, date), updateTime(base, max));\n }\n if (checkDate) {\n // use same time base\n const base = new Date(0);\n return isAfter(updateDate(base, date), updateDate(base, max));\n }\n }\n return false;\n};\n","// Use this method to reduce many method calls to a few.\n// It's an 'immediate' implementation, so it will call the callbackindex: number once immediately an then again after the given wait.\n\ntype CallbackFunc<T> = (value: T, index: number) => void;\n\nconst debounce = <T>(callback: CallbackFunc<T>, wait: number) => {\n let timer: ReturnType<typeof setTimeout>;\n let lastCall = 0;\n\n return (...args: Parameters<typeof callback>) => {\n const [value, index] = args;\n clearTimeout(timer);\n const now = Date.now();\n const timeFromLastCall = now - lastCall;\n\n if (timeFromLastCall > wait) {\n lastCall = now;\n callback(value, index);\n } else {\n timer = setTimeout(() => {\n lastCall = now;\n callback(value, index);\n }, wait);\n }\n };\n};\n\nexport default debounce;\n","/**\n * These definitions can be used to filter an array. Each entry should contain a method normalize which can be used to\n * compile any filter settings and a method \"test\" which takes the compiled result, additional settings and the item to\n * be matched/filtered\n * */\ninterface FilterDefinition<SearchTerm, Normalized, Testable> {\n id: string;\n normalize: (\n searchTerm: SearchTerm,\n caseSensitiveSearch: boolean,\n ) => Normalized;\n test: (\n text: Testable,\n normalizedSearchTerm: Normalized,\n caseSensitiveSearch: boolean,\n inverseSearch: boolean,\n ) => boolean;\n}\n\ninterface StringTest {\n test(str: string): boolean;\n}\n\ntype SearchFilterDefinition = FilterDefinition<string, string, string>;\ntype PatternFilterDefinition = FilterDefinition<\n string,\n RegExp | StringTest,\n string\n>;\ntype TypeFilterDefinition = FilterDefinition<\n string[],\n StringTest,\n string | undefined\n>;\n\nconst modeDefinitions = [\n {\n id: \"search\",\n normalize(searchTerm, caseSensitiveSearch) {\n return caseSensitiveSearch ? searchTerm : searchTerm.toLowerCase();\n },\n test(text, normalizedSearchTerm, caseSensitiveSearch, inverseSearch) {\n const testText = caseSensitiveSearch ? text : text.toLowerCase();\n const matches = testText.includes(normalizedSearchTerm);\n return inverseSearch ? !matches : matches;\n },\n } satisfies SearchFilterDefinition,\n {\n id: \"wildcard\",\n normalize(searchTerm, caseSensitiveSearch) {\n // Do a regex search, explicitly matching start and end of the search term.\n // All regex special character except from \"* and ?\" (wildcards) are escaped.\n if (searchTerm.length > 0) {\n const escapedSearchTerm = searchTerm.replace(\n /[-[\\]{}()+.,\\\\^$|#\\s]/g,\n \"\\\\$&\",\n );\n const wildcardSearchTerm = escapedSearchTerm\n .replace(/\\*/g, \".*\")\n .replace(/\\?/g, \".?\");\n searchTerm = `^${wildcardSearchTerm}$`;\n } else {\n return { test: () => false };\n }\n try {\n const flags = caseSensitiveSearch ? \"\" : \"i\";\n return new RegExp(searchTerm, flags);\n } catch (_error) {\n // In case of an invalid regular expression, an impossible\n // regex is returned, not matching anything.\n return /$^/;\n }\n },\n test(text, normalizedSearchTerm, caseSensitiveSearch, inverseSearch) {\n const matches = normalizedSearchTerm.test(text);\n return inverseSearch ? !matches : matches;\n },\n } satisfies PatternFilterDefinition,\n {\n id: \"regex\",\n normalize(searchTerm, caseSensitiveSearch) {\n try {\n const flags = caseSensitiveSearch ? \"\" : \"i\";\n return new RegExp(`^(${searchTerm})$`, flags);\n } catch (_error) {\n // In case of an invalid regular expression, an impossible\n // regex is returned, not matching anything.\n return /$^/;\n }\n },\n test(text, normalizedSearchTerm, caseSensitiveSearch, inverseSearch) {\n const matches = normalizedSearchTerm.test(text);\n return inverseSearch ? !matches : matches;\n },\n } satisfies PatternFilterDefinition,\n {\n id: \"type\",\n normalize(selectedTypes) {\n return { test: (type: string) => selectedTypes.includes(type) };\n },\n test(type, normalizedSearchTerm) {\n if (typeof type === \"undefined\") {\n return false;\n }\n return normalizedSearchTerm.test(type);\n },\n } satisfies TypeFilterDefinition,\n];\n\n// convert [{id: \"key1\", text: \"asdf\"}, ...] to {\"key1\": {id:\"key1\", text: \"asdf\"} ... }\nexport const filters: Record<\n string,\n FilterDefinition<unknown, unknown, unknown>\n> = Object.assign({}, ...modeDefinitions.map((obj) => ({ [obj.id]: obj })));\n","/**\n * Get the users local timezone.\n *\n * @returns current users timezone (browser based) tz db string (e. g. Europe/Berlin).\n */\n// eslint-disable-next-line new-cap\nexport default () => Intl.DateTimeFormat().resolvedOptions().timeZone;\n","import prettyBytes from \"pretty-bytes\";\n\nimport getLocalTimeZone from \"./localTimezone\";\n/**\n * Converts the specified date String to human readable text containing the day, month, and year.\n * Example: '2018-07-31T09:44:31+00:00' => 'Jul 31, 2018'\n *\n * @param dateString String representation of the Date to format\n * @param useTimeZone to set the timeZone where the user is located, and display local date and time\n * @returns human readable date String\n */\nexport const formatDateString = (\n dateString: string | number,\n useTimeZone = false,\n) => {\n const date = new Date(dateString);\n\n // @ts-expect-error Argument of type 'Date' is not assignable to parameter of type 'number'\n if (isNaN(date)) {\n throw Error(\"Invalid Date format\");\n }\n\n const baseDateOptions: Intl.DateTimeFormatOptions = {\n day: \"numeric\",\n month: \"short\",\n year: \"numeric\",\n };\n\n // This only works for the default locale of en-US, as support of other locals in node js might not be available\n // See for example this issue https://github.com/nodejs/node/issues/8500\n const dateOptions: Intl.DateTimeFormatOptions = useTimeZone\n ? { ...baseDateOptions, timeZone: getLocalTimeZone() }\n : baseDateOptions;\n\n return date.toLocaleDateString(\"en-US\", dateOptions);\n};\n\n/**\n * Converts the specified time String to human readable text containing the hour (12-hour) and minute.\n * Example: '2018-07-31T09:44:31+00:00' => '9:44 AM'\n *\n * @param timeString String representation of the Date (including time) to format\n * @param useTimeZone to set the timeZone where the user is located, and display local date and time\n * @returns human readable time String\n */\nexport const formatTimeString = (\n timeString: string | number,\n useTimeZone = false,\n) => {\n const time = new Date(timeString);\n\n // @ts-expect-error Argument of type 'Date' is not assignable to parameter of type 'number'\n if (isNaN(time)) {\n throw Error(\"Invalid Date format\");\n }\n\n // This only works for the default locale of en-US, as support of other locals in node js might not be available\n // See for example this issue https://github.com/nodejs/node/issues/8500\n const baseTimeOptions: Intl.DateTimeFormatOptions = {\n hour: \"numeric\",\n minute: \"2-digit\",\n };\n\n const timeOptions: Intl.DateTimeFormatOptions = useTimeZone\n ? { ...baseTimeOptions, timeZone: getLocalTimeZone() }\n : baseTimeOptions;\n\n return time.toLocaleTimeString(\"en-US\", timeOptions);\n};\n\n/**\n * Converts the specified time String to human readable text containing the date (day, month, year) and time (hour,\n * minute; 12-hour).\n * Example: '2018-07-31T09:44:31+00:00' => 'Jul 31, 2018 9:44 AM'\n *\n * @param dateTimeString String representation of the Date (including time and date) to format\n * @param useTimeZone to set the timeZone where the user is located, and display local date and time\n * @returns human readable date/time String\n */\nexport const formatDateTimeString = (\n dateTimeString: string | number,\n useTimeZone = false,\n) => {\n return `${formatDateString(dateTimeString, useTimeZone)} ${formatTimeString(\n dateTimeString,\n useTimeZone,\n )}`;\n};\n\n/**\n * Converts the specified date and time to the user time zone with option to display (day, month, year) only or with time (hour,\n * minute; 12-hour).\n *\n * @param showTime String representation of the Date to convert and format\n * @param String | number} date String representation of the Date to convert and format\n * @returns human readable date/time String converted to user time zone\n */\nexport const formatLocalDateTimeString = (date: string, showTime: boolean) =>\n showTime ? formatDateTimeString(date, true) : formatDateString(date, true);\n\nexport const formatFileSize = (bytes: number): string => {\n const safeBytes = Number.isFinite(bytes) && bytes >= 0 ? bytes : 0;\n\n return prettyBytes(safeBytes);\n};\n","const getDeepActiveElement = () => {\n let element = document?.activeElement;\n while (element?.shadowRoot) {\n element = element?.shadowRoot?.activeElement;\n }\n return element;\n};\n\nexport default getDeepActiveElement;\n","/**\n * Since (a % b) yields a negative outcome for negative a, we need this method in order\n * to correctly compute wrapped around indices in lists\n * @param {number} index an arbitrary integer\n * @param {number} length a positive integer\n * @returns {number} the non-negative modulo outcome\n */\nexport default (index: number, length: number) =>\n ((index % length) + length) % length;\n","export type Period = {\n negative: boolean;\n years: number;\n months: number;\n weeks: number;\n days: number;\n};\n\nexport type Duration = {\n negative: boolean;\n hours: number;\n minutes: number;\n seconds: number;\n milliseconds: number;\n};\n\ntype AllowedIntervalTypes = \"DATE\" | \"TIME\";\ntype AllowedIntervalTypesOrEither = AllowedIntervalTypes | \"DATE_OR_TIME\";\n\ntype IntervalStringValidationResult =\n | {\n valid: true;\n type: AllowedIntervalTypes;\n negative: boolean;\n }\n | { valid: false };\n\nexport type PeriodOrDuration =\n | {\n interval: Period;\n type: \"DATE\";\n }\n | {\n interval: Duration;\n type: \"TIME\";\n };\n\nconst extractPeriodFromRegexMatch = (\n negative: boolean,\n match: RegExpExecArray,\n): Period => {\n return {\n negative,\n years: parseInt(match[1] ?? \"0\", 10),\n months: parseInt(match[2] ?? \"0\", 10),\n weeks: parseInt(match[3] ?? \"0\", 10),\n days: parseInt(match[4] ?? \"0\", 10),\n };\n};\n\nconst extractDurationFromRegexMatch = (\n negative: boolean,\n match: RegExpExecArray,\n): Duration => {\n // eslint-disable-next-line no-magic-numbers\n const milliseconds = parseInt(match[4]?.padEnd(3, \"0\") ?? \"0\", 10);\n\n return {\n negative,\n hours: parseInt(match[1] ?? \"0\", 10),\n minutes: parseInt(match[2] ?? \"0\", 10),\n seconds: parseInt(match[3] ?? \"0\", 10),\n milliseconds,\n };\n};\n\nexport const isZero = (interval: PeriodOrDuration): boolean => {\n if (interval.type === \"DATE\") {\n return (\n interval.interval.years === 0 &&\n interval.interval.months === 0 &&\n interval.interval.weeks === 0 &&\n interval.interval.days === 0\n );\n } else {\n return (\n interval.interval.hours === 0 &&\n interval.interval.minutes === 0 &&\n interval.interval.seconds === 0 &&\n interval.interval.milliseconds === 0\n );\n }\n};\n\n/**\n * Take an interval object and convert it to an ISO duration or period string. All parts of the\n * relevant part of the Interval object are included in the output, even if they are zero.\n *\n * Technically the ISO standard allows to mix period and duration parts, but we don't support that\n * here because it's incredibly hard to deal with all the edge cases. Maybe in a future ticket.\n *\n * The output here is allowed to be negative, in which case the minus sign is prepended to the\n * output.\n *\n * @param toFormat The PeriodOrDuration object to format\n */\nexport const formatIntervalToISOIntervalString = (\n toFormat: PeriodOrDuration,\n): string => {\n let output = \"P\";\n\n if (toFormat.type === \"DATE\") {\n output += `${toFormat.interval.years}Y${toFormat.interval.months}M${toFormat.interval.weeks}W${toFormat.interval.days}D`;\n } else {\n output += `T${toFormat.interval.hours}H${toFormat.interval.minutes}M${toFormat.interval.seconds}.${toFormat.interval.milliseconds\n .toString()\n // eslint-disable-next-line no-magic-numbers\n .padStart(3, \"0\")}S`;\n }\n\n if (toFormat.interval.negative) {\n output = `-${output}`;\n }\n return output;\n};\n\n/**\n * Take an interval object and convert it to a human readable string. Only non-zero parts are\n * included in the output (unless all parts are 0).\n *\n * The output here is allowed to be negative, in which case the minus sign is prepended to the\n * output and we wrap the whole thing in brackets e.g. -(1 year 2 days).\n *\n * @param toFormat The PeriodOrDuration object to format\n */\nexport const formatIntervalToHumanReadableIntervalString = (\n toFormat: PeriodOrDuration,\n): string => {\n const formatPart = (value: number, unit: string): string => {\n if (value === 0) {\n return \"\";\n } else if (value === 1) {\n return `${value} ${unit} `;\n } else {\n return `${value} ${unit}s `;\n }\n };\n\n let output = \"\";\n\n if (toFormat.type === \"DATE\") {\n if (isZero(toFormat)) {\n return \"0 days\";\n }\n\n output += formatPart(toFormat.interval.years, \"year\");\n output += formatPart(toFormat.interval.months, \"month\");\n output += formatPart(toFormat.interval.weeks, \"week\");\n output += formatPart(toFormat.interval.days, \"day\");\n } else {\n if (isZero(toFormat)) {\n return \"0 seconds\";\n }\n\n output += formatPart(toFormat.interval.hours, \"hour\");\n output += formatPart(toFormat.interval.minutes, \"minute\");\n\n const milliSecondsZero = toFormat.interval.milliseconds === 0;\n if (toFormat.interval.seconds !== 0 || !milliSecondsZero) {\n if (milliSecondsZero) {\n output += formatPart(toFormat.interval.seconds, \"second\");\n } else {\n output += `${toFormat.interval.seconds}.${toFormat.interval.milliseconds.toString().padStart(3, \"0\")} seconds `; // eslint-disable-line no-magic-numbers\n }\n }\n }\n\n if (toFormat.interval.negative) {\n output = `-(${output.trim()})`;\n }\n\n return output.trim();\n};\n\nconst yearsPart = \"(\\\\d+)\\\\s*y(?:ears?)?\";\nconst monthsPart = \"(\\\\d+)\\\\s*m(?:o(?:nths?)?)?\";\nconst weeksPart = \"(\\\\d+)\\\\s*w(?:eeks?)?\";\nconst daysPart = \"(\\\\d+)\\\\s*d(?:ays?)?\";\nconst hoursPart = \"(\\\\d+)\\\\s*h(?:ours?)?\";\nconst minutesPart = \"(\\\\d+)\\\\s*m(?:in(?:s|utes?)?)?\";\nconst secondsPart = \"(\\\\d+)(?:[,.](\\\\d{1,3}))?\\\\s*s(?:ec(?:s|onds?)?)?\";\n\n/**\n * Matches a human readable period string, e.g. \"1y 2mo 3weeks 4day\" (each part is optional)\n */\nconst humanReadablePeriodRegex = new RegExp(\n `^(?:${yearsPart})?\\\\s*(?:${monthsPart})?\\\\s*(?:${weeksPart})?\\\\s*(?:${daysPart})?\\\\s*$`,\n \"i\",\n);\n\n/**\n * Matches a human readable duration string, e.g. \"1h 2m 3.456s\" (each part is optional)\n */\nconst humanReadableDurationRegex = new RegExp(\n `^(?:${hoursPart})?\\\\s*(?:${minutesPart})?\\\\s*(?:${secondsPart})?$`,\n \"i\",\n);\n\n/**\n * Matches a negative human readable period string, e.g. \"-(1y 2mo 3weeks 4day)\" (each part is optional)\n */\nconst negativeHumanReadablePeriodRegex = new RegExp(\n `^\\\\s*-\\\\s*\\\\(\\\\s*${humanReadablePeriodRegex.source.replace(/[$^]/g, \"\")}\\\\s*\\\\)\\\\s*$`,\n \"i\",\n);\n\n/**\n * Matches a negative human readable period string with one field like \"-1y\" or \"-1w\"\n */\nconst negativeHumanReadablePeriodRegexWithSingleField = new RegExp(\n `^\\\\s*-\\\\s*(?:\\\\s*${yearsPart}|${monthsPart}|${weeksPart}|${daysPart})\\\\s*$`,\n \"i\",\n);\n\n/**\n * Matches a negative human readable duration string, e.g. \"-(1h 2m 3.456s)\" (each part is optional)\n */\nconst negativeHumanReadableDurationRegex = new RegExp(\n `^\\\\s*-\\\\s*\\\\(\\\\s*${humanReadableDurationRegex.source.replace(/[$^]/g, \"\")}\\\\s*\\\\)\\\\s*$`,\n \"i\",\n);\n\n/**\n * Matches a negative human readable duration string with one field like \"-1h\" or \"-1.5s\"\n */\nconst negativeHumanReadableDurationRegexWithSingleField = new RegExp(\n `^\\\\s*-\\\\s*(?:\\\\s*${hoursPart}|${minutesPart}|${secondsPart})\\\\s*$`,\n \"i\",\n);\n\n/**\n * Try to parse a human readable interval string into an Interval object. Any parts not specified\n * are assumed to be zero. Note that the string must be either a period or a duration, not a mix of\n * both. So for example, \"1y 2mo 3weeks 4day\" is fine, as is \"1h 2m 3.456s\". However, \"1y 2mo 1sec\"\n * is not, since it's a mix of both.\n *\n * Negative intervals are allowed, although if multiple fields are provided the string must include\n * brackets, so \"-(1y 2mo)\" is also valid, as is \"-5 seconds\".\n *\n * The string is required to have at least some content, any string that is blank will throw an error.\n *\n * @param intervalString The human readable time string\n */\nexport const parseHumanReadableIntervalString = (\n intervalString: string,\n): PeriodOrDuration => {\n intervalString = intervalString?.trim();\n\n if (!intervalString) {\n throw new Error(\"Empty interval string\");\n }\n\n const matchPositivePeriod = humanReadablePeriodRegex.exec(intervalString);\n const matchNegativePeriod =\n negativeHumanReadablePeriodRegex.exec(intervalString) ??\n negativeHumanReadablePeriodRegexWithSingleField.exec(intervalString);\n const matchPositiveDuration = humanReadableDurationRegex.exec(intervalString);\n const matchNegativeDuration =\n negativeHumanReadableDurationRegex.exec(intervalString) ??\n negativeHumanReadableDurationRegexWithSingleField.exec(intervalString);\n\n const matchPeriod = matchPositivePeriod ?? matchNegativePeriod;\n const matchDuration = matchPositiveDuration ?? matchNegativeDuration;\n const negative = (matchNegativePeriod ?? matchNegativeDuration) !== null;\n\n // I think this will happen only for the string \"1M\" or similar\n if (matchDuration && matchPeriod) {\n throw new Error(\"Ambiguous time format\");\n }\n\n if (matchPeriod) {\n return {\n type: \"DATE\",\n interval: extractPeriodFromRegexMatch(negative, matchPeriod),\n };\n } else if (matchDuration) {\n return {\n type: \"TIME\",\n interval: extractDurationFromRegexMatch(negative, matchDuration),\n };\n } else {\n throw new Error(`Invalid human readable time: ${intervalString}`);\n }\n};\n\n/**\n * Check if the given string can be understood as a human readable duration or period string. The\n * type parameter specifies whether the string should be a date, time, or either.\n *\n * @param time the string to check\n * @param expectedType the type of the string - either \"DATE\", \"TIME\", or \"ANY\"\n */\nexport const isValidHumanReadableIntervalString = (\n time: string,\n expectedType: AllowedIntervalTypesOrEither,\n): IntervalStringValidationResult => {\n try {\n const validationResult = parseHumanReadableIntervalString(time);\n const actualType = validationResult.type;\n const negative = validationResult.interval.negative;\n\n if (actualType === expectedType || expectedType === \"DATE_OR_TIME\") {\n return {\n valid: true,\n type: actualType,\n negative,\n };\n } else {\n return { valid: false };\n }\n } catch (_e) {\n return { valid: false };\n }\n};\n\n/**\n * Convert an ISO duration OR period string to an Interval object. So for example,\n * \"P1Y2M3W4D\" is fine, as is \"PT1H2M3.456S\". However, \"P1Y2M3W4D1H2M3.456S\" is not, since\n * it's a mix of both. We're more forgiving than the ISO standard, so we allow for missing parts.\n * Also, the string is allowed to be negative, so \"-P1Y2M3W4D\" is also valid.\n *\n * The string is required to have at least some content, so the strings \"\", \"P\", and \"PT\" are\n * considered invalid (also if they start with a -).\n *\n * @param isoString The ISO duration or period string.\n */\nexport const parseISOIntervalString = (isoString: string): PeriodOrDuration => {\n isoString = isoString?.trim();\n\n if ([\"\", \"P\", \"PT\", \"-\", \"-P\", \"-PT\"].includes(isoString)) {\n throw new Error(\"Empty ISO duration\");\n }\n\n const periodRegex = /^-?P(?:(\\d+)Y)?(?:(\\d+)M)?(?:(\\d+)W)?(?:(\\d+)D)?$/;\n const durationRegex =\n /^-?PT(?:(\\d+)H)?(?:(\\d+)M)?(?:(\\d+)(?:[,.](\\d{1,3}))?S)?$/;\n\n const matchPeriod = periodRegex.exec(isoString);\n const matchDuration = durationRegex.exec(isoString);\n\n if (matchPeriod) {\n return {\n type: \"DATE\",\n interval: extractPeriodFromRegexMatch(\n isoString.startsWith(\"-\"),\n matchPeriod,\n ),\n };\n } else if (matchDuration) {\n return {\n type: \"TIME\",\n interval: extractDurationFromRegexMatch(\n isoString.startsWith(\"-\"),\n matchDuration,\n ),\n };\n } else {\n throw new Error(`Invalid ISO duration: ${isoString}`);\n }\n};\n\n/**\n * Check if the given string is a valid duration or period ISO string. The type parameter\n * specifies whether the string should be a date, time, or either.\n *\n * @param isoString the string to check\n * @param type the type of the string - either \"DATE\", \"TIME\", or \"ANY\"\n */\nexport const isValidISOIntervalString = (\n isoString: string,\n type: AllowedIntervalTypesOrEither,\n): IntervalStringValidationResult => {\n try {\n const validationResult = parseISOIntervalString(isoString);\n const actualType = validationResult.type;\n const negative = validationResult.interval.negative;\n\n if (actualType === type || type === \"DATE_OR_TIME\") {\n return {\n valid: true,\n type: actualType,\n negative,\n };\n } else {\n return { valid: false };\n }\n } catch (_e) {\n return { valid: false };\n }\n};\n\n/**\n * Try to convert an interval string to an Interval object. The string can be either an ISO\n * duration/period string or a human readable string. If the string is not valid, an error is\n * thrown.\n *\n * @param time the time string, either ISO or human readable\n */\nexport const parseGenericIntervalString = (time: string): PeriodOrDuration => {\n const validISO = isValidISOIntervalString(time, \"DATE_OR_TIME\");\n const validHumanReadable = isValidHumanReadableIntervalString(\n time,\n \"DATE_OR_TIME\",\n );\n if (validISO.valid) {\n return parseISOIntervalString(time);\n } else if (validHumanReadable.valid) {\n return parseHumanReadableIntervalString(time);\n } else {\n throw new Error(`Invalid interval string: ${time}`);\n }\n};\n\n/**\n * Check if the given string is a valid interval string, either human readable or ISO. The type parameter\n * specifies whether the string should be a period, duration, or either.\n *\n * @param time the time string to check\n * @param type the type of the string - either \"DATE\", \"TIME\", or \"ANY\"\n */\nexport const isValidIntervalString = (\n time: string,\n type: AllowedIntervalTypesOrEither,\n): IntervalStringValidationResult => {\n const validISO = isValidISOIntervalString(time, type);\n const validHumanReadable = isValidHumanReadableIntervalString(time, type);\n if (validISO.valid) {\n return validISO;\n } else if (validHumanReadable.valid) {\n return validHumanReadable;\n } else {\n return { valid: false };\n }\n};\n","/**\n * Count the number of integer digits for a given number.\n *\n * @param input number.\n * @returns number of integer digits x has. 1234 = 4 but 1234.44 is also 4.\n */\nexport default (input: number) =>\n Math.max(Math.floor(Math.log10(Math.abs(input))), 0) + 1;\n","export class AbortError extends Error {}\n\n/**\n * Helper to create an abortable promise. Returns an AbortController and a Function\n * that you can pass your async handler to. Whenever the AbortController signal is\n * aborted then the async handler's promise will reject with an AbortError\n *\n * Example:\n * ```\n * import { abortUtils } from \"@knime/utils\"\n * const myFetchCall = async (params...) => {...};\n *\n * try {\n * const { runAbortablePromise, abortController } = createAbortablePromise(() =>\n * myFetchCall(params...),\n * );\n * } catch (e) {\n * if (e instanceof abortUtils.AbortError) {\n * console.info('ignore due to abort');\n * return;\n * }\n * }\n *\n * // somewhere else (while request is in-flight)\n * abortController.abort(new abortUtils.AbortError('reason here'))\n * ```\n */\nexport const createAbortablePromise = () => {\n const abortController: AbortController = new AbortController();\n\n const runAbortablePromise = <T = unknown>(request: () => Promise<T>) => {\n return new Promise<T>((resolve, reject) => {\n // abort logic\n const abortListener = ({ target }: Event) => {\n abortController.signal.removeEventListener(\"abort\", abortListener);\n const reason = (target as AbortSignal).reason;\n reject(reason instanceof AbortError ? reason : new AbortError(reason));\n };\n\n // the actual call\n request()\n .then(resolve)\n .catch((error) => {\n if (error instanceof AbortError) {\n return;\n }\n\n reject(error);\n });\n\n abortController.signal.addEventListener(\"abort\", abortListener);\n });\n };\n\n return { abortController, runAbortablePromise };\n};\n","export type UnwrappedPromise<T = unknown> = {\n resolve: (value: T | PromiseLike<T>) => void;\n reject: (reason?: unknown) => void;\n promise: Promise<T>;\n};\n\nexport const createUnwrappedPromise = <T>(): UnwrappedPromise<T> => {\n let resolve: (value: T | PromiseLike<T>) => void = () => {};\n let reject: (reason?: unknown) => void = () => {};\n\n const promise = new Promise<T>((res, rej) => {\n resolve = res;\n reject = rej;\n });\n\n return { resolve, reject, promise };\n};\n","/**\n * Returns promise that resolves after ms.\n */\nexport default function sleep(ms: number) {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n","import sleep from \"../sleep\";\n\nexport const DEFAULT_RETRY_DELAY_MS = 0;\nexport const DEFAULT_RETRY_COUNT = 5;\n\n/**\n * Helper to add retry capability to an async function\n * @param fn async function\n * @param retryCount max number of retries. defaults to 5\n * @param retryDelayMS delay in-between retries in millisecs. defaults to 0\n * @param excludeError predicate fn to exclude specific errors from causing a retry\n */\nexport async function retryPromise<T>({\n fn,\n retryCount = DEFAULT_RETRY_COUNT,\n retryDelayMS = DEFAULT_RETRY_DELAY_MS,\n excludeError,\n}: {\n fn: () => Promise<T>;\n retryCount?: number;\n retryDelayMS?: number;\n excludeError?: (error: Error) => boolean;\n}) {\n try {\n return await fn();\n } catch (error) {\n if (excludeError?.(error as Error)) {\n throw error;\n }\n\n if (retryCount > 0) {\n await sleep(retryDelayMS);\n\n // eslint-disable-next-line no-return-await\n return await retryPromise({\n fn,\n retryCount: retryCount - 1,\n retryDelayMS,\n excludeError,\n });\n }\n\n throw error;\n }\n}\n","export * from \"./createAbortablePromise\";\nexport * from \"./createUnwrappedPromise\";\nexport * from \"./retryPromise\";\n","import DomPurify from \"dompurify\";\n\nconst ALLOWED_TAGS = [\n \"p\",\n \"div\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n \"h6\",\n \"ul\",\n \"ol\",\n \"li\",\n \"blockquote\",\n \"b\",\n \"i\",\n \"s\",\n \"u\",\n \"sup\",\n \"sub\",\n \"ins\",\n \"del\",\n \"strong\",\n \"strike\",\n \"tt\",\n \"code\",\n \"big\",\n \"small\",\n \"br\",\n \"span\",\n \"em\",\n];\n\n/**\n * Sanitizes Raw HTML and only allow specific tags to be used, as per OWASP standards.\n * @param rawHTML\n * @param options.allowStyleAttribute - Allow the style attribute on elements\n * @param options.allowHyperlinks - Allow anchor tags with href attribute\n * @returns sanitized html\n */\nconst sanitizeHTML = (\n rawHTML: string,\n options: { allowStyleAttribute?: boolean; allowHyperlinks?: boolean } = {\n allowStyleAttribute: false,\n allowHyperlinks: false,\n },\n) => {\n const { allowStyleAttribute, allowHyperlinks } = options;\n const ALLOWED_ATTR = [\n ...(allowStyleAttribute ? [\"style\"] : []),\n ...(allowHyperlinks ? [\"href\"] : []),\n ];\n const allowedTags = allowHyperlinks ? [...ALLOWED_TAGS, \"a\"] : ALLOWED_TAGS;\n\n return DomPurify.sanitize(rawHTML, {\n ALLOWED_TAGS: allowedTags,\n ALLOWED_ATTR,\n });\n};\n\n/**\n * Removes any HTML tag from the input string. Keeps HTML entities\n * (e.g because these can be considered plain text)\n * @param rawHTML\n * @returns plain text\n */\nconst stripHTML = (rawHTML: string) => {\n return DomPurify.sanitize(rawHTML, { ALLOWED_TAGS: [], ALLOWED_ATTR: [] });\n};\n\nexport const sanitization = { sanitizeHTML, stripHTML };\n","const defaultMaxLength = 160;\n\n// truncates a string to a given max length\nexport default (string = \"\", maxLength = defaultMaxLength) => {\n const dots = string.length > maxLength ? \"…\" : \"\";\n return `${string.substring(0, maxLength - 1)}${dots}`;\n};\n","/**\n * Gets the file extension\n * @param nameOrPath can take a full file name (e.g \"file.txt\") or a path to a file\n * (e.g \"file://path/to/file.txt\" OR \"/path/to/file.txt\")\n * @returns just the file extension (e.g \"txt\")\n */\nexport const getFileExtension = (nameOrPath: string): string => {\n const basename = nameOrPath.split(/[\\\\/]/).pop() ?? \"\";\n\n const parts = basename.split(\".\");\n\n if (basename === \"\" || parts.length === 1) {\n return \"\";\n }\n\n return parts.at(-1) ?? \"\";\n};\n\ntype FileLike = { name: string; type: string };\n\n/**\n * Metadata for .knar files, which corresponds to exported KNIME Workflow Groups\n * or Components\n */\nconst KNAR = Object.freeze({\n extension: \"knar\",\n mimeType: \"application/vnd.knime.workflow-group+zip\",\n matches(file: FileLike) {\n const extension = getFileExtension(file.name);\n return extension === this.extension;\n },\n});\n\n/**\n * Metadata for .knwf files, which corresponds to exported KNIME Workflows\n */\nconst KNWF = Object.freeze({\n extension: \"knwf\",\n mimeType: \"application/vnd.knime.workflow+zip\",\n matches(file: FileLike) {\n const extension = getFileExtension(file.name);\n return extension === this.extension;\n },\n /**\n * Gets the name of a .knwf file without the extension. If the file is not\n * matched as a .knwf file then this function will return the default value,\n * which is empty string (\"\") if param is not provided\n */\n getNameOrDefault(file: FileLike, defaultValue = \"\"): string {\n if (!this.matches(file)) {\n return defaultValue;\n }\n\n return file.name.replace(`.${this.extension}`, \"\");\n },\n});\n\nexport const knimeFileFormats = { KNAR, KNWF };\n\n/**\n * Gets the mime type from a given file. Defaults to `application/octet-stream`\n * if mimeType cannot be detected\n * @param file File\n * @returns mimeType\n */\nexport const getFileMimeType = (file: FileLike): string => {\n const DEFAULT_MIMETYPE = \"application/octet-stream\";\n\n const extension = getFileExtension(file.name);\n\n if (!extension) {\n return DEFAULT_MIMETYPE;\n }\n\n if (KNWF.matches(file)) {\n return KNWF.mimeType;\n }\n\n if (KNAR.matches(file)) {\n return KNAR.mimeType;\n }\n\n // file has extension but unrecognizable mime type\n if (!file.type) {\n return DEFAULT_MIMETYPE;\n }\n\n return file.type;\n};\n","/**\n * Platforms that influence how modifier keys are rendered. macOS substitutes\n * dedicated glyphs (`⌘`, `⌥`, `⇧`, …), every other platform uses the textual\n * rendering (`Ctrl`, `Alt`, `Shift`, …).\n */\nexport const hotkeyPlatform = {\n MAC_OS: \"macOS\",\n OTHER: \"other\",\n} as const;\n\nexport const hotkeyPlatforms = Object.values(hotkeyPlatform);\n","/**\n *\n * @returns true if the platform of the user is Mac\n */\nexport const isMac = (): boolean =>\n navigator?.userAgent?.toLowerCase()?.includes(\"mac\");\n\n/**\n *\n * @returns true if the platform of the user is Windows\n */\nexport const isWindows = (): boolean =>\n navigator?.userAgent?.toLowerCase()?.includes(\"windows\");\n","import { isMac } from \"../platform/navigator\";\n\nimport { hotkeyPlatform } from \"./enums\";\nimport type { Hotkey, HotkeyPlatform } from \"./types\";\n\nconst globalKeyMap = {\n ArrowUp: \"↑\",\n ArrowDown: \"↓\",\n ArrowLeft: \"←\",\n ArrowRight: \"→\",\n Enter: \"↵\",\n \" \": \"Space\", // we use event.key and there space is an actual space not the code \"Space\"\n CtrlOrCmd: \"Ctrl\",\n} as const;\n\nconst MacOSkeyMap = {\n Shift: \"⇧\",\n Delete: \"⌫\",\n CtrlOrCmd: \"⌘\",\n Ctrl: \"⌃\",\n Alt: \"⌥\",\n Enter: \"↩\",\n} as const;\n\ntype KeyFormatMap = typeof MacOSkeyMap | typeof globalKeyMap;\n\n/**\n * Returns a string representation of a single hotkey. Replaces some special key names with symbols.\n *\n * By default the platform is auto-detected from the user agent via `isMac()`.\n * Pass `platform` to force a specific platform's glyphs — useful for SSR,\n * tests, or rendering multiple platforms on the same page.\n */\nexport const formatHotkey = (\n hotkey: Hotkey,\n platform?: HotkeyPlatform,\n): string => {\n /**\n * Returns the symbol corresponding to the `key` based on the given\n * `formatMap`. Otherwise, if not found, returns the same `key` value given\n */\n const mapSymbols = (formatMap: KeyFormatMap) => (key: Hotkey) =>\n formatMap[key as keyof KeyFormatMap] ?? key;\n\n /**\n * Pipe function implementation. Receives a list of functions to execute in order\n * and will pipe the parameter passed at the end to each function returning the final output\n */\n const pipe = <T extends () => string>(\n ...fns: Array<(...args: Hotkey[]) => ReturnType<T>>\n ) =>\n fns.reduce(\n (f, g) => (arg) => g(f(arg)),\n (arg: Hotkey) => arg as ReturnType<T>,\n );\n\n const macKeyFormatter = pipe(\n mapSymbols(MacOSkeyMap),\n mapSymbols(globalKeyMap),\n );\n\n const generalKeyFormatter = mapSymbols(globalKeyMap);\n\n const useMacFormatter =\n platform === undefined ? isMac() : platform === hotkeyPlatform.MAC_OS;\n return useMacFormatter\n ? macKeyFormatter(hotkey)\n : generalKeyFormatter(hotkey);\n};\n\nexport const getDefaultSeparator = () => (isMac() ? \" \" : \"+\");\n\n/**\n * Returns a string representation of a list of hotkeys. Replaces some special key names with symbols\n */\nexport const formatHotkeys = (\n hotkeys: Array<Hotkey>,\n getSeparator = getDefaultSeparator,\n) => hotkeys.map((hotkey) => formatHotkey(hotkey)).join(getSeparator());\n\n/**\n * Appends a formatted hotkey shortcut to the given string. Useful for tooltips\n */\nexport const textWithHotkeys = (text: string, hotkeys: Array<Hotkey>) => {\n return `${text} – ${formatHotkeys(hotkeys)}`;\n};\n","import * as navigatorUtils from \"../platform/navigator\";\n\nimport type { Hotkey } from \"./types\";\n\n/**\n * Checks whether a pressed `Digit` key falls within a numeric hotkey range such\n * as `1-9`.\n * @param keyCode - The `KeyboardEvent.code` to check (e.g. `Digit5`).\n * @param hotkey - The hotkey token, expected to be a single-digit range like `1-9`.\n * @returns True if the pressed digit lies within the inclusive range.\n */\nconst isDigitKeyInRange = (keyCode: string, hotkey: Hotkey): boolean => {\n // Digit keys exist from 0 to 9, so valid ranges always have length 3\n const digitRangeLength = 3;\n if (hotkey.length !== digitRangeLength || !keyCode?.startsWith(\"Digit\")) {\n return false;\n }\n\n const keyNumber = Number(keyCode.slice(\"Digit\".length));\n const [lower, upper] = hotkey.split(\"-\");\n\n return (\n Boolean(lower) &&\n Boolean(upper) &&\n Number.parseInt(lower, 10) <= keyNumber &&\n keyNumber <= Number.parseInt(upper, 10)\n );\n};\n\n/**\n * Checks whether a keyboard event matches a hotkey definition. The last token is\n * treated as the character; any preceding tokens are modifiers. The special\n * `CtrlOrCmd` modifier resolves to the platform's primary modifier (Meta/`⌘` on\n * macOS, Ctrl elsewhere).\n * @param event - The keyboard event to check.\n * @param hotkeys - The ordered hotkey tokens (modifiers followed by the character).\n * @returns True if the event matches the given hotkey, otherwise false.\n */\nexport const match = (event: KeyboardEvent, hotkeys: Hotkey[]): boolean => {\n const { key, code, metaKey, ctrlKey, shiftKey, altKey } = event;\n\n const modifiers = hotkeys.slice(); // copy so pop() doesn't mutate the caller's array\n const character = modifiers.pop() ?? \"\";\n\n // our special CtrlOrCmd has to match \"Command ⌘\" (metaKey) on Mac, and Ctrl-Key on other systems\n const ctrlOrMeta = navigatorUtils.isMac() ? \"Meta\" : \"Ctrl\";\n const platformModifiers = new Set(\n modifiers.map((modifier) =>\n modifier === \"CtrlOrCmd\" ? ctrlOrMeta : modifier,\n ),\n );\n\n const metaMatches = Boolean(metaKey) === platformModifiers.has(\"Meta\");\n const ctrlMatches = Boolean(ctrlKey) === platformModifiers.has(\"Ctrl\");\n const shiftMatches = Boolean(shiftKey) === platformModifiers.has(\"Shift\");\n const altMatches = Boolean(altKey) === platformModifiers.has(\"Alt\");\n\n const keysMatch =\n // keys are matched case insensitively\n key.toUpperCase() === character.toUpperCase() ||\n (character.includes(\"-\") && isDigitKeyInRange(code, character)) ||\n // on mac 'backspace' can be used instead of delete\n (navigatorUtils.isMac() && character === \"Delete\" && key === \"Backspace\");\n\n return metaMatches && ctrlMatches && shiftMatches && altMatches && keysMatch;\n};\n","import * as navigatorUtils from \"../platform/navigator\";\n\n/**\n * Checks if any modifier key (Ctrl, Meta, Alt, or Shift) is pressed.\n * @param event - The keyboard event to check.\n * @returns True if a modifier key is pressed, otherwise false.\n */\nexport const isModifierKeyPressed = (event: KeyboardEvent): boolean => {\n return event.ctrlKey || event.metaKey || event.altKey || event.shiftKey;\n};\n\n/**\n * Checks if a specific key (or keys) were pressed without any modifier keys.\n * @param event - The keyboard event to check.\n * @param keys - The key or keys to check for.\n * @returns True if the specified key(s) were pressed without modifiers, otherwise false.\n */\nexport const isKeyWithoutModifiers = (\n event: KeyboardEvent,\n keys: string | string[],\n): boolean => {\n const keyList = Array.isArray(keys) ? keys : [keys];\n return keyList.includes(event.key) && !isModifierKeyPressed(event);\n};\n\n/**\n * Returns the name of the primary modifier key for the current platform.\n */\nexport const getMetaOrCtrlKey = (): \"ctrlKey\" | \"metaKey\" => {\n return navigatorUtils.isMac() ? \"metaKey\" : \"ctrlKey\";\n};\n","import { hotkeyPlatform } from \"./enums\";\nimport {\n formatHotkey,\n formatHotkeys,\n getDefaultSeparator,\n textWithHotkeys,\n} from \"./format\";\nimport { match } from \"./match\";\n\n/**\n * Grouped keyboard-shortcut helpers, exposed as a single namespace for\n * ergonomic access (e.g. `hotkeys.formatHotkey`).\n */\nexport const hotkeys = {\n formatHotkeys,\n formatHotkey,\n getDefaultSeparator,\n hotkeyPlatform,\n textWithHotkeys,\n match,\n};\n\nexport { match };\nexport {\n getMetaOrCtrlKey,\n isKeyWithoutModifiers,\n isModifierKeyPressed,\n} from \"./modifiers\";\nexport type { Hotkey, HotkeyPlatform, KnownHotkey } from \"./types\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAKA,IAAa,cAAc,UACzB,MAAM,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,MAAM,UAAU,CAAC;AAEnD,IAAM,UAAU;CACd,eAAe,OAAe,cAC5B,WAAW,MAAM,QAAQ,WAAW,GAAG,CAAC,CAAC,YAAY,CAAC;CAExD,cAAc,UAAkB,QAAQ,aAAa,OAAO,GAAG;CAC/D,cAAc,UAAkB,QAAQ,aAAa,OAAO,GAAG;CAE/D,kBAAkB,UAChB,YACG,MAAM,MAAM,kBAAkB,KAAK,CAAC,EAAA,CAClC,MAAM,GAAG,EAAE,CAAC,CACZ,KAAK,GAAG,CA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O,CAAC,IAAI,EAAA,CACnC,SAAS,MAAM,GAAG,KAAK,CAAC,qBAAqB,KAAK;AACnE;;;;AAKA,IAAa,yBAAgD;CAC3D,OAAO,MAAqB,IAAI,YAAY;AAC9C;;;;;;;ACjBA,IAAa,UAAU;CACrB;CACA;CACA;CACA;CACA;CACA;AACF"}
|
|
@@ -5,22 +5,26 @@
|
|
|
5
5
|
* @returns just the file extension (e.g "txt")
|
|
6
6
|
*/
|
|
7
7
|
export declare const getFileExtension: (nameOrPath: string) => string;
|
|
8
|
+
type FileLike = {
|
|
9
|
+
name: string;
|
|
10
|
+
type: string;
|
|
11
|
+
};
|
|
8
12
|
export declare const knimeFileFormats: {
|
|
9
13
|
KNAR: Readonly<{
|
|
10
14
|
extension: "knar";
|
|
11
15
|
mimeType: "application/vnd.knime.workflow-group+zip";
|
|
12
|
-
matches(file:
|
|
16
|
+
matches(file: FileLike): boolean;
|
|
13
17
|
}>;
|
|
14
18
|
KNWF: Readonly<{
|
|
15
19
|
extension: "knwf";
|
|
16
20
|
mimeType: "application/vnd.knime.workflow+zip";
|
|
17
|
-
matches(file:
|
|
21
|
+
matches(file: FileLike): boolean;
|
|
18
22
|
/**
|
|
19
23
|
* Gets the name of a .knwf file without the extension. If the file is not
|
|
20
24
|
* matched as a .knwf file then this function will return the default value,
|
|
21
25
|
* which is empty string ("") if param is not provided
|
|
22
26
|
*/
|
|
23
|
-
getNameOrDefault(file:
|
|
27
|
+
getNameOrDefault(file: FileLike, defaultValue?: string): string;
|
|
24
28
|
}>;
|
|
25
29
|
};
|
|
26
30
|
/**
|
|
@@ -29,5 +33,6 @@ export declare const knimeFileFormats: {
|
|
|
29
33
|
* @param file File
|
|
30
34
|
* @returns mimeType
|
|
31
35
|
*/
|
|
32
|
-
export declare const getFileMimeType: (file:
|
|
36
|
+
export declare const getFileMimeType: (file: FileLike) => string;
|
|
37
|
+
export {};
|
|
33
38
|
//# sourceMappingURL=fileExtensions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileExtensions.d.ts","sourceRoot":"","sources":["../../src/fileExtensions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,YAAY,MAAM,KAAG,MAUrD,CAAC;
|
|
1
|
+
{"version":3,"file":"fileExtensions.d.ts","sourceRoot":"","sources":["../../src/fileExtensions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,YAAY,MAAM,KAAG,MAUrD,CAAC;AAEF,KAAK,QAAQ,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAuC/C,eAAO,MAAM,gBAAgB;;;;sBA9Bb,QAAQ;;;;;sBAYR,QAAQ;QAItB;;;;WAIG;+BACoB,QAAQ,0BAAsB,MAAM;;CASf,CAAC;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAAI,MAAM,QAAQ,KAAG,MAuBhD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knime/utils",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "Internal utility functions and constants shared across @knime packages.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/knime/knime-designsystem.git",
|
|
8
8
|
"directory": "packages/utils"
|
|
9
9
|
},
|
|
10
|
-
"license": "
|
|
10
|
+
"license": "KNIME-Commercial-License-2.0",
|
|
11
11
|
"author": "KNIME AG, Zurich, Switzerland",
|
|
12
12
|
"type": "module",
|
|
13
13
|
"main": "./dist/index.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"date-fns": "2.30.0",
|
|
40
40
|
"date-fns-tz": "2.0.0",
|
|
41
|
-
"dompurify": "^3.4.
|
|
41
|
+
"dompurify": "^3.4.16",
|
|
42
42
|
"pretty-bytes": "^7.1.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@types/node": "^26.1.1",
|
|
47
47
|
"consola": "^3.4.2",
|
|
48
48
|
"flush-promises": "^1.0.2",
|
|
49
|
-
"mock-xmlhttprequest": "^8.
|
|
49
|
+
"mock-xmlhttprequest": "^8.4.1",
|
|
50
50
|
"typescript": "^6.0.3",
|
|
51
51
|
"vite": "^8.1.3",
|
|
52
52
|
"vite-plugin-dts": "^5.0.3",
|