infrastructure-components
Version:
Infrastructure-Components configure the infrastructure of your React-App as part of your React-Components.
24 lines • 885 B
JavaScript
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const route_component_1 = __importDefault(require("../route/route-component"));
exports.SECUREDSERVICE_INSTANCE_TYPE = "SecuredServiceComponent";
/**
* The SecuredRoute takes the same arguments as the Route!
*
* @param props
*/
exports.default = (props) => {
return Object.assign(props, route_component_1.default(props), {
// we overwrite the type
instanceType: exports.SECUREDSERVICE_INSTANCE_TYPE,
isSecured: true
});
};
exports.isSecuredService = (component) => {
return component !== undefined &&
component.instanceType === exports.SECUREDSERVICE_INSTANCE_TYPE;
};
//# sourceMappingURL=securedservice-component.js.map
;