CJVT updates August and September 2026

This commit is contained in:
Luka Romih
2026-10-01 00:49:26 +02:00
parent fd02e25719
commit 83f73aeb58
135 changed files with 6146 additions and 1970 deletions
+13
View File
@@ -22,6 +22,19 @@ exports.removeHtmlTags = text => {
return tagFilter.process(text)
}
// Escapes Postgres LIKE metacharacters (\, %, _) in a raw search string so
// it's matched literally rather than as a LIKE pattern - e.g. a user
// searching for a dictionary literally named "100%" gets that dictionary,
// not every dictionary. Backslash must be escaped first, or the escapes
// added for % and _ below would themselves get re-escaped.
//
// Wildcard search (*, ?), if ever added: translate user-facing '*' -> '%'
// and '?' -> '_' AFTER calling this function, on its return value - that
// way literal %, _, and \ in the search text stay literal while the
// user's own * and ? become real SQL wildcards.
exports.escapeLikePattern = value =>
value.replace(/\\/g, '\\\\').replace(/%/g, '\\%').replace(/_/g, '\\_')
// Returns setting value by its name from table instance_settings.
exports.getInstanceSetting = async settingName => {
const settingCacheName = `${INSTANCE_SETTING_NAMESPACE}:${settingName}`