<commit_before>/** @internal Applies CSS prefixes to appropriate style keys.*/
export function applyCssPrefixes(target) {
  for (let key in target) {

    let value = target[key];

    switch (key) {
      case 'display':
        target['display'] = value;
        // also need 'display : -webkit-box' and 'display : -ms-flexbox;'
        break;

      case 'flex':
        target['-ms-flex'] = value;
        target['-webkit-box-flex'] = value.split(" ")[0];
        break;

      case 'flex-direction':
        value = value || "row";
        target['flex-direction'] = value;
        target['-ms-flex-direction'] = value;
        target['-webkit-box-orient'] = toBoxOrient(value);
        target['-webkit-box-direction'] = toBoxDirection(value);
        break;

      case 'flex-wrap':
        target['-ms-flex-wrap'] = value;
        break;

      case 'order':
        if ( isNaN(value) ) {
          value = "0";
        }
        target['order'] = value;
        target['-ms-flex-order'] = value;
        target['-webkit-box-ordinal-group'] = toBoxOrdinal(value);
        break;

      case 'justify-content':
        target['-ms-flex-pack'] = toBoxValue(value);
        target['-webkit-box-pack'] = toBoxValue(value);
        break;

      case 'align-items':
        target['-ms-flex-align'] =  toBoxValue(value);
        target['-webkit-box-align'] = toBoxValue(value);
        break;

      case 'align-self':
        target['-ms-flex-item-align'] =  toBoxValue(value);
        break;

      case 'align-content':
        target['-ms-flex-line-pack'] =  toBoxValue(value);
        break;
    }
  }
  return target;
}

/** @internal Convert flex values flex-start, flex-end to start, end. */
export function toBoxValue(value:string = "") {
  return (value == 'flex-start') ? 'start' : ((value == 'flex-end') ? 'end' : value);
}

/** @internal Convert flex Direction to Box orientation */
export function toBoxOrient(flexDirection = 'row') {
  return flexDirection.indexOf('column') === -1 ? 'horizontal' : 'vertical';
}

/** @internal Convert flex Direction to Box direction type */
export function toBoxDirection(flexDirection = 'row') {

  return flexDirection.indexOf('reverse')  !== -1 ? 'reverse' : 'normal';
}

/** @internal Convert flex order to Box ordinal group */
export function  toBoxOrdinal(order = '0') {
  let value = order ? parseInt(order) + 1 : 1;
  return isNaN(value) ? "0" : value.toString();
}
<commit_msg>fix(layout-align): add prefixers for align-content<commit_after>/** @internal Applies CSS prefixes to appropriate style keys.*/
export function applyCssPrefixes(target) {
  for (let key in target) {

    let value = target[key];

    switch (key) {
      case 'display':
        target['display'] = value;
        // also need 'display : -webkit-box' and 'display : -ms-flexbox;'
        break;

      case 'flex':
        target['-ms-flex'] = value;
        target['-webkit-box-flex'] = value.split(" ")[0];
        break;

      case 'flex-direction':
        value = value || "row";
        target['flex-direction'] = value;
        target['-ms-flex-direction'] = value;
        target['-webkit-box-orient'] = toBoxOrient(value);
        target['-webkit-box-direction'] = toBoxDirection(value);
        break;

      case 'flex-wrap':
        target['-ms-flex-wrap'] = value;
        break;

      case 'order':
        if ( isNaN(value) ) {
          value = "0";
        }
        target['order'] = value;
        target['-ms-flex-order'] = value;
        target['-webkit-box-ordinal-group'] = toBoxOrdinal(value);
        break;

      case 'justify-content':
        target['-ms-flex-pack'] = toBoxValue(value);
        target['-webkit-box-pack'] = toBoxValue(value);
        break;

      case 'align-items':
        target['-ms-flex-align'] =  toBoxValue(value);
        target['-webkit-box-align'] = toBoxValue(value);
        break;

      case 'align-self':
        target['-ms-flex-item-align'] =  toBoxValue(value);
        break;

      case 'align-content':
        target['-ms-align-content'] = toAlignContentValue(value);
        target['-ms-flex-line-pack'] =  toAlignContentValue(value);
        break;
    }
  }
  return target;
}

export function  toAlignContentValue(value:string) {
  switch(value) {
    case "space-between" : return "justify";
    case "space-around"  : return "distribute";
    default :
      return toBoxValue(value);
  }
}

/** @internal Convert flex values flex-start, flex-end to start, end. */
export function toBoxValue(value:string = "") {
  return (value == 'flex-start') ? 'start' : ((value == 'flex-end') ? 'end' : value);
}

/** @internal Convert flex Direction to Box orientation */
export function toBoxOrient(flexDirection = 'row') {
  return flexDirection.indexOf('column') === -1 ? 'horizontal' : 'vertical';
}

/** @internal Convert flex Direction to Box direction type */
export function toBoxDirection(flexDirection = 'row') {

  return flexDirection.indexOf('reverse')  !== -1 ? 'reverse' : 'normal';
}

/** @internal Convert flex order to Box ordinal group */
export function  toBoxOrdinal(order = '0') {
  let value = order ? parseInt(order) + 1 : 1;
  return isNaN(value) ? "0" : value.toString();
}

{'fraction_non_alphanumeric': 0.1627281460134486, 'fraction_numerical': 0.003073967339097022, 'mean_word_length': 2.645658263305322, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '643266', 'n_tokens_mistral': 1622, 'n_tokens_neox': 1587, 'n_words': 371}