All files / tools/src/stateManagement/annotation/utilities defineProperties.ts

78.57% Statements 11/14
70% Branches 7/10
100% Functions 2/2
78.57% Lines 11/14

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 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27    428x 164x     164x     164x 128x   164x     428x 164x     164x 128x   164x        
import type { Annotation } from '../../../types';
 
const checkAndDefineTextBoxProperty = (annotation: Annotation) => {
  Iif (!annotation.data) {
    annotation.data = {};
  }
  Iif (!annotation.data.handles) {
    annotation.data.handles = {};
  }
  if (!annotation.data.handles.textBox) {
    annotation.data.handles.textBox = {};
  }
  return annotation;
};
 
const checkAndDefineCachedStatsProperty = (annotation: Annotation) => {
  Iif (!annotation.data) {
    annotation.data = {};
  }
  if (!annotation.data.cachedStats) {
    annotation.data.cachedStats = {};
  }
  return annotation;
};
 
export { checkAndDefineTextBoxProperty, checkAndDefineCachedStatsProperty };