UNPKG

@roadiehq/catalog-backend-module-okta

Version:

A set of Backstage catalog providers for Okta

21 lines (18 loc) 593 B
'use strict'; class ProfileFieldGroupNamingStrategy { fieldName; constructor(fieldName) { this.fieldName = fieldName; } nameForGroup = (group) => { const groupName = group.profile[this.fieldName]; if (!["number", "string"].includes(typeof groupName)) { throw new Error( `Profile field ${this.fieldName} does not contain a string/number for ${group.profile.name}` ); } return groupName.toString(); }; } exports.ProfileFieldGroupNamingStrategy = ProfileFieldGroupNamingStrategy; //# sourceMappingURL=ProfileFieldGroupNamingStrategy.cjs.js.map