import { fromStatic as convertToProvider } from "@smithy/property-provider"; import { Provider } from "@smithy/types"; export type FromStaticConfig = T | (() => T) | Provider; type Getter = (() => T) | Provider; const isFunction = (func: FromStaticConfig): func is Getter => typeof func === "function"; export const fromStatic = (defaultValue: FromStaticConfig): Provider => isFunction(defaultValue) ? async () => await defaultValue() : convertToProvider(defaultValue);