INNER CODE UNIT · TypeScript

isEmptyKey

vercel/storage · packages/global-config/src/utils/index.ts:42

export function isEmptyKey(key: string): boolean {
  return key.trim() === '';
}

export function assertIsKeys(keys: unknown): asserts keys is string[] {
  if (!Array.isArray(keys) || keys.some((key) => typeof key !== 'string')) {
    throw new Error(
      '@vercel/global-config: Expected keys to be an array of string',
    );
  }
}

/**
 * Creates a deep clone of an object.
 */
export const clone = trace(
  function clone<T>(value: T): T {
    // only available since node v17.0.0

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…