# All files / src/Grid Grid.utils.ts

100% Statements 9/9
100% Branches 4/4
100% Functions 2/2
100% Lines 6/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    115x
    6x

    18x
    18x
    18x

    6x

     export const overrideIfNotDefined = <T>(blueprint: T, obj: Partial<T>): T => {
      const result = {} as T

      Object.entries(blueprint).forEach(([key, value]) => {
        const key_ = key as keyof T
        result[key_] = obj[key_] ?? value
      })

      return result
    }