export function getProvider()

in src/lib/util/utils.ts [389:404]


export function getProvider(path: string) {
  if (path === null || path === undefined || typeof path.valueOf() !== "string" || !path.trim().length) {
    throw new Error("path is a required parameter of type string and it cannot be an empty string.")
  }

  const providerRegEx = new RegExp("/providers/(:?[^{/]+)", "gi")
  let result
  let pathMatch

  // Loop over the paths to find the last matched provider namespace
  while ((pathMatch = providerRegEx.exec(path)) != null) {
    result = pathMatch[1]
  }

  return result
}