Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function simplify(templates: string[]): string[] {
if (!isValid(templates)) {
throw new InvalidScopeError("One of the provided templates is invalid.");
}
// We are bypassing the default exports of @authx/scopes which ensure the
// validity of passed scopes. This is undocumented behavior, but by far the
// simplest approach to acheiving simplification with a characterset beyond
// those allowed by the scope spec.
return unsafeSimplify(templates);
}