diff --git a/package-lock.json b/package-lock.json index 4853777..d4ca1e0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "foris", - "version": "5.1.7", + "version": "5.1.8", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index d36bbe4..ad465c7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "foris", - "version": "5.1.7", + "version": "5.1.8", "description": "Set of components and utils for Foris and its plugins.", "author": "CZ.NIC, z.s.p.o.", "repository": { diff --git a/src/index.js b/src/index.js index 651fdf9..3107c2d 100644 --- a/src/index.js +++ b/src/index.js @@ -70,6 +70,7 @@ export { ErrorMessage } from "./utils/ErrorMessage"; export { useClickOutside } from "./utils/hooks"; export { toLocaleDateString } from "./utils/datetime"; export { displayCard } from "./utils/displayCard"; +export { isPluginInstalled } from "./utils/isPluginInstalled"; // Foris URL export { ForisURLs, REFORIS_URL_PREFIX } from "./utils/forisUrls"; diff --git a/src/utils/isPluginInstalled.js b/src/utils/isPluginInstalled.js new file mode 100644 index 0000000..8193c99 --- /dev/null +++ b/src/utils/isPluginInstalled.js @@ -0,0 +1,9 @@ +/* + * Copyright (C) 2020 CZ.NIC z.s.p.o. (http://www.nic.cz/) + * + * This is free software, licensed under the GNU General Public License v3. + * See /LICENSE for more information. + */ + +export const isPluginInstalled = (pluginName) => + ForisPlugins.some((plugin) => plugin.name === pluginName);