@jossmac/lil-libs
    Preparing search index...

    Function populatedKeys

    • Like typedKeys, but narrows the return type to a non-empty tuple. Throws if the object has no own enumerable keys.

      • T extends object
      • value: T

        Object that must have at least one own enumerable key.

      Same keys as typedKeys, narrowed to a non-empty tuple type.

      const obj = { foo: 1, bar: "hello" };
      const keys = populatedKeys(obj);
      // ^? ["foo" | "bar", ...("foo" | "bar")[]]

      populatedKeys({}); // throws "Object has no keys."

      When value has no own enumerable keys.