get rid of usages of substr which is deprecated

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2023-01-23 14:20:17 +01:00
parent fc94542b2a
commit 85b04f659a
18 changed files with 37 additions and 21 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ const ondemandMetadata = fs
.reverse()
.map(file => yaml.load(fs.readFileSync(`./data/on-demand/${file}`, 'utf8')));
const truncate = text =>
text.length > 170 ? text.substr(0, 170) + '...' : text;
text.length > 170 ? text.slice(0, 170) + '...' : text;
const addVideoDocsLink = '/docs/overview/support';
const defaultIconUrl = 'img/logo-gradient-on-dark.svg';
+1 -1
View File
@@ -19,7 +19,7 @@ const pluginMetadata = fs
.map(file => yaml.load(fs.readFileSync(`./data/plugins/${file}`, 'utf8')))
.sort((a, b) => a.title.toLowerCase().localeCompare(b.title.toLowerCase()));
const truncate = text =>
text.length > 170 ? text.substr(0, 170) + '...' : text;
text.length > 170 ? text.slice(0, 170) + '...' : text;
const newForDays = 100;