INNER CODE UNIT · TypeScript

getMax

terrysahaidak/react-native-gallery-toolkit · packages/common/src/vectors.ts:200

  const getMax = (prop: VectorProp) =>
    Math.max.apply(
      void 0,
      vectors.map((item) =>
        _get(_isVector(item) ? item[prop] : item),
      ),
    );

  return {
    x: getMax('x'),
    y: getMax('y'),
  };
};

export const clamp = <T extends Vector<any>>(
  value: T,
  lowerBound: VectorType | SharedValueType,
  upperBound: VectorType | SharedValueType,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…