Instance name from environment & About page

This commit is contained in:
ovosimpatico
2024-10-27 01:53:57 -03:00
parent 3417f45186
commit cdf6e274ab
13 changed files with 105 additions and 63 deletions

9
lib/asciiart.js Normal file
View File

@@ -0,0 +1,9 @@
import figlet from 'figlet';
export function generateAsciiArt(text) {
return figlet.textSync(text || process.env.INSTANCE_NAME || 'Myrient', {
font: 'Slant',
horizontalLayout: 'default',
verticalLayout: 'default'
});
}

View File

@@ -11,7 +11,7 @@ export default class Searcher{
}
termProcessor(term){
term = term.toLowerCase()
term = term.toLowerCase()
let stringArray = [term]
stringArray.push(...Searcher.stringBreakout(term))
for(let group in searchAlikes.StringAssoc){
@@ -25,7 +25,7 @@ export default class Searcher{
}
}
return [...new Set(stringArray)]
}
}
static stringBreakout(string){
let symbolRegex = /-|_|\+|=|\)|\(|\[|{|}|]|;|:|"|'|<|>|\.|,|\/|\?|\||\\|!|@|#|\$|%|\^|&|\*/g
@@ -62,7 +62,7 @@ export default class Searcher{
console.error(err)
}
}
async createIndex(fileArr){
if(!this.miniSearch){
this.miniSearch = new MiniSearch({
@@ -157,7 +157,7 @@ export default class Searcher{
else {
//bad result discard
continue
}
}
suggestions.push(`${query}${prediction}`)
continue
}
@@ -178,10 +178,10 @@ export default class Searcher{
else {
//bad result discard
continue
}
}
suggestions.push(`${query}${prediction}`)
continue
}
}
}
let dedupe = [...new Set(suggestions)]
let dedupeLimit = dedupe.length >= 10 ? 10 : dedupe.length
@@ -190,7 +190,7 @@ export default class Searcher{
arr.push({
suggestion: dedupe[x]
})
}
}
return arr
}
}