All files / packages/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    1x 109x     109x     109x 42x   109x     1x 109x     109x 27x   109x        
import { 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 };