Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(dset): Add merge function typing and add JSDoc documentation for dset and dset/merge #45

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Commits on Apr 3, 2024

  1. Add typing for merge

    Includes type definitions to handle deep merging of nested objects and overwriting arrays.
    
    The types ensure that primitive values from the second argument (U) overwrite those in the first (T), while arrays are replaced entirely, not merged element-wise.
    
    Example:
    
    ```typescript
    const obj1 = { a: { b: [1, 2] }, c: null, d: "jaja" };
    const obj2 = { a: { b: [3, 4], c: [5, 6] } };
    
    const result = merge(obj1, obj2);
    // const result: {
    //   a: {
    //     c: number[];
    //     b: number[];
    //   };
    //   c: null;
    //   d: string;
    // }
    ```
    aidarkhanov committed Apr 3, 2024
    Configuration menu
    Copy the full SHA
    931b0ed View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    71319c9 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    849b1b6 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    26b7994 View commit details
    Browse the repository at this point in the history