Add settings page for managing forecasting API key and URL via UI
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
cae411eae7
commit
1c411e402e
19809 changed files with 1962608 additions and 97 deletions
63
frontend/node_modules/es-toolkit/dist/string/deburr.js
generated
vendored
Normal file
63
frontend/node_modules/es-toolkit/dist/string/deburr.js
generated
vendored
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
//#region src/string/deburr.ts
|
||||
const deburrMap = new Map([
|
||||
["Æ", "Ae"],
|
||||
["Ð", "D"],
|
||||
["Ø", "O"],
|
||||
["Þ", "Th"],
|
||||
["ß", "ss"],
|
||||
["æ", "ae"],
|
||||
["ð", "d"],
|
||||
["ø", "o"],
|
||||
["þ", "th"],
|
||||
["Đ", "D"],
|
||||
["đ", "d"],
|
||||
["Ħ", "H"],
|
||||
["ħ", "h"],
|
||||
["ı", "i"],
|
||||
["IJ", "IJ"],
|
||||
["ij", "ij"],
|
||||
["ĸ", "k"],
|
||||
["Ŀ", "L"],
|
||||
["ŀ", "l"],
|
||||
["Ł", "L"],
|
||||
["ł", "l"],
|
||||
["ʼn", "'n"],
|
||||
["Ŋ", "N"],
|
||||
["ŋ", "n"],
|
||||
["Œ", "Oe"],
|
||||
["œ", "oe"],
|
||||
["Ŧ", "T"],
|
||||
["ŧ", "t"],
|
||||
["ſ", "s"]
|
||||
]);
|
||||
/**
|
||||
* Converts a string by replacing special characters and diacritical marks with their ASCII equivalents.
|
||||
* For example, "Crème brûlée" becomes "Creme brulee".
|
||||
*
|
||||
* @param str - The input string to be deburred.
|
||||
* @returns The deburred string with special characters replaced by their ASCII equivalents.
|
||||
*
|
||||
* @example
|
||||
* // Basic usage:
|
||||
* deburr('Æthelred') // returns 'Aethelred'
|
||||
*
|
||||
* @example
|
||||
* // Handling diacritical marks:
|
||||
* deburr('München') // returns 'Munchen'
|
||||
*
|
||||
* @example
|
||||
* // Special characters:
|
||||
* deburr('Crème brûlée') // returns 'Creme brulee'
|
||||
*/
|
||||
function deburr(str) {
|
||||
str = str.normalize("NFD");
|
||||
let result = "";
|
||||
for (let i = 0; i < str.length; i++) {
|
||||
const char = str[i];
|
||||
if (char >= "̀" && char <= "ͯ" || char >= "︠" && char <= "︣") continue;
|
||||
result += deburrMap.get(char) ?? char;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
//#endregion
|
||||
exports.deburr = deburr;
|
||||
Loading…
Add table
Add a link
Reference in a new issue