@ff-labs/fff-node 0.11.0 → 0.11.1-nightly.266cde1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -445,6 +445,7 @@ var FFF_SCORE_STRUCT = {
445
445
  distance_penalty: DataType.I32,
446
446
  current_file_penalty: DataType.I32,
447
447
  combo_match_boost: DataType.I32,
448
+ path_alignment_bonus: DataType.I32,
448
449
  exact_match: DataType.U8,
449
450
  match_type: DataType.External
450
451
  };
@@ -518,8 +519,8 @@ var FFF_GREP_MATCH_STRUCT = {
518
519
  match_ranges_count: DataType.U32,
519
520
  context_before_count: DataType.U32,
520
521
  context_after_count: DataType.U32,
521
- fuzzy_score: DataType.U32,
522
- // actually u16 in C, but ffi-rs doesn't so we read it as u32 with padding
522
+ fuzzy_score: DataType.I16,
523
+ // u16 in C; ffi-rs has no U16, so read I16 and mask (#888)
523
524
  has_fuzzy_score: DataType.U8,
524
525
  is_binary: DataType.U8,
525
526
  is_definition: DataType.U8
@@ -560,6 +561,7 @@ function readScoreFromRaw(raw) {
560
561
  distancePenalty: raw.distance_penalty,
561
562
  currentFilePenalty: raw.current_file_penalty,
562
563
  comboMatchBoost: raw.combo_match_boost,
564
+ pathAlignmentBonus: raw.path_alignment_bonus,
563
565
  exactMatch: raw.exact_match !== 0,
564
566
  matchType: readCString(raw.match_type) ?? ""
565
567
  };
@@ -660,7 +662,7 @@ function readGrepMatchFromRaw(raw) {
660
662
  matchRanges
661
663
  };
662
664
  if (raw.has_fuzzy_score !== 0) {
663
- match.fuzzyScore = raw.fuzzy_score;
665
+ match.fuzzyScore = raw.fuzzy_score & 65535;
664
666
  }
665
667
  if (raw.context_before_count > 0) {
666
668
  match.contextBefore = readCStringArray(raw.context_before, raw.context_before_count);