-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcelestra.html
2217 lines (2105 loc) · 126 KB
/
celestra.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<title>Celestra</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="Author" content="Czigler Ferenc" />
<meta name="Copyright" content="(C) Copyright Czigler Ferenc" />
<link rel="stylesheet" href="u87.css" type="text/css" />
<!--<link rel="icon" href="favicon.ico" type="image/x-icon" />-->
<script> var CEL = { VERSION: "This is another sample library." }; </script>
<script src="celestra.min.js"></script>
<style>
#fsdiv { padding: 20px; }
header {
padding: 1rem;
/*background-color: #222;*/
color: white;
/*background-image: url("erik-ringsmuth-2000.jpg");
background-repeat: no-repeat;
background-size: cover;
/*background-attachment: fixed;*/
/*background-size: contain;*/
background: linear-gradient(27deg, #151515 5px, transparent 5px) 0 5px, linear-gradient(207deg, #151515 5px, transparent 5px) 10px 0px, linear-gradient(27deg, #222 5px, transparent 5px) 0px 10px, linear-gradient(207deg, #222 5px, transparent 5px) 10px 5px, linear-gradient(90deg, #1b1b1b 10px, transparent 10px), linear-gradient(#1d1d1d 25%, #1a1a1a 25%, #1a1a1a 50%, transparent 50%, transparent 75%, #242424 75%, #242424);
background-size: 20px 20px;
background-color: #131313;
}
footer a, footer a:link, footer a:visited, footer a:active, footer a:hover,
nav a, nav a:visited, nav a:active, nav a:hover {
color: white !important; /* u87 v0.9.13 */
}
/*@media (max-width: 575.98px) { td { display: block; width: 100% !important; } }*/
</style>
</head>
<body>
<header class="center">
<pre class="center b font-l" style="background-color: transparent;/*black*/ color: white; line-height: 1.2;">
___ ____ __ ____ ___ ____ ____ __
/ __)( ___)( ) ( ___)/ __)(_ _)( _ \ /__\
( (__ )__) )(__ )__) \__ \ )( ) / /(__)\
\___)(____)(____)(____)(___/ (__) (_)\_)(__)(__)
</pre>
<!--<h1 class="heading-d">Celestra</h1>-->
<nav><b>
<a href="#download" class="nobr">Download</a>
//
<a href="#functions" class="nobr">Functions</a>
//
<a href="#samples" class="nobr">Samples</a>
//
<a href="#license" class="nobr">License</a>
//
<a href="#footer" class="nobr">Contact</a>
//
<a href="#" onclick=" CEL.importStyle('u87-dark.css'); " class="nobr"><i>Dark</i></a>
/
<a href="#" onclick=" CEL.importStyle('u87-blue.css'); " class="nobr"><i>Blue</i></a>
/
<a href="#" onclick=" CEL.importStyle('u87-light.css'); " class="nobr"><i>Light</i></a>
</b></nav>
</header>
<main class="container">
<h2 id="download">Download</h2>
<p><strong>A helper JavaScript library with useful functions and polyfills and zero dependencies.</strong></p>
<p>This library isn't compatible with the Node.js.</p>
<p>Latest version: 5.6.1</p>
<p>Date: 2024-06-06T19:12:17.009Z</p>
<p><b>Tested on these browsers:</b></p>
<ul>
<li>Windows Firefox</li>
<li>Windows Chrome</li>
<li>Windows Edge</li>
<li>iOS Safari</li>
<li>iOS Firefox</li>
<li>iOS Chrome</li>
<li>iOS Edge</li>
<li>Android Firefox</li>
<li>Android Chrome</li>
<li>Android Samsung Internet</li>
<li>Android Edge</li>
</ul>
<p>The functions are available in the <code>celestra</code> and/or <code>CEL</code> object.</p>
<table class="table-responsive-sm table-striped">
<tr>
<td class="center"><b>Edition</b></td>
<td class="center"><b>Filename</b></td>
</tr>
<tr>
<td>developer</td>
<td><a href="celestra.dev.js" target="_blank">celestra.dev.js</a></td>
</tr>
<tr>
<td>minified</td>
<td><a href="celestra.min.js" target="_blank">celestra.min.js</a></td>
</tr>
<tr>
<td>ES6 module</td>
<td><a href="celestra.esm.js" target="_blank">celestra.esm.js</a></td>
</tr>
<tr>
<td class="center">CUT testpage<br/>Celestra Unit Tester</td>
<td><a href="unittest.html" target="_blank">unittest.html</a></td>
</tr>
<tr>
<td class="center">Version history</td>
<td><a href="CHANGELOG.md" target="_blank">CHANGELOG.md</a></td>
</tr>
</table>
<p>DEV and MIN editions: If the <code>CEL</code> global variable is used before the loading of the library, then the value of the variable is saved and you can restore with the <code>noConflict();</code> function.</p>
<h3>Removed polyfills</h3>
<p>Some polyfills have been removed in v3.1.0 and v3.8.0 and v5.6.0. With these files can be reusued the old polyfills if needed.</p>
<table class="table-responsive-sm table-striped">
<tr>
<td class="center"><b>edition</b></td>
<td class="center"><b>filename</b></td>
</tr>
<tr>
<td>developer</td>
<td><a href="celestra-polyfills.dev.js" target="_blank">celestra-polyfills.dev.js</a></td>
</tr>
<tr>
<td>minified</td>
<td><a href="celestra-polyfills.min.js" target="_blank">celestra-polyfills.min.js</a></td>
</tr>
</table>
<h3>Cheatsheets</h3>
<p>Celestra cheatsheet: <a href="celestra-cheatsheet.pdf" target="_blank">celestra-cheatsheet.pdf</a></p>
<p>JavaScript cheatsheet: <a href="js-cheatsheet.pdf" target="_blank">js-cheatsheet.pdf</a></p>
<h3>Apps</h3>
<p>BTC standalone app: <a href="btc.app.html" target="_blank">btc.app.html</a></p>
<p>RPG dice roller: <a href="testgame.html" target="_blank">testgame.html</a></p>
<p>Demo plugin documentation: <a href="celestra-demo-plugin.html" target="_blank">celestra-demo-plugin.html</a></p>
<p>Demo plugin developer source: <a href="celestra-demo-plugin.dev.js" target="_blank">celestra-demo-plugin.dev.js</a></p>
<p>Demo plugin minified source: <a href="celestra-demo-plugin.min.js" target="_blank">celestra-demo-plugin.min.js</a></p>
<h3>How to import the ESM edition</h3>
<pre><script type="module">
// import the celestra object
import { celestra } from "./celestra.esm.js";
window.celestra = celestra;
window.CEL = celestra;
// import with default with name
import { default as celestra } from "./celestra.esm.js";
window.celestra = celestra;
window.CEL = celestra;
// import with default export
import defaultExport from "./celestra.esm.js";
window.celestra = defaultExport;
window.CEL = defaultExport;
</script></pre>
<h3>Celestra v3.0.0 (Hera) changes</h3>
<ul>
<li>Only modern browsers (ES6+) are supported. The Internet Explorer 11 and W10M Edge have been removed from the supported browsers.</li>
<li>If you would like to use Celestra with older browsers, then you can download the latest v2.x version here: <a href="https://github.com/Serrin/Celestra/releases" target="_blank">https://github.com/Serrin/Celestra/releases</a></li>
<li>The library sources have been merged and all of the ES6E functions are available in the <b>celestra.dev.js</b> and <b>celestra.min.js</b></li>
<li>Many functions have been deprecated or removed.</li>
</ul>
<h3>Celestra v3.6.0 (Galactica) changes</h3>
<ul>
<li>CommonJS and AMD module compatibility have been removed.</li>
<li>In the ESM (ECMAScript 6 module) edition only the whole celestra object is exported as default export and as standalone object.</li>
<li>Many functions have been deprecated or removed.</li>
</ul>
<h3>Celestra v5.0.0 (Defiant) changes</h3>
<ul>
<li>The underscore <code>_</code> short object name has been changed to <code>CEL</code> to avoid the compatibility issues.<br/>If need to use the old short name, then with this code will be available again: <code>window._ = window.celestra;</code>.</li>
</ul>
<h3>Celestra v5.3.0 (Voyager) changes</h3>
<ul>
<li>Added a new code section: <b>Abstract functions</b> and new functions.</li>
</ul>
<h3>Celestra v5.5.0 changes</h3>
<ul>
<li>The Math functions are available in the main code files (dev, min, esm) instead of the Math plugins.</li>
</ul>
<hr/>
<h2 id="functions">Functions</h2>
<p><span class="removed">Removed</span> and <span class="deprecated">Deprecated</span> labels: Don't use these in production.</p>
<h3>Core API</h3>
<p>These functions are available in the <code>celestra</code> and/or <code>CEL</code> objects.
<br/>Example: <code>CEL.sleep();</code></p>
<div>
<table class="table-responsive table-striped">
<tr>
<td style="width: auto; min-width: 33%;"><b>Name</b></td>
<td><b>Description</b></td>
</tr>
<tr>
<td><code>celestra.noConflict();</code></td>
<td>
<p>Restore the previous <code>CEL</code> object value and return the <code>celestra</code> object to create a new alias.</p>
<p><span class="info">Tip: You can make a new alias without this function too. Example: <code>window._cel = window.celestra;</code></span></p>
<p><span class="info">In the ESM edition only returns the celestra object.</code></span></p>
</td>
</tr>
<tr>
<td><code>celestra.VERSION;</code></td>
<td>The library version.</td>
</tr>
<tr>
<td><code>BASE16;</code></td>
<td><code>"0123456789ABCDEF"</code><br/>Can be used with the ID generator functions.</td>
</tr>
<tr>
<td><code>BASE32;</code></td>
<td><code>"234567ABCDEFGHIJKLMNOPQRSTUVWXYZ"</code><br/>Can be used with the ID generator functions.</td>
</tr>
<tr>
<td><code>BASE36;</code></td>
<td><code>"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"</code><br/>Can be used with the ID generator functions.</td>
</tr>
<tr>
<td><code>BASE58;</code></td>
<td><code>"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"</code><br/>Can be used with the ID generator functions.</td>
</tr>
<tr>
<td><code>BASE62;</code></td>
<td><code>"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"</code><br/>Can be used with the ID generator functions.</td>
</tr>
<tr>
<td><code>WORDSAFEALPHABET;</code></td>
<td><code>"23456789CFGHJMPQRVWXcfghjmpqvwx"</code><br/>Can be used with the ID generator functions.</td>
</tr>
<tr>
<td><code>b64Encode(<string>);</code></td>
<td>Unicode compatible string to base64 converter. Return the encoded string.</td>
</tr>
<tr>
<td><code>b64Decode(<string>);</code></td>
<td>Unicode compatible base64 to string converter. Return the original string.</td>
</tr>
<tr>
<td><code>assertEq(<msg>,<value1>,<value2>[,strict=true]);</code></td>
<td>This function throws an error with the message if the value1 and value2 aren't equals. The message parameter is mandatory and has to be a string. The strict parameter is optional and can be a boolean. The return value is <code>true</code>, when the test was success.</td>
</tr>
<tr>
<td><code>assertFalse(<msg>,<value>);</code></td>
<td>This function throws an error with the message if the value is true. The message parameter is mandatory and has to be a string. The return value is <code>true</code>, when the test was success.</td>
</tr>
<tr>
<td><code>assertNotEq(<msg>,<value1>,<value2>[,strict=true]);</code></td>
<td>This function throws an error with the message if the value1 and value2 are equals. The message parameter is mandatory and has to be a string. The strict parameter is optional and can be a boolean. The return value is <code>true</code>, when the test was success.</td>
</tr>
<tr>
<td><code>assertTrue(<msg>,<value>);</code></td>
<td>This function throws an error with the message if the value is false. The message parameter is mandatory and has to be a string. The return value is <code>true</code>, when the test was success.</td>
</tr>
<tr>
<td><code>bind(<function>,<context>);</code></td>
<td>Returns a function that is bound to a context. Both of the parameters are mandatory.</td>
</tr>
<tr>
<td><code>classof(<variable>[,type[,throw=false]]);</code></td>
<td><span class="info">Old name before v5.4.0: <code>getType</code>.</span><br/>Get the real type of a variable. If this is an object, then the return value is the detailed object type (e.g.: array). If the type (string) parameter is given, then the return value (boolean) is the equality of the type of the variable and the second parameter. If the third parameter (boolean) is true and the type of the variable and the second parameter aren't equals, then the function is throwing a <code>TypeError();</code>, else the return value is true.</td>
</tr>
<tr>
<td><code>constant(<value>);</code></td>
<td>A one time assignment function to create a constant value in ES5. This returns a function, which returns the given value. (In math: <code>f(x)=x</code>)</td>
</tr>
<tr>
<td><code>delay(<ms>).then(<callback>);</code></td>
<td>
<p>A promise based delay function. The ms parameter is mandatory and have to be an integer (milliseconds).</p>
<p><b>Sample:</b></p>
<p><button onclick="CEL.delay(5000).then(() => alert('5 seconds')).catch(console.log.bind(console)) .finally(() => alert('done'));">try</button></p>
<pre>
CEL.delay(5000)
.then(() => alert("5 seconds"))
.catch(console.log.bind(console))
.finally(() => alert("done"));</pre>
</td>
</tr>
<tr>
<td><code>extend([deep,]<target>,<source1>[,sourceN]);</code></td>
<td>This is an enhanced version of the <code>Object.assign</code> method. The deep parameter (boolean) is optional and sets the deep copy (recursive) of the sources.</td>
</tr>
<tr>
<td><code>F();</code></td>
<td>This function returns false.</td>
</tr>
<tr>
<td><code>filterIn(<object>,<callback>);</code></td>
<td>
<p></p>The filterIn() function executes a provided function once for each object property and returns a new object with the properties which were be filtered. The object parameter is mandatory and has to be an object. The callback parameter is mandatory and has to be a function. The parameter function will be called with these arguments: key value, key, object.</p>
<p><b>Example:</b><pre>var o1 = {"a": 1, "b": 2, "c": 3};
console.log(o1);
// Object { a: 1, b: 2, c: 3 }
var o2 = CEL.filterIn(o1, (v, p, o) => (v > 1));
console.log(o2);
// Object { b: 2, c: 3 }</pre>
</td>
</tr>
<tr>
<td><code>forIn(<object>,<callback>);</code></td>
<td>The forIn() function executes a provided function once for each object property. The object parameter is mandatory and has to be an object. The callback parameter is mandatory and has to be a function. The parameter function will be called with these arguments: key value, key, object.</td>
</tr>
<tr>
<td><code>getUrlVars([str=location.search]);</code></td>
<td>Get the values of the url variables in an object from the <code>location.search</code> <b>(default value)</b> or another given url. The str parameter name is optional and can be a string.
<br/>Example: <code>"?showall=true&order_by=updated&o=asc"</code> -> <code>Object { showall: "true", order_by: "updated", o: "asc" }</code></td>
</tr>
<tr>
<td><code>identity(<value>);</code></td>
<td>Return the given value. (In math: <code>f(x)=x</code>)</td>
</tr>
<tr>
<td><code>inherit(<subclass>,<superclass>);</code></td>
<td>Prototype inheritance.</td>
</tr>
<tr>
<td><code>javaHash(<data>[,hexa=false]);</code></td>
<td>Java <code>String.hashCode()</code> implementation in Javascript - this is a non-cryptographic hash function. The data parameter is mandatory and can be any type. The hexa parameter is optional and can be a boolean and sets the hexadecimal conversion of the return value and the default value is false. Return the generated integer hash.</td>
</tr>
<tr>
<td><code>nanoid([size=21[,alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-"]]);</code></td>
<td>Generate a nanoid. The size parameter is optional and the default value is 21. The alphabet parameter is optional and the default value is "A-Za-z0-9_-". The return value is the generated nanoid (string).<br>Example ID: <code>"QsZA2VVTgFIF3D-qFk5oc"</code></td>
</tr>
<tr>
<td><code>noop();</code></td>
<td>It's an empty function (no operation) that returns undefined and usable for optional callback arguments.</td>
</tr>
<tr>
<td><code>obj2string(<object>);</code></td>
<td>Convert object to a querystring. The return value is the string. The object parameter is mandatory.</td>
</tr>
<tr>
<td><code>randomBoolean();</code></td>
<td>Get a random boolean value. The return value is <code>true</code> or <code>false</code>.</td>
</tr>
<tr>
<td><code>randomID([hyphens=true][,usedate=false]);</code></td>
<td>
<span class="deprecated">DEPRECATED in v5.5.4</span>
<br/><span class="removed">REMOVED in v5.6.0</span>
<br/><span class="info">Can be replaced with the <code>crypto.randomUUID();</code>, which is polyfilled in this library.</span>
<br/>Generate a GUID/UUID v4 random ID. The hyphens and useDate parameters are optional and can be a boolean. The return value is a string.
</td>
</tr>
<tr>
<td><code>randomString([length[,specialCharactersEnabled=false]]);</code></td>
<td>
<span class="deprecated">DEPRECATED in v5.5.2</span>
<br/><span class="removed">REMOVED in v5.6.0</span>
<br/><span class="info">Can be replaced with with the <code>CEL.nanoid();</code>.</span>
<br/>Generate a random string. The length parameter is optional and can be a number and the default value is 100. The specialCharactersEnabled parameter is optional and can be a boolean and the default value is false. Return the generated string.</td>
</tr>
<tr>
<td><code>sizeIn(<object>);</code></td>
<td>Returns the count of the owned properties of the given object. The object parameter is mandatory.</td>
</tr>
<tr>
<td><code>popIn(<object>,<property>);</code></td>
<td>The popIn() function deletes the property in the object and returns the value of the deleted property. If the property doesn't exist in the object, then the return value is undefined. The object parameter is mandatory and has to be an object. The property parameter is mandatory.</td>
</tr>
<tr>
<td><code>sleep(<ms>).then(<callback>);</code></td>
<td>This is an alias of the <code>delay(<ms>).then(<callback>);</code>.</td>
</tr>
<tr>
<td><code>T();</code></td>
<td>This function returns true.</td>
</tr>
<tr>
<td><code>timestampID([size=21[,alphabet="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"]]);</code></td>
<td>Generate a timestamp based sortable ID. The size parameter is optional and the default value is 21, but if the given value smaller than 12, then the value will be 12. The alphabet parameter is optional and the default value is <code>"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"</code>, same as BASE58. The return value is the generated id (string).<br/>Example ID: <code>"00lirtqi4e-wgGn8vGPyY"</code></td>
</tr>
<tr>
<td><code>unBind(<function>);</code></td>
<td><span class="info">Old name before v5.4.1: <code>toFunction</code>.</span><br/>Returns an unbinded function from an object method. The function parameter is mandatory.</td>
</tr>
</table>
</div>
<h3>String API</h3>
<p>These functions are available in the <code>celestra</code> and/or <code>CEL</code> objects.
<br/>Example: <code>CEL.strPropercase();</code></p>
<div>
<table class="table-responsive table-striped">
<tr>
<td style="width: auto; min-width: 33%;"><b>Name</b></td>
<td><b>Description</b></td>
</tr>
<tr>
<td><code>strAt(<string>,<index>[,newChar]);</code></td>
<td>
<p>If the newchar is undefined, then returns the unicode character, which has to be on the given index in the string. The index can be negative value (<code>-1 -> last</code>). If the index is out of the string length, then the return value is an empty string. All of the parameters are mandatory and index has to be an integer.</p>
<p>If the newChar is not undefined, then the indexed character will be replaced with the newChar and returns the modified string.</p>
</td>
</tr>
<tr>
<td><code>strCapitalize(<string>);</code></td>
<td>This function is unicode compatible and converts the first character to uppercase and the other characters to lowercase. The string parameter is mandatory. The return value is a string.</td>
</tr>
<tr>
<tr>
<td><code>strCodePoints(<string>);</code></td>
<td>Returns the array of the unicode codepoints of characters of the given string. The string parameter is mandatory.</td>
</tr>
<tr>
<td><code>strDownFirst(<string>);</code></td>
<td>This function is unicode compatible and converts the first character to lowercase. The string parameter is mandatory. The return value is a string.</td>
</tr>
<tr>
<td><code>strFromCodePoints(<collection>);</code></td>
<td>Returns the joined string of the given unicode codepoints. The collection parameter is mandatory.</td>
</tr>
<tr>
<td><code>strHTMLEscape(<string>);</code></td>
<td>This function escapes these characters: <code><</code>, <code>></code>, <code>&</code>, <code>"</code>, <code>'</code>. The String parameter is mandatory. The return value is the escaped string.</td>
</tr>
<tr>
<td><code>strHTMLRemoveTags(<string>);</code></td>
<td>Remove HTML tags from the given string. The string parameter is mandatory. The return value is the new string.</td>
</tr>
<tr>
<td><code>strUnHTMLEscape(<string>);</code></td>
<td>This function unescapes these characters: <code><</code>, <code>></code>, <code>&</code>, <code>"</code>, <code>'</code>. The String parameter is mandatory. The return value is the unescaped string.</td>
</tr>
<tr>
<td><code>strReverse(<string>);</code></td>
<td>Returns the reversed variant of the given string. In the ES6 compatible browsers the result will be unicode compatible. The string parameter is mandatory.</td>
</tr>
<tr>
<td><code>strPropercase(<string>);</code></td>
<td>This function is unicode compatible and capitalizes every word of the given string. The string parameter is mandatory. The return value is a string.<br/><b>Example:</b><br/><code>CEL.strPropercase("arthur conan doyle");</code><br/>-><br/><code>"Arthur Conan Doyle"</code></td>
</tr>
<tr>
<td><code>strSplice(<str>,<index>,<count>[,add]);</code></td>
<td>This function works like the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice" target="_blank">Array.prototype.splice();</a> and can remove characters on the index or replace with other string. The return value is the modified string.</td>
</tr>
<tr>
<td><code>strTitlecase(<string>);</code></td>
<td>Alias of the <code>strPropercase(<string>);</code>.</td>
</tr>
<td><code>strUpFirst(<string>);</code></td>
<td>This function is unicode compatible and converts the first character to uppercase. The string parameter is mandatory. The return value is a string.</td>
</tr>
</table>
</div>
<h3>DOM API</h3>
<p>These functions are available in the <code>celestra</code> and/or <code>CEL</code> objects.
<br/>Example: <code>CEL.domCreate();</code></p>
<div>
<table class="table-responsive table-striped">
<tr>
<td style="width: auto; min-width: 33%;"><b>Name</b></td>
<td><b>Description</b></td>
</tr>
<tr>
<td><code>createFile(<filename>,<content>[,dataType]);</code></td>
<td>
<p>Create and save file without a server. The filename and content parameters are mandatory and have to be a string. The dataType parameter is optional and can be a string. The default value of the dataType parameter is <code>text/plain</code>.</p>
<p><span class="info">Doesn't work in iOS browsers (Safari, Firefox and Chrome) and W10M Edge 14.</span></p>
</td>
</tr>
<tr>
<td><code>domCreate(<type>[,properties[,innerHTML]]);</code></td>
<td>Create a new HTML element. The type is mandatory and has to be a string. The properties object is optional and sets the element properties. (class, style object/string, data-*, etc.) The innerHTML is optional and can be a string.</td>
</tr>
<tr>
<td><code>domCreate(<element descriptive object>);</code></td>
<td>
<p>Since v2.0.5, a new element can be created with an object. In this case the element descriptive object is mandatory. The <code>style</code> can be a subobject or a string.</p>
<p><b>Sample code:</b></p>
<pre>CEL.domCreate({
elementType: "a",
href: "https://developer.mozilla.org/en-US/",
target: "_blank",
style: {
"background-color": "red",
"color": "white"
},
innerHTML: "MDN Sample url"
});</pre>
</td>
</tr>
<tr>
<td><code>domFadeIn(<element>[, duration[,display]]);</code></td>
<td>Fade in and show animation for an element. The element is mandatory and has to be a HTML element. The duration parameter is optional and sets the animation time in milisec (the default is 500ms). The display is optional and can be a string (CSS display property values).</td>
</tr>
<tr>
<td><code>domFadeOut(<element>[,duration]);</code></td>
<td>Fade out and hide animation for an element. The element is mandatory and has to be a HTML element. The duration parameter is optional and sets the animation time in milisec (the default is 500ms).</td>
</tr>
<tr>
<td><code>domFadeToggle(<element>[,duration[,display]]);</code></td>
<td>Fade in or fade out animation which depends on the state of the element. The element is mandatory and has to be a HTML element. The duration parameter is optional and sets the animation time in millisecond (the default is 500ms). The display is optional and can be a string (CSS display property values).</td>
</tr>
<tr>
<td><code>domGetCSS(<element>[,property]);</code></td>
<td>Get a CSS property value of an element or all of the css properties in an object. The element is mandatory and has to be a HTML element. The property is optional and can be a string.</td>
</tr>
<tr>
<td><code>domGetCSSVar(<name>);</code></td>
<td>This function returns a value of a CSS variable or an empty string, if the variable is unset. The name parameter is mandatory and has to be a string. If the "--" characters are missing at the begin of the variable name, then the function will add these.</td>
</tr>
<tr>
<td><code>domHide(<element>);</code></td>
<td>Hide an element. The element is mandatory and has to be a HTML element.</td>
</tr>
<tr>
<td><code>domIsHidden(<element>);</code></td>
<td>This function determines whether the element is hidden. The element is mandatory and has to be a HTML element. The return value is boolean.</td>
</tr>
<tr>
<td><code>domReady(<callback>);</code></td>
<td>Set the document ready (content fully loaded) event.</td>
</tr>
<tr>
<td><code>domSetCSS(<element>,<property>,<value>);</code></td>
<td>Set a CSS property value of an element. The element is mandatory and has to be a HTML element. The property is mandatory and has to be a string. The value is mandatory and has to be a string.</td>
</tr>
<tr>
<td><code>domSetCSS(<element>,<properties>);</code></td>
<td>Set CSS property values of an element. The element is mandatory and has to be a HTML element. The properties object is mandatory. The object properties can be the CSS properties and the property values will be applied to the element.</td>
</tr>
<tr>
<td><code>domSetCSSVar(<name>,<value>);</code></td>
<td>This function set a value of a CSS variable. Both of the parameters are mandatory and have to be a string. If the "--" characters are missing at the begin of the variable name, then the function will add these.</td>
</tr>
<tr>
<td><code>domShow(<element>[,display]);</code></td>
<td>Show an element. The element is mandatory and has to be a HTML element. The display is optional and can be a string (CSS display values).</td>
</tr>
<tr>
<td><code>domScrollToBottom();</code></td>
<td><span class="info">Old name before v5.5.4: <code>domToBottom</code>.</span><br/>This function is scrolling to the bottom of the page.</td>
</tr>
<tr>
<td><code>domScrollToElement(<element>[,top=true]);</code></td>
<td>This function is scrolling to top or the bottom of element. The element parameter is mandatory and the top parameter is optional and can be boolean.</td>
</tr>
<tr>
<td><code>domScrollToTop();</code></td>
<td><span class="info">Old name before v5.5.4: <code>domToTop</code>.</span><br/>This function is scrolling to the top of the page.</td>
</tr>
<tr>
<td><code>domSiblings(<element>);</code></td>
<td>Get the siblings of an element. The element parameter is mandatory and the return value is the array.</td>
</tr>
<tr>
<td><code>domSiblingsLeft(<element>);</code></td>
<td>Alias of the <code>domSiblingsPrev(<element>);</code>.</td>
</tr>
<tr>
<td><code>domSiblingsNext(<element>);</code></td>
<td>Get the next siblings of an element. The element parameter is mandatory and the return value is the array.</td>
</tr>
<tr>
<td><code>domSiblingsPrev(<element>);</code></td>
<td>Get the previous siblings of an element. The element parameter is mandatory and the return value is the array.</td>
</tr>
<tr>
<td><code>domSiblingsRight(<element>);</code></td>
<td>Alias of the <code>domSiblingsNext(<element>);</code>.</td>
</tr>
<tr>
<td><code>domToElement(<htmlString>);</code></td>
<td>This function returns a HTML element which is created from the htmlString parameter. The htmlString parameter is mandatory and has to be a string.</td>
</tr>
<tr>
<td><code>domToggle(<element>[,display]);</code></td>
<td>Show or hide an element. The element is mandatory and has to be a HTML element. The display is optional and can be a string (CSS display values).</td>
</tr>
<tr>
<td><code>importScript(<script1>[,scriptN]);</code></td>
<td>
<p>Load JavaScript files. The first parameter is mandatory and has to be a string. The other parameters are optional and can be a string.</p>
<p><b>Tip:</b><br/>To prevent the caching of a js/css file use versioning in the file url. Example: <code>mylib.js?version=1.10.0</code></p>
</td>
</tr>
<tr>
<td><code>importStyle(<style1>[,styleN]);</code></td>
<td>Load CSS files. The first parameter is mandatory and has to be a string. The other parameters are optional and can be a string.</td>
</tr>
<tr>
<td><code>form2array(<form>);</code></td>
<td>Convert (serialize) form input tag names and values to an array with object elements (name and value properties). The return value is the array. The form parameter is mandatory and has to be a html form element.</td>
</tr>
<tr>
<td><code>form2string(<form>);</code></td>
<td>Convert (serialize) form input tag names and values to a query string. The return value is the string. The form parameter is mandatory and has to be a html form element.</td>
</tr>
<tr>
<td><code>getDoNotTrack();</code></td>
<td>Return the DoNotTrack setting (boolean) of the browser.</td>
</tr>
<tr>
<td><code>getFullscreen();</code></td>
<td>
Get the fullscreen element. If this isn't set, then the return value is undefined.
<br/>Please check the incompatibility issues on the <a href="http://caniuse.com/#search=fullscreen" target="_blank">http://caniuse.com/#search=fullscreen</a> page.
</td>
</tr>
<tr>
<td><code>getLocation(<success>[,error]);</code></td>
<td>Get the current location as an object with the coordinates. The success is mandatory and has to be a function. The error is optional and can be a function.</td>
</tr>
<tr>
<td><code>setFullscreenOff();</code></td>
<td>Set off the fullscreen.</td>
</tr>
<tr>
<td><code>setFullscreenOn(<selector>);</code></td>
<td>Set the fullscreen element. The selector can be a css selector string or an element.</td>
</tr>
<tr>
<td><code>qs(<selector>[,context]);</code></td>
<td>Get the first matched HTML element. The context is optional and can be an element or a selector string.</td>
</tr>
<tr>
<td><code>qsa(<selector>[,context]);</code></td>
<td>Get matched HTML elements in an array. The context is optional and can be an element or a selector string.</td>
</tr>
</table>
</div>
<h3>AJAX and CORS API</h3>
<p class="info">
These functions aren't deprecated, but it's recommend to use the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API" target="_blank">Fetch API</a>, because it's <a href="https://caniuse.com/?search=fetch" target="_blank">supported</a> in every modern browsers.
</p>
<p>These functions are available in the <code>celestra</code> and/or <code>CEL</code> objects.
<br/>Example: <code>CEL.getJson();</code></p>
<div style="overflow-x:auto;">
<table class="table-responsive table-striped">
<tr>
<td style="width: auto; min-width: 33%;"><b>Name</b></td>
<td><b>Description</b></td>
</tr>
<tr>
<td><code>ajax(<Options object>);</code></td>
<td>Get content and send data via AJAX and CORS.</td>
</tr>
<tr>
<td><code>getJson(<url>,<success>);</code></td>
<td>Get TEXT content via AJAX. A shorthand function to the ajax() function.</td>
</tr>
<tr>
<td><code>getText(<url>,<success>);</code></td>
<td>Get JSON content via AJAX. A shorthand function to the ajax() function.</td>
</tr>
</table>
</div>
<p><b>Options object properties:</b></p>
<ul>
<li>The <b>queryType</b> is optional and can be a <b>string</b> with these values: <code>"ajax"</code> or <code>"cors"</code>. The default value is <code>"ajax"</code>.</li>
<li>The <b>type</b> is optional and can be a <b>string</b> with these values: <code>"get"</code> or <code>"post"</code>. The default value is <code>"get"</code>.</li>
<li>The <b>url</b> is mandatory and has to be a <b>string</b>.</li>
<li>The <b>data</b> is optional and has to be a <b>string</b> if the <code>type === "post"</code>.</li>
<li>The <b>format</b> is optional and can be a <b>string</b> with these values: <code>"text"</code> or <code>"json"</code> or <code>"xml"</code>. The default value is <code>"text"</code>.
<li>The <b>success</b> is mandatory and has to be a <b>function</b>.</li>
<li>The <b>error</b> is optional and can be a <b>function</b>.</li>
<li>The <b>user</b> is optional and can be a <b>string</b>.</li>
<li>The <b>password</b> is optional, but mandatory if the user is set. This parameter can be a <b>string</b>.</li>
</ul>
<h3 id="typechecking">Type checking API</h3>
<p>These functions are available in the <code>celestra</code> and/or <code>CEL</code> objects.
<br/>Example: <code>CEL.isString();</code></p>
<div>
<table class="table-responsive table-striped">
<tr>
<td style="width: auto; min-width: 33%;"><b>Name</b></td>
<td><b>Description</b></td>
</tr>
<tr>
<td><code>isArrayBuffer(<value>);</td>
<td>This function determines whether the provided value is an arraybuffer. The return value is boolean.</td>
</tr>
<tr>
<td><code>isArraylike(<value>);</code></td>
<td>This function determines whether the provided value is an iterable object. The return value is boolean.</td>
</tr>
<tr>
<td><code>isAsyncFn(<value>);</td>
<td>This function determines whether the provided value is an async function. The return value is boolean.</td>
</tr>
<tr>
<td><code>isAsyncGeneratorFn(<value>);</td>
<td>This function determines whether the provided value is an async generator function. The return value is boolean.</td>
</tr>
<tr>
<td><code>isBigInt(<value>);</td>
<td>This function determines whether the provided value is a BigInt. The return value is boolean.</td>
</tr>
<tr>
<td><code>isBoolean(<value>);</code></td>
<td>This function determines whether the provided value is a boolean. The return value is boolean.</td>
</tr>
<tr>
<td><code>isCallable(<value>);</code></td>
<td>Alias of the <code>isFunction(<value>);</code>.</td>
</tr>
<tr>
<td><code>isChar(<value>);</code></td>
<td>This function determines whether the provided value is a string with length 1 character. This function is unicode compatible. The return value is boolean.</td>
</tr>
<tr>
<td><code>isConstructorFn(<value>);</td>
<td>This function determines whether the provided value is a constructable function. The return value is boolean.</td>
</tr>
<tr>
<td><code>isDataView(<value>);</td>
<td>This function determines whether the provided value is an DataView object. The return value is boolean.</td>
</tr>
<tr>
<td><code>isDate(<value>);</code></td>
<td>This function determines whether the provided value is a date. The return value is boolean.</td>
</tr>
<tr>
<td><code>isElement(<value>);</code></td>
<td>
This function determines whether the provided value is a HTML element. The return value is boolean.
<p>
For other node types (document, text, comment, etc.) checking please read this MDN page:
<br/><a href=" https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType" target="_blank"> https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType</a>
</p>
</td>
</tr>
<tr>
<td><code>isEmptyArray(<value>);</code></td>
<td>This function determines whether the provided value is an empty array (without values). The return value is boolean.</td>
</tr>
<tr>
<td><code>isEmptyIterator(<value>);</code></td>
<td>This function determines whether the provided value is an empty iterator (without values). The return value is boolean.</td>
</tr>
<tr>
<td><code>isEmptyMap(<value>);</code></td>
<td>This function determines whether the provided value is an empty map (without properties). The return value is boolean.</td>
</tr>
<tr>
<td><code>isEmptyObject(<value>);</code></td>
<td>This function determines whether the provided value is an empty object (without properties). The return value is boolean.</td>
</tr>
<tr>
<td><code>isEmptySet(<value>);</code></td>
<td>This function determines whether the provided value is an empty set (without values). The return value is boolean.</td>
</tr>
<tr>
<td><code>isError(<value>);</td>
<td>This function determines whether the provided value is an error object. The return value is boolean.</td>
</tr>
<tr>
<td><code>isFalsy(<value>);</td>
<td>This function determines whether the provided value is falsy. The return value is boolean. For more information please read the <a href="https://developer.mozilla.org/en-US/docs/Glossary/Falsy" target="_blank">MDN Article</a>!</td>
</tr>
<tr>
<td><code>isFloat(<value>);</code></td>
<td>This function determines whether the provided value is a float number. The return value is boolean.</td>
</tr>
<tr>
<td><code>isFunction(<value>);</code></td>
<td>This function determines whether the provided value is a function. The return value is boolean.</td>
</tr>
<tr>
<td><code>isGeneratorFn(<value>);</td>
<td>This function determines whether the provided value is a generator function. The return value is boolean.</td>
</tr>
<tr>
<td><code>isIterable(<value>);</code></td>
<td>This function determines whether the provided value is an iterable collection. The return value is boolean.</td>
</tr>
<tr>
<td><code>isIterator(<value>);</code></td>
<td>This function determines whether the provided value is an iterator. The return value is boolean.</td>
</tr>
<tr>
<td><code>isMap(<value>);</code></td>
<td>This function determines whether the provided value is a map. The return value is boolean.</td>
</tr>
<tr>
<td><code>isNil(<value>);</code></td>
<td>This function determines whether the provided value is null or undefined or NaN. The return value is boolean.</code>.</td>
</tr>
<tr>
<td><code>isNull(<value>);</code></td>
<td>This function determines whether the provided value is null. The return value is boolean.</td>
</tr>
<tr>
<td><code>isNullOrUndefined(<value>);</code></td>
<td>This function determines whether the provided value is null or undefined. The return value is boolean.</td>
</tr>
<tr>
<td><code>isNumber(<value>);</code></td>
<td>This function determines whether the provided value is a number. The return value is boolean.</td>
</tr>
<tr>
<td><code>isNumeric(<value>);</code></td>
<td>This function determines whether the provided value is a number or can be converted to number. The return value is boolean.</td>
</tr>
<tr>
<td><code>isObject(<value>);</code></td>
<td>This function determines whether the provided value is an object and not null. The return value is boolean.</td>
</tr>
<tr>
<td><code>isPlainObject(<value>);</td>
<td>This function determines whether the provided value is an object, which own prototype is the Object.prototype or null. The return value is boolean.</td>
</tr>
<tr>
<td><code>isPrimitive(<value>);</code></td>
<td>This function determines whether the provided value is not null, not object and not function. The return value is boolean.</td>
</tr>
<tr>
<td><code>isPromise(<value>);</td>
<td>This function determines whether the provided value is a promise object. The return value is boolean.</td>
</tr>
<tr>
<td><code>isRegexp(<value>);</code></td>
<td>This function determines whether the provided value is a regexp. The return value is boolean.</td>
</tr>
<tr>
<td><code>isSameArray(<array1>,<array2>);</code></td>
<td>This function checks the value equality of the given arrays. The return value is boolean and both of the parameters are mandatory and have to be an array.</td>
</tr>
<tr>
<td><code>isSameIterator(<iter1>,<iter2>);</code></td>
<td>This function checks the value equality of the given iterator. The return value is boolean and both of the parameters are mandatory and have to be a collection (iterator / iterable object).</td>
</tr>
<tr>
<td><code>isSameMap(<map1>,<map2>);</code></td>
<td>This function checks the property and value equality of the given maps. The return value is boolean and both of the parameters are mandatory and have to be a map.</td>
</tr>
<tr>
<td><code>isSameObject(<object1>,<object2>);</code></td>
<td>This function checks the property and value equality of the given objects. The return value is boolean and both of the parameters are mandatory and have to be an object.</td>
</tr>
<tr>
<td><code>isSameSet(<set1>,<set2>);</code></td>
<td>This function checks the value equality of the given sets. The return value is boolean and both of the parameters are mandatory and have to be a set.</td>
</tr>
<tr>
<td><code>isSet(<value>);</code></td>
<td>This function determines whether the provided value is a set. The return value is boolean.</td>
</tr>
<tr>
<td><code>isString(<value>);</code></td>
<td>This function determines whether the provided value is a string. This function is unicode compatible. The return value is boolean.</td>
</tr>
<tr>
<td><code>isSymbol(<value>);</code></td>
<td>This function determines whether the provided value is a symbol. The return value is boolean.</td>
</tr>
<tr>
<td><code>isTruthy(<value>);</td>
<td>This function determines whether the provided value is truthy. The return value is boolean. For more information please read the <a href="https://developer.mozilla.org/en-US/docs/Glossary/Truthy" target="_blank">MDN Article</a>!</td>
</tr>
<tr>
<td><code>isTypedArray(<value>);</td>
<td>This function determines whether the provided value is a typedarray. The return value is boolean.</td>
</tr>
<tr>
<td><code>isUndefined(<value>);</code></td>
<td>This function determines whether the provided value is undefined. The return value is boolean.</td>
</tr>
<tr>
<td><code>isWeakMap(<value>);</code></td>
<td>This function determines whether the provided value is a weakmap. The return value is boolean.</td>
</tr>
<tr>
<td><code>isWeakSet(<value>);</code></td>
<td>This function determines whether the provided value is a weakset. The return value is boolean.</td>
</tr>
</table>
</div>
<h3 id="cookie">Cookie API</h3>
<p>These functions are available in the <code>celestra</code> and/or <code>CEL</code> objects.
<br/>Example: <code>CEL.setCookie();</code></p>
<p>
Cookie values help:
<a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie" target="_blank">MDN</a>,
<a href="https://web.dev/samesite-cookies-explained" target="_blank">web.dev</a>
</p>
<div>
<table class="table-responsive table-striped">
<tr>
<td style="width: auto; min-width: 33%;"><b>Name</b></td>
<td><b>Description</b></td>
</tr>
<tr>
<td><code>clearCookies([path="/"[,domain[,secure[,SameSite="Lax"[,HttpOnly]]]]]);</code></td>
<td>
<p>Clear all of the cookies. The return value (boolean) is determines whether the cookie was set with the name before the removing.</p>
<p><b>Function parameters:</b></p>
<ul>
<li>The path is optional and can be a string. <i>(Default value: "/")</i> To the local path set the <code>""</code> value!</li>
<li>The domain is optional and can be a string.</li>
<li>The secure is optional and can be a boolean.</li>
<li>The SameSite is optional and can be a string. <i>("Lax", "Strict", "None", default value: "Lax")</i></li>
<li>The HttpOnly is optional and can be a boolean.</li>
</ul>
</td>
</tr>
<tr>
<td><code>clearCookies(<Options object>);</code></td>
<td>In this case the names of object properties are the same as the function arguments and the default values are the same too.</td>
</tr>
<tr>
<td><code>getCookie([name]);</code></td>
<td>
Get the value of a cookie or all cookies in an object.
<br/>With the name parameter (string) the return value is the current cookie value or null. <br/>Without the parameter the return value is an object with the values or an empty object.
</td>
</tr>
<tr>
<td><code>hasCookie(<name>);</code></td>
<td>This function determines whether the cookie is set with the name parameter. The return value is boolean.</td>
</tr>
<tr>
<td><code>removeCookie(<name>[,path="/"[,domain[,secure[,SameSite="Lax"[,HttpOnly]]]]]);</code></td>
<td>
<p>Remove a cookie. The return value (boolean) is determines whether the cookie was set with the name before the removing.</p>
<p><b>Function parameters:</b></p>
<ul>
<li>The name is mandatory and has to be a string.</li>
<li>The path is optional and can be a string. <i>(Default value: "/")</i> To the local path set the <code>""</code> value!</li>
<li>The domain is optional and can be a string.</li>
<li>The secure is optional and can be a boolean.</li>
<li>The SameSite is optional and can be a string. <i>("Lax", "Strict", "None", default value: "Lax")</i></li>
<li>The HttpOnly is optional and can be a boolean.</li>
</ul>
<p>The return value (boolean) is determines whether the cookie was set with the name before the removing.</p>
</td>
</tr>
<tr>
<td><code>removeCookie(<Options object>);</code></td>
<td>In this case the names of object properties are the same as the function arguments and the default values are the same too.</td>
</tr>
<tr>
<td><code>setCookie(<name>,<value>[,hours="8760"[,path="/"[,domain[,secure[,SameSite="Lax"[,HttpOnly]]]]]]);</code></td>
<td>
<p>Set a cookie.</p>
<p><b>Function parameters:</b></p>