UNPKG

@carbon/ibm-security

Version:

Carbon for Cloud & Cognitive IBM Security UI components

28 lines (25 loc) 1.04 kB
/** * @file Namespace. * @copyright IBM Security 2018 - 2021 */ import { settings } from 'carbon-components'; var carbonPrefix = settings.prefix; var namespace = 'security--'; /** * Appends the namespace for a component to another namespace. * @param {string} componentNamespace The component namespace to append to. * @param {string} componentName The component namespace to append. * @returns {string} The appended component namespace to return. */ var appendComponentNamespace = function appendComponentNamespace(componentNamespace, componentName) { return "".concat(componentNamespace, "__").concat(componentName); }; /** * Creates the namespace for a component using the global namespace. * @param {string} componentName The component namespace to create. * @returns {string} The component namespace to return. */ var getComponentNamespace = function getComponentNamespace(componentName) { return "".concat(namespace).concat(componentName); }; export { appendComponentNamespace, carbonPrefix, getComponentNamespace };