Skip to content

Commit

Permalink
update thresholds
Browse files Browse the repository at this point in the history
  • Loading branch information
DMedina6 committed Aug 23, 2024
1 parent 1876eb3 commit ded2e5d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"flat": "^6.0.1",
"form-data": "^4.0.0",
"fs-extra": "^11.1.1",
"fuse.js": "^7.0.0",
"get-installed-path": "^4.0.8",
"htmlparser2": "^9.0.0",
"https": "^1.0.0",
Expand Down
14 changes: 11 additions & 3 deletions src/commands/generate/delta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,10 @@ Process:
else if (matchList.length === 1) {
const result = fuse.search(oldControl.title as string);
// Check score for match

console.log(`oldControl: ${oldControl.title}`)
console.log(result)

if(result[0].score && result[0].score < 0.4 ) {
if(result[0] && result[0].score && result[0].score < 0.6 ) {
//Type guard for map
if (typeof oldControl.tags.gid === 'string' &&
typeof result[0].item.tags.gid === 'string'){
Expand All @@ -347,7 +346,7 @@ Process:
console.log(`oldControl: ${oldControl.title}`)
console.log(result)

if(result[0].score && result[0].score < 0.4) {
if(result[0] && result[0].score && result[0].score < 0.6) {
if ( typeof oldControl.tags.gid === 'string' &&
typeof result[0].item.tags.gid === 'string'){
console.log(`Best match in list: ${oldControl.tags.gid} --> ${result[0].item.tags.gid}\n`);
Expand All @@ -365,4 +364,13 @@ Process:
// JS is pass by reference, probably not necessary
return controlMappings
}

showNonDisplayedCharacters(str: string): string {
return str
.replace(/\n/g, '\\n')
.replace(/\r/g, '\\r')
.replace(/\t/g, '\\t')
.replace(/\f/g, '\\f')
.replace(/\v/g, '\\v');
}
}

0 comments on commit ded2e5d

Please sign in to comment.