ts-data-forge
    Preparing search index...

    Function deepOmit

    • Deeply omits a nested property from an object along the specified key path. Supports both direct and curried usage.

      Type Parameters

      • const R extends UnknownRecord

        The type of the input record

      • const Path extends readonly (string | number)[]

        The key path tuple

      Parameters

      • record: R

        The source record

      • path: Path

        A readonly tuple of keys representing the nested path to omit

      Returns DeepOmit<R, Path>

      A new record with the nested property at the path removed

      const data = { a: { b: { c: 1, d: 2 }, e: 3 }, f: 4 } as const;

      // Direct usage
      const result = Obj.deepOmit(data, ['a', 'b', 'c']);
      assert.deepStrictEqual(result, { a: { b: { d: 2 }, e: 3 }, f: 4 });

      // Curried usage with pipe
      const omitPassword = Obj.deepOmit(['user', 'password']);
      const result2 = pipe(data).map(omitPassword).value;
    • Deeply omits a nested property from an object along the specified key path. Supports both direct and curried usage.

      Type Parameters

      • const Path extends readonly (string | number)[]

        The key path tuple

      Parameters

      • path: Path

        A readonly tuple of keys representing the nested path to omit

      Returns <const R extends UnknownRecord>(record: R) => DeepOmit<R, Path>

      A new record with the nested property at the path removed

      const data = { a: { b: { c: 1, d: 2 }, e: 3 }, f: 4 } as const;

      // Direct usage
      const result = Obj.deepOmit(data, ['a', 'b', 'c']);
      assert.deepStrictEqual(result, { a: { b: { d: 2 }, e: 3 }, f: 4 });

      // Curried usage with pipe
      const omitPassword = Obj.deepOmit(['user', 'password']);
      const result2 = pipe(data).map(omitPassword).value;