INNER CODE UNIT · TypeScript

max

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

export const max = (...vectors: VectorList) => {
  'worklet';

  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>>(

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…