@embeddable.com/sdk-utils 0.8.0-next.0 → 0.8.1-next.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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const getComponentLibraryConfig: (componentLibrary: string | ComponentLibraryConfig) => {
|
|
2
2
|
libraryName: string;
|
|
3
|
-
include: string[];
|
|
3
|
+
include: string[] | undefined;
|
|
4
4
|
exclude: string[];
|
|
5
5
|
};
|
|
6
6
|
export declare const EXTERNAL_LIBRARY_META_FILE_NAME = "embeddable-components.json";
|
package/lib/index.esm.js
CHANGED
|
@@ -4316,12 +4316,12 @@ const loadJson = async (filePath) => {
|
|
|
4316
4316
|
|
|
4317
4317
|
const getComponentLibraryConfig = (componentLibrary) => {
|
|
4318
4318
|
let libraryName = componentLibrary;
|
|
4319
|
-
|
|
4319
|
+
let include;
|
|
4320
4320
|
const exclude = [];
|
|
4321
4321
|
if (typeof componentLibrary === "object" && componentLibrary !== null) {
|
|
4322
4322
|
libraryName = componentLibrary.name;
|
|
4323
4323
|
if (componentLibrary.include) {
|
|
4324
|
-
include
|
|
4324
|
+
include = [...componentLibrary.include];
|
|
4325
4325
|
}
|
|
4326
4326
|
if (componentLibrary.exclude) {
|
|
4327
4327
|
exclude.push(...componentLibrary.exclude);
|
|
@@ -4336,7 +4336,7 @@ const getComponentLibraryMeta = async (ctx, componentLibrary) => {
|
|
|
4336
4336
|
const libraryMeta = (await loadJson(getLibraryPath(ctx, libraryName, EXTERNAL_LIBRARY_META_FILE_NAME)));
|
|
4337
4337
|
const filterItems = (items) => {
|
|
4338
4338
|
let result = items;
|
|
4339
|
-
if (include
|
|
4339
|
+
if (include) {
|
|
4340
4340
|
result = result.filter((item) => include.includes(item));
|
|
4341
4341
|
}
|
|
4342
4342
|
return result.filter((item) => !exclude.includes(item));
|