@genesislcap/foundation-utils 14.386.1 → 14.387.1-alpha-b46a98f.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/custom-elements.json +196 -120
- package/dist/dts/utils/index.d.ts +1 -0
- package/dist/dts/utils/index.d.ts.map +1 -1
- package/dist/dts/utils/noop.d.ts +23 -0
- package/dist/dts/utils/noop.d.ts.map +1 -0
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/noop.js +26 -0
- package/dist/foundation-utils.api.json +82 -0
- package/dist/foundation-utils.d.ts +24 -0
- package/docs/api/foundation-utils.avoidtreeshaking.md +56 -0
- package/docs/api/foundation-utils.md +26 -0
- package/docs/api/foundation-utils.noop.md +56 -0
- package/docs/api-report.md.api.md +6 -0
- package/package.json +11 -11
|
@@ -482,6 +482,126 @@
|
|
|
482
482
|
}
|
|
483
483
|
]
|
|
484
484
|
},
|
|
485
|
+
{
|
|
486
|
+
"kind": "javascript-module",
|
|
487
|
+
"path": "src/design-system/design-system.ts",
|
|
488
|
+
"declarations": [
|
|
489
|
+
{
|
|
490
|
+
"kind": "function",
|
|
491
|
+
"name": "assureDesignSystem",
|
|
492
|
+
"return": {
|
|
493
|
+
"type": {
|
|
494
|
+
"text": "DesignSystemModule"
|
|
495
|
+
}
|
|
496
|
+
},
|
|
497
|
+
"parameters": [
|
|
498
|
+
{
|
|
499
|
+
"name": "module",
|
|
500
|
+
"type": {
|
|
501
|
+
"text": "DesignSystemModule"
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
],
|
|
505
|
+
"description": "assureDesignSystem.",
|
|
506
|
+
"privacy": "public"
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
"kind": "function",
|
|
510
|
+
"name": "getCurrentDesignSystem",
|
|
511
|
+
"return": {
|
|
512
|
+
"type": {
|
|
513
|
+
"text": ""
|
|
514
|
+
}
|
|
515
|
+
},
|
|
516
|
+
"parameters": [
|
|
517
|
+
{
|
|
518
|
+
"name": "element",
|
|
519
|
+
"type": {
|
|
520
|
+
"text": "HTMLElement"
|
|
521
|
+
},
|
|
522
|
+
"description": "The starting HTML element"
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
"name": "fallbackPrefix",
|
|
526
|
+
"type": {
|
|
527
|
+
"text": "string"
|
|
528
|
+
},
|
|
529
|
+
"description": "The prefix to fallback to if the provider is not available"
|
|
530
|
+
}
|
|
531
|
+
],
|
|
532
|
+
"description": "Get the current design system provider element and prefix by checking available providers.\nIf no provider is found, falls back to the provided prefix.",
|
|
533
|
+
"privacy": "public"
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
"kind": "function",
|
|
537
|
+
"name": "getCurrentDesignSystemPrefix",
|
|
538
|
+
"return": {
|
|
539
|
+
"type": {
|
|
540
|
+
"text": ""
|
|
541
|
+
}
|
|
542
|
+
},
|
|
543
|
+
"parameters": [
|
|
544
|
+
{
|
|
545
|
+
"name": "element",
|
|
546
|
+
"type": {
|
|
547
|
+
"text": "HTMLElement"
|
|
548
|
+
},
|
|
549
|
+
"description": "The starting HTML element"
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
"name": "fallbackPrefix",
|
|
553
|
+
"type": {
|
|
554
|
+
"text": "string"
|
|
555
|
+
},
|
|
556
|
+
"description": "The prefix to fallback to if the provider is not available"
|
|
557
|
+
}
|
|
558
|
+
],
|
|
559
|
+
"description": "Get the current design system prefix by checking available providers.\nIf no provider is found, falls back to the provided prefix.",
|
|
560
|
+
"privacy": "public"
|
|
561
|
+
}
|
|
562
|
+
],
|
|
563
|
+
"exports": [
|
|
564
|
+
{
|
|
565
|
+
"kind": "js",
|
|
566
|
+
"name": "assureDesignSystem",
|
|
567
|
+
"declaration": {
|
|
568
|
+
"name": "assureDesignSystem",
|
|
569
|
+
"module": "src/design-system/design-system.ts"
|
|
570
|
+
}
|
|
571
|
+
},
|
|
572
|
+
{
|
|
573
|
+
"kind": "js",
|
|
574
|
+
"name": "getCurrentDesignSystem",
|
|
575
|
+
"declaration": {
|
|
576
|
+
"name": "getCurrentDesignSystem",
|
|
577
|
+
"module": "src/design-system/design-system.ts"
|
|
578
|
+
}
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
"kind": "js",
|
|
582
|
+
"name": "getCurrentDesignSystemPrefix",
|
|
583
|
+
"declaration": {
|
|
584
|
+
"name": "getCurrentDesignSystemPrefix",
|
|
585
|
+
"module": "src/design-system/design-system.ts"
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
]
|
|
589
|
+
},
|
|
590
|
+
{
|
|
591
|
+
"kind": "javascript-module",
|
|
592
|
+
"path": "src/design-system/index.ts",
|
|
593
|
+
"declarations": [],
|
|
594
|
+
"exports": [
|
|
595
|
+
{
|
|
596
|
+
"kind": "js",
|
|
597
|
+
"name": "*",
|
|
598
|
+
"declaration": {
|
|
599
|
+
"name": "*",
|
|
600
|
+
"package": "./design-system"
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
]
|
|
604
|
+
},
|
|
485
605
|
{
|
|
486
606
|
"kind": "javascript-module",
|
|
487
607
|
"path": "src/env/index.ts",
|
|
@@ -957,126 +1077,6 @@
|
|
|
957
1077
|
}
|
|
958
1078
|
]
|
|
959
1079
|
},
|
|
960
|
-
{
|
|
961
|
-
"kind": "javascript-module",
|
|
962
|
-
"path": "src/design-system/design-system.ts",
|
|
963
|
-
"declarations": [
|
|
964
|
-
{
|
|
965
|
-
"kind": "function",
|
|
966
|
-
"name": "assureDesignSystem",
|
|
967
|
-
"return": {
|
|
968
|
-
"type": {
|
|
969
|
-
"text": "DesignSystemModule"
|
|
970
|
-
}
|
|
971
|
-
},
|
|
972
|
-
"parameters": [
|
|
973
|
-
{
|
|
974
|
-
"name": "module",
|
|
975
|
-
"type": {
|
|
976
|
-
"text": "DesignSystemModule"
|
|
977
|
-
}
|
|
978
|
-
}
|
|
979
|
-
],
|
|
980
|
-
"description": "assureDesignSystem.",
|
|
981
|
-
"privacy": "public"
|
|
982
|
-
},
|
|
983
|
-
{
|
|
984
|
-
"kind": "function",
|
|
985
|
-
"name": "getCurrentDesignSystem",
|
|
986
|
-
"return": {
|
|
987
|
-
"type": {
|
|
988
|
-
"text": ""
|
|
989
|
-
}
|
|
990
|
-
},
|
|
991
|
-
"parameters": [
|
|
992
|
-
{
|
|
993
|
-
"name": "element",
|
|
994
|
-
"type": {
|
|
995
|
-
"text": "HTMLElement"
|
|
996
|
-
},
|
|
997
|
-
"description": "The starting HTML element"
|
|
998
|
-
},
|
|
999
|
-
{
|
|
1000
|
-
"name": "fallbackPrefix",
|
|
1001
|
-
"type": {
|
|
1002
|
-
"text": "string"
|
|
1003
|
-
},
|
|
1004
|
-
"description": "The prefix to fallback to if the provider is not available"
|
|
1005
|
-
}
|
|
1006
|
-
],
|
|
1007
|
-
"description": "Get the current design system provider element and prefix by checking available providers.\nIf no provider is found, falls back to the provided prefix.",
|
|
1008
|
-
"privacy": "public"
|
|
1009
|
-
},
|
|
1010
|
-
{
|
|
1011
|
-
"kind": "function",
|
|
1012
|
-
"name": "getCurrentDesignSystemPrefix",
|
|
1013
|
-
"return": {
|
|
1014
|
-
"type": {
|
|
1015
|
-
"text": ""
|
|
1016
|
-
}
|
|
1017
|
-
},
|
|
1018
|
-
"parameters": [
|
|
1019
|
-
{
|
|
1020
|
-
"name": "element",
|
|
1021
|
-
"type": {
|
|
1022
|
-
"text": "HTMLElement"
|
|
1023
|
-
},
|
|
1024
|
-
"description": "The starting HTML element"
|
|
1025
|
-
},
|
|
1026
|
-
{
|
|
1027
|
-
"name": "fallbackPrefix",
|
|
1028
|
-
"type": {
|
|
1029
|
-
"text": "string"
|
|
1030
|
-
},
|
|
1031
|
-
"description": "The prefix to fallback to if the provider is not available"
|
|
1032
|
-
}
|
|
1033
|
-
],
|
|
1034
|
-
"description": "Get the current design system prefix by checking available providers.\nIf no provider is found, falls back to the provided prefix.",
|
|
1035
|
-
"privacy": "public"
|
|
1036
|
-
}
|
|
1037
|
-
],
|
|
1038
|
-
"exports": [
|
|
1039
|
-
{
|
|
1040
|
-
"kind": "js",
|
|
1041
|
-
"name": "assureDesignSystem",
|
|
1042
|
-
"declaration": {
|
|
1043
|
-
"name": "assureDesignSystem",
|
|
1044
|
-
"module": "src/design-system/design-system.ts"
|
|
1045
|
-
}
|
|
1046
|
-
},
|
|
1047
|
-
{
|
|
1048
|
-
"kind": "js",
|
|
1049
|
-
"name": "getCurrentDesignSystem",
|
|
1050
|
-
"declaration": {
|
|
1051
|
-
"name": "getCurrentDesignSystem",
|
|
1052
|
-
"module": "src/design-system/design-system.ts"
|
|
1053
|
-
}
|
|
1054
|
-
},
|
|
1055
|
-
{
|
|
1056
|
-
"kind": "js",
|
|
1057
|
-
"name": "getCurrentDesignSystemPrefix",
|
|
1058
|
-
"declaration": {
|
|
1059
|
-
"name": "getCurrentDesignSystemPrefix",
|
|
1060
|
-
"module": "src/design-system/design-system.ts"
|
|
1061
|
-
}
|
|
1062
|
-
}
|
|
1063
|
-
]
|
|
1064
|
-
},
|
|
1065
|
-
{
|
|
1066
|
-
"kind": "javascript-module",
|
|
1067
|
-
"path": "src/design-system/index.ts",
|
|
1068
|
-
"declarations": [],
|
|
1069
|
-
"exports": [
|
|
1070
|
-
{
|
|
1071
|
-
"kind": "js",
|
|
1072
|
-
"name": "*",
|
|
1073
|
-
"declaration": {
|
|
1074
|
-
"name": "*",
|
|
1075
|
-
"package": "./design-system"
|
|
1076
|
-
}
|
|
1077
|
-
}
|
|
1078
|
-
]
|
|
1079
|
-
},
|
|
1080
1080
|
{
|
|
1081
1081
|
"kind": "javascript-module",
|
|
1082
1082
|
"path": "src/error/errorMap.ts",
|
|
@@ -3753,6 +3753,14 @@
|
|
|
3753
3753
|
"name": "*",
|
|
3754
3754
|
"package": "./logger"
|
|
3755
3755
|
}
|
|
3756
|
+
},
|
|
3757
|
+
{
|
|
3758
|
+
"kind": "js",
|
|
3759
|
+
"name": "*",
|
|
3760
|
+
"declaration": {
|
|
3761
|
+
"name": "*",
|
|
3762
|
+
"package": "./noop"
|
|
3763
|
+
}
|
|
3756
3764
|
}
|
|
3757
3765
|
]
|
|
3758
3766
|
},
|
|
@@ -3778,6 +3786,74 @@
|
|
|
3778
3786
|
}
|
|
3779
3787
|
]
|
|
3780
3788
|
},
|
|
3789
|
+
{
|
|
3790
|
+
"kind": "javascript-module",
|
|
3791
|
+
"path": "src/utils/noop.ts",
|
|
3792
|
+
"declarations": [
|
|
3793
|
+
{
|
|
3794
|
+
"kind": "function",
|
|
3795
|
+
"name": "noop",
|
|
3796
|
+
"return": {
|
|
3797
|
+
"type": {
|
|
3798
|
+
"text": "void"
|
|
3799
|
+
}
|
|
3800
|
+
},
|
|
3801
|
+
"parameters": [
|
|
3802
|
+
{
|
|
3803
|
+
"name": "fn",
|
|
3804
|
+
"optional": true,
|
|
3805
|
+
"type": {
|
|
3806
|
+
"text": "() => void"
|
|
3807
|
+
}
|
|
3808
|
+
},
|
|
3809
|
+
{
|
|
3810
|
+
"description": "An optional function to execute for its side effects.",
|
|
3811
|
+
"name": "callback"
|
|
3812
|
+
}
|
|
3813
|
+
],
|
|
3814
|
+
"description": "A no-operation function that executes an optional callback.\n\nThis is a lower-level utility function. For preventing tree-shaking of custom elements,\nprefer using avoidTreeShaking which provides a more explicit API.",
|
|
3815
|
+
"privacy": "public"
|
|
3816
|
+
},
|
|
3817
|
+
{
|
|
3818
|
+
"kind": "function",
|
|
3819
|
+
"name": "avoidTreeShaking",
|
|
3820
|
+
"return": {
|
|
3821
|
+
"type": {
|
|
3822
|
+
"text": "void"
|
|
3823
|
+
}
|
|
3824
|
+
},
|
|
3825
|
+
"parameters": [
|
|
3826
|
+
{
|
|
3827
|
+
"name": "callback",
|
|
3828
|
+
"type": {
|
|
3829
|
+
"text": "() => void"
|
|
3830
|
+
},
|
|
3831
|
+
"description": "A function containing code that should not be tree-shaken."
|
|
3832
|
+
}
|
|
3833
|
+
],
|
|
3834
|
+
"description": "Explicitly prevents tree-shaking of code by wrapping it in a function call.\n\nBundlers may incorrectly remove code that it thinks has no side effects,\nsuch as custom element definitions that are only referenced in templates.\nBy wrapping these references in an `avoidTreeShaking` call, we create a side effect\nthat signals to the bundler to preserve the code.",
|
|
3835
|
+
"privacy": "public"
|
|
3836
|
+
}
|
|
3837
|
+
],
|
|
3838
|
+
"exports": [
|
|
3839
|
+
{
|
|
3840
|
+
"kind": "js",
|
|
3841
|
+
"name": "noop",
|
|
3842
|
+
"declaration": {
|
|
3843
|
+
"name": "noop",
|
|
3844
|
+
"module": "src/utils/noop.ts"
|
|
3845
|
+
}
|
|
3846
|
+
},
|
|
3847
|
+
{
|
|
3848
|
+
"kind": "js",
|
|
3849
|
+
"name": "avoidTreeShaking",
|
|
3850
|
+
"declaration": {
|
|
3851
|
+
"name": "avoidTreeShaking",
|
|
3852
|
+
"module": "src/utils/noop.ts"
|
|
3853
|
+
}
|
|
3854
|
+
}
|
|
3855
|
+
]
|
|
3856
|
+
},
|
|
3781
3857
|
{
|
|
3782
3858
|
"kind": "javascript-module",
|
|
3783
3859
|
"path": "src/utils/os-platform.ts",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A no-operation function that executes an optional callback.
|
|
3
|
+
*
|
|
4
|
+
* This is a lower-level utility function. For preventing tree-shaking of custom elements,
|
|
5
|
+
* prefer using {@link avoidTreeShaking} which provides a more explicit API.
|
|
6
|
+
*
|
|
7
|
+
* @param callback - An optional function to execute for its side effects.
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export declare const noop: (fn?: () => void) => void;
|
|
11
|
+
/**
|
|
12
|
+
* Explicitly prevents tree-shaking of code by wrapping it in a function call.
|
|
13
|
+
*
|
|
14
|
+
* Bundlers may incorrectly remove code that it thinks has no side effects,
|
|
15
|
+
* such as custom element definitions that are only referenced in templates.
|
|
16
|
+
* By wrapping these references in an `avoidTreeShaking` call, we create a side effect
|
|
17
|
+
* that signals to the bundler to preserve the code.
|
|
18
|
+
*
|
|
19
|
+
* @param callback - A function containing code that should not be tree-shaken.
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
export declare const avoidTreeShaking: (callback: () => void) => void;
|
|
23
|
+
//# sourceMappingURL=noop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"noop.d.ts","sourceRoot":"","sources":["../../../src/utils/noop.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,IAAI,GAAI,KAAK,MAAM,IAAI,KAAG,IAEtC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,GAAI,UAAU,MAAM,IAAI,KAAG,IAEvD,CAAC"}
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A no-operation function that executes an optional callback.
|
|
3
|
+
*
|
|
4
|
+
* This is a lower-level utility function. For preventing tree-shaking of custom elements,
|
|
5
|
+
* prefer using {@link avoidTreeShaking} which provides a more explicit API.
|
|
6
|
+
*
|
|
7
|
+
* @param callback - An optional function to execute for its side effects.
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export const noop = (fn) => {
|
|
11
|
+
fn === null || fn === void 0 ? void 0 : fn();
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Explicitly prevents tree-shaking of code by wrapping it in a function call.
|
|
15
|
+
*
|
|
16
|
+
* Bundlers may incorrectly remove code that it thinks has no side effects,
|
|
17
|
+
* such as custom element definitions that are only referenced in templates.
|
|
18
|
+
* By wrapping these references in an `avoidTreeShaking` call, we create a side effect
|
|
19
|
+
* that signals to the bundler to preserve the code.
|
|
20
|
+
*
|
|
21
|
+
* @param callback - A function containing code that should not be tree-shaken.
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
export const avoidTreeShaking = (callback) => {
|
|
25
|
+
noop(callback);
|
|
26
|
+
};
|
|
@@ -297,6 +297,47 @@
|
|
|
297
297
|
],
|
|
298
298
|
"name": "assureDesignSystem"
|
|
299
299
|
},
|
|
300
|
+
{
|
|
301
|
+
"kind": "Function",
|
|
302
|
+
"canonicalReference": "@genesislcap/foundation-utils!avoidTreeShaking:function(1)",
|
|
303
|
+
"docComment": "/**\n * Explicitly prevents tree-shaking of code by wrapping it in a function call.\n *\n * Bundlers may incorrectly remove code that it thinks has no side effects, such as custom element definitions that are only referenced in templates. By wrapping these references in an `avoidTreeShaking` call, we create a side effect that signals to the bundler to preserve the code.\n *\n * @param callback - A function containing code that should not be tree-shaken.\n *\n * @public\n */\n",
|
|
304
|
+
"excerptTokens": [
|
|
305
|
+
{
|
|
306
|
+
"kind": "Content",
|
|
307
|
+
"text": "avoidTreeShaking: (callback: "
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
"kind": "Content",
|
|
311
|
+
"text": "() => void"
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
"kind": "Content",
|
|
315
|
+
"text": ") => "
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
"kind": "Content",
|
|
319
|
+
"text": "void"
|
|
320
|
+
}
|
|
321
|
+
],
|
|
322
|
+
"fileUrlPath": "src/utils/noop.ts",
|
|
323
|
+
"returnTypeTokenRange": {
|
|
324
|
+
"startIndex": 3,
|
|
325
|
+
"endIndex": 4
|
|
326
|
+
},
|
|
327
|
+
"releaseTag": "Public",
|
|
328
|
+
"overloadIndex": 1,
|
|
329
|
+
"parameters": [
|
|
330
|
+
{
|
|
331
|
+
"parameterName": "callback",
|
|
332
|
+
"parameterTypeTokenRange": {
|
|
333
|
+
"startIndex": 1,
|
|
334
|
+
"endIndex": 2
|
|
335
|
+
},
|
|
336
|
+
"isOptional": false
|
|
337
|
+
}
|
|
338
|
+
],
|
|
339
|
+
"name": "avoidTreeShaking"
|
|
340
|
+
},
|
|
300
341
|
{
|
|
301
342
|
"kind": "Variable",
|
|
302
343
|
"canonicalReference": "@genesislcap/foundation-utils!BUILDER:var",
|
|
@@ -12257,6 +12298,47 @@
|
|
|
12257
12298
|
],
|
|
12258
12299
|
"name": "mapJsonSchemaFieldToExprBuilderField"
|
|
12259
12300
|
},
|
|
12301
|
+
{
|
|
12302
|
+
"kind": "Function",
|
|
12303
|
+
"canonicalReference": "@genesislcap/foundation-utils!noop:function(1)",
|
|
12304
|
+
"docComment": "/**\n * A no-operation function that executes an optional callback.\n *\n * This is a lower-level utility function. For preventing tree-shaking of custom elements, prefer using {@link avoidTreeShaking} which provides a more explicit API.\n *\n * @param callback - An optional function to execute for its side effects.\n *\n * @public\n */\n",
|
|
12305
|
+
"excerptTokens": [
|
|
12306
|
+
{
|
|
12307
|
+
"kind": "Content",
|
|
12308
|
+
"text": "noop: (fn?: "
|
|
12309
|
+
},
|
|
12310
|
+
{
|
|
12311
|
+
"kind": "Content",
|
|
12312
|
+
"text": "() => void"
|
|
12313
|
+
},
|
|
12314
|
+
{
|
|
12315
|
+
"kind": "Content",
|
|
12316
|
+
"text": ") => "
|
|
12317
|
+
},
|
|
12318
|
+
{
|
|
12319
|
+
"kind": "Content",
|
|
12320
|
+
"text": "void"
|
|
12321
|
+
}
|
|
12322
|
+
],
|
|
12323
|
+
"fileUrlPath": "src/utils/noop.ts",
|
|
12324
|
+
"returnTypeTokenRange": {
|
|
12325
|
+
"startIndex": 3,
|
|
12326
|
+
"endIndex": 4
|
|
12327
|
+
},
|
|
12328
|
+
"releaseTag": "Public",
|
|
12329
|
+
"overloadIndex": 1,
|
|
12330
|
+
"parameters": [
|
|
12331
|
+
{
|
|
12332
|
+
"parameterName": "fn",
|
|
12333
|
+
"parameterTypeTokenRange": {
|
|
12334
|
+
"startIndex": 1,
|
|
12335
|
+
"endIndex": 2
|
|
12336
|
+
},
|
|
12337
|
+
"isOptional": true
|
|
12338
|
+
}
|
|
12339
|
+
],
|
|
12340
|
+
"name": "noop"
|
|
12341
|
+
},
|
|
12260
12342
|
{
|
|
12261
12343
|
"kind": "Class",
|
|
12262
12344
|
"canonicalReference": "@genesislcap/foundation-utils!NumberParser:class",
|
|
@@ -77,6 +77,19 @@ export declare let API_HOST: string;
|
|
|
77
77
|
*/
|
|
78
78
|
export declare function assureDesignSystem(module: DesignSystemModule): DesignSystemModule;
|
|
79
79
|
|
|
80
|
+
/**
|
|
81
|
+
* Explicitly prevents tree-shaking of code by wrapping it in a function call.
|
|
82
|
+
*
|
|
83
|
+
* Bundlers may incorrectly remove code that it thinks has no side effects,
|
|
84
|
+
* such as custom element definitions that are only referenced in templates.
|
|
85
|
+
* By wrapping these references in an `avoidTreeShaking` call, we create a side effect
|
|
86
|
+
* that signals to the bundler to preserve the code.
|
|
87
|
+
*
|
|
88
|
+
* @param callback - A function containing code that should not be tree-shaken.
|
|
89
|
+
* @public
|
|
90
|
+
*/
|
|
91
|
+
export declare const avoidTreeShaking: (callback: () => void) => void;
|
|
92
|
+
|
|
80
93
|
/**
|
|
81
94
|
* @internal
|
|
82
95
|
*/
|
|
@@ -1479,6 +1492,17 @@ string,
|
|
|
1479
1492
|
Genesis.FieldJsonSchema
|
|
1480
1493
|
]): Types.Field | null;
|
|
1481
1494
|
|
|
1495
|
+
/**
|
|
1496
|
+
* A no-operation function that executes an optional callback.
|
|
1497
|
+
*
|
|
1498
|
+
* This is a lower-level utility function. For preventing tree-shaking of custom elements,
|
|
1499
|
+
* prefer using {@link avoidTreeShaking} which provides a more explicit API.
|
|
1500
|
+
*
|
|
1501
|
+
* @param callback - An optional function to execute for its side effects.
|
|
1502
|
+
* @public
|
|
1503
|
+
*/
|
|
1504
|
+
export declare const noop: (fn?: () => void) => void;
|
|
1505
|
+
|
|
1482
1506
|
/**
|
|
1483
1507
|
* @public
|
|
1484
1508
|
*/
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-utils](./foundation-utils.md) > [avoidTreeShaking](./foundation-utils.avoidtreeshaking.md)
|
|
4
|
+
|
|
5
|
+
## avoidTreeShaking() function
|
|
6
|
+
|
|
7
|
+
Explicitly prevents tree-shaking of code by wrapping it in a function call.
|
|
8
|
+
|
|
9
|
+
Bundlers may incorrectly remove code that it thinks has no side effects, such as custom element definitions that are only referenced in templates. By wrapping these references in an `avoidTreeShaking` call, we create a side effect that signals to the bundler to preserve the code.
|
|
10
|
+
|
|
11
|
+
**Signature:**
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
avoidTreeShaking: (callback: () => void) => void
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Parameters
|
|
18
|
+
|
|
19
|
+
<table><thead><tr><th>
|
|
20
|
+
|
|
21
|
+
Parameter
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
</th><th>
|
|
25
|
+
|
|
26
|
+
Type
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
</th><th>
|
|
30
|
+
|
|
31
|
+
Description
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
</th></tr></thead>
|
|
35
|
+
<tbody><tr><td>
|
|
36
|
+
|
|
37
|
+
callback
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
</td><td>
|
|
41
|
+
|
|
42
|
+
() => void
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
</td><td>
|
|
46
|
+
|
|
47
|
+
A function containing code that should not be tree-shaken.
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
</td></tr>
|
|
51
|
+
</tbody></table>
|
|
52
|
+
|
|
53
|
+
**Returns:**
|
|
54
|
+
|
|
55
|
+
void
|
|
56
|
+
|
|
@@ -192,6 +192,19 @@ Description
|
|
|
192
192
|
assureDesignSystem.
|
|
193
193
|
|
|
194
194
|
|
|
195
|
+
</td></tr>
|
|
196
|
+
<tr><td>
|
|
197
|
+
|
|
198
|
+
[avoidTreeShaking(callback)](./foundation-utils.avoidtreeshaking.md)
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
</td><td>
|
|
202
|
+
|
|
203
|
+
Explicitly prevents tree-shaking of code by wrapping it in a function call.
|
|
204
|
+
|
|
205
|
+
Bundlers may incorrectly remove code that it thinks has no side effects, such as custom element definitions that are only referenced in templates. By wrapping these references in an `avoidTreeShaking` call, we create a side effect that signals to the bundler to preserve the code.
|
|
206
|
+
|
|
207
|
+
|
|
195
208
|
</td></tr>
|
|
196
209
|
<tr><td>
|
|
197
210
|
|
|
@@ -542,6 +555,19 @@ Maps fields contained in a JSON schema block enhanced with genesisType metadata
|
|
|
542
555
|
Only sets the properties that are \*required\*. Optional properties, such as `defaultValue`<!-- -->, must be explicitly set by the user separately.
|
|
543
556
|
|
|
544
557
|
|
|
558
|
+
</td></tr>
|
|
559
|
+
<tr><td>
|
|
560
|
+
|
|
561
|
+
[noop(fn)](./foundation-utils.noop.md)
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
</td><td>
|
|
565
|
+
|
|
566
|
+
A no-operation function that executes an optional callback.
|
|
567
|
+
|
|
568
|
+
This is a lower-level utility function. For preventing tree-shaking of custom elements, prefer using [avoidTreeShaking()](./foundation-utils.avoidtreeshaking.md) which provides a more explicit API.
|
|
569
|
+
|
|
570
|
+
|
|
545
571
|
</td></tr>
|
|
546
572
|
<tr><td>
|
|
547
573
|
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-utils](./foundation-utils.md) > [noop](./foundation-utils.noop.md)
|
|
4
|
+
|
|
5
|
+
## noop() function
|
|
6
|
+
|
|
7
|
+
A no-operation function that executes an optional callback.
|
|
8
|
+
|
|
9
|
+
This is a lower-level utility function. For preventing tree-shaking of custom elements, prefer using [avoidTreeShaking()](./foundation-utils.avoidtreeshaking.md) which provides a more explicit API.
|
|
10
|
+
|
|
11
|
+
**Signature:**
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
noop: (fn?: () => void) => void
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Parameters
|
|
18
|
+
|
|
19
|
+
<table><thead><tr><th>
|
|
20
|
+
|
|
21
|
+
Parameter
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
</th><th>
|
|
25
|
+
|
|
26
|
+
Type
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
</th><th>
|
|
30
|
+
|
|
31
|
+
Description
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
</th></tr></thead>
|
|
35
|
+
<tbody><tr><td>
|
|
36
|
+
|
|
37
|
+
fn
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
</td><td>
|
|
41
|
+
|
|
42
|
+
() => void
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
</td><td>
|
|
46
|
+
|
|
47
|
+
_(Optional)_
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
</td></tr>
|
|
51
|
+
</tbody></table>
|
|
52
|
+
|
|
53
|
+
**Returns:**
|
|
54
|
+
|
|
55
|
+
void
|
|
56
|
+
|
|
@@ -35,6 +35,9 @@ export let API_HOST: string;
|
|
|
35
35
|
// @public
|
|
36
36
|
export function assureDesignSystem(module: DesignSystemModule): DesignSystemModule;
|
|
37
37
|
|
|
38
|
+
// @public
|
|
39
|
+
export const avoidTreeShaking: (callback: () => void) => void;
|
|
40
|
+
|
|
38
41
|
// Warning: (ae-internal-missing-underscore) The name "BIG_INT_64_BITS" should be prefixed with an underscore because the declaration is marked as @internal
|
|
39
42
|
//
|
|
40
43
|
// @internal (undocumented)
|
|
@@ -973,6 +976,9 @@ string,
|
|
|
973
976
|
Genesis.FieldJsonSchema
|
|
974
977
|
]): Types.Field | null;
|
|
975
978
|
|
|
979
|
+
// @public
|
|
980
|
+
export const noop: (fn?: () => void) => void;
|
|
981
|
+
|
|
976
982
|
// @public (undocumented)
|
|
977
983
|
export class NumberParser {
|
|
978
984
|
constructor(locale: string);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/foundation-utils",
|
|
3
3
|
"description": "Genesis Foundation Utils",
|
|
4
|
-
"version": "14.
|
|
4
|
+
"version": "14.387.1-alpha-b46a98f.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "SEE LICENSE IN license.txt",
|
|
7
7
|
"main": "dist/esm/index.js",
|
|
@@ -27,18 +27,18 @@
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@genesislcap/foundation-testing": "14.
|
|
31
|
-
"@genesislcap/genx": "14.
|
|
32
|
-
"@genesislcap/rollup-builder": "14.
|
|
33
|
-
"@genesislcap/ts-builder": "14.
|
|
34
|
-
"@genesislcap/uvu-playwright-builder": "14.
|
|
35
|
-
"@genesislcap/vite-builder": "14.
|
|
36
|
-
"@genesislcap/webpack-builder": "14.
|
|
30
|
+
"@genesislcap/foundation-testing": "14.387.1-alpha-b46a98f.0",
|
|
31
|
+
"@genesislcap/genx": "14.387.1-alpha-b46a98f.0",
|
|
32
|
+
"@genesislcap/rollup-builder": "14.387.1-alpha-b46a98f.0",
|
|
33
|
+
"@genesislcap/ts-builder": "14.387.1-alpha-b46a98f.0",
|
|
34
|
+
"@genesislcap/uvu-playwright-builder": "14.387.1-alpha-b46a98f.0",
|
|
35
|
+
"@genesislcap/vite-builder": "14.387.1-alpha-b46a98f.0",
|
|
36
|
+
"@genesislcap/webpack-builder": "14.387.1-alpha-b46a98f.0",
|
|
37
37
|
"@types/json-schema": "^7.0.11"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@genesislcap/expression-builder": "14.
|
|
41
|
-
"@genesislcap/foundation-logger": "14.
|
|
40
|
+
"@genesislcap/expression-builder": "14.387.1-alpha-b46a98f.0",
|
|
41
|
+
"@genesislcap/foundation-logger": "14.387.1-alpha-b46a98f.0",
|
|
42
42
|
"@microsoft/fast-components": "2.30.6",
|
|
43
43
|
"@microsoft/fast-element": "1.14.0",
|
|
44
44
|
"@microsoft/fast-foundation": "2.49.6",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"access": "public"
|
|
57
57
|
},
|
|
58
58
|
"customElements": "dist/custom-elements.json",
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "848ef141b421a6d0a0ac9f1af813493c101d24ba"
|
|
60
60
|
}
|