mirror of
https://git.joinfirefish.org/firefish/firefish.git
synced 2024-05-18 10:51:11 +02:00
refactor (minor): replace substr with substring
This commit is contained in:
parent
15ddde2431
commit
9df08ea16a
|
@ -306,7 +306,7 @@ export default abstract class Chart<T extends Schema> {
|
|||
k.startsWith(columnPrefix),
|
||||
) as (keyof Columns<T>)[]) {
|
||||
kvs[
|
||||
(k as string).substr(columnPrefix.length).split(columnDot).join(".")
|
||||
(k as string).substring(columnPrefix.length).split(columnDot).join(".")
|
||||
] = x[k];
|
||||
}
|
||||
return kvs as KVs<T>;
|
||||
|
|
|
@ -27,11 +27,11 @@
|
|||
<p class="name">
|
||||
<span>{{
|
||||
file.name.lastIndexOf(".") != -1
|
||||
? file.name.substr(0, file.name.lastIndexOf("."))
|
||||
? file.name.substring(0, file.name.lastIndexOf("."))
|
||||
: file.name
|
||||
}}</span>
|
||||
<span v-if="file.name.lastIndexOf('.') != -1" class="ext">{{
|
||||
file.name.substr(file.name.lastIndexOf("."))
|
||||
file.name.substring(file.name.lastIndexOf("."))
|
||||
}}</span>
|
||||
</p>
|
||||
</div>
|
||||
|
|
|
@ -45,7 +45,7 @@ const ce = computed(() => props.customEmojis ?? instance.emojis ?? []);
|
|||
const customEmoji = computed(() =>
|
||||
isCustom.value
|
||||
? ce.value.find(
|
||||
(x) => x.name === props.emoji.substr(1, props.emoji.length - 2),
|
||||
(x) => x.name === props.emoji.substring(1, props.emoji.length - 1),
|
||||
)
|
||||
: null,
|
||||
);
|
||||
|
|
|
@ -98,7 +98,7 @@ onMounted(() => {
|
|||
connection.on("stats", onStats);
|
||||
connection.on("statsLog", onStatsLog);
|
||||
connection.send("requestLog", {
|
||||
id: Math.random().toString().substr(2, 8),
|
||||
id: Math.random().toString().substring(2, 10),
|
||||
length: 100,
|
||||
});
|
||||
});
|
||||
|
|
|
@ -82,7 +82,7 @@ os.api("admin/ad/list").then((adsResponse) => {
|
|||
ads.value = adsResponse;
|
||||
// The date format should be changed to yyyy-MM-dd in order to be properly displayed
|
||||
for (const i in ads.value) {
|
||||
ads.value[i].expiresAt = ads.value[i].expiresAt.substr(0, 10);
|
||||
ads.value[i].expiresAt = ads.value[i].expiresAt.substring(0, 10);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -128,7 +128,7 @@ onMounted(() => {
|
|||
connection.on("stats", onStats);
|
||||
connection.on("statsLog", onStatsLog);
|
||||
connection.send("requestLog", {
|
||||
id: Math.random().toString().substr(2, 8),
|
||||
id: Math.random().toString().substring(2, 10),
|
||||
length: 200,
|
||||
});
|
||||
});
|
||||
|
|
|
@ -212,7 +212,7 @@ connection.on("stats", onStats);
|
|||
connection.on("statsLog", onStatsLog);
|
||||
|
||||
connection.send("requestLog", {
|
||||
id: Math.random().toString().substr(2, 8),
|
||||
id: Math.random().toString().substring(2, 10),
|
||||
length: 1,
|
||||
});
|
||||
|
||||
|
|
|
@ -112,7 +112,7 @@ onMounted(() => {
|
|||
props.connection.on("stats", onStats);
|
||||
props.connection.on("statsLog", onStatsLog);
|
||||
props.connection.send("requestLog", {
|
||||
id: Math.random().toString().substr(2, 8),
|
||||
id: Math.random().toString().substring(2, 10),
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ onMounted(() => {
|
|||
props.connection.on("stats", onStats);
|
||||
props.connection.on("statsLog", onStatsLog);
|
||||
props.connection.send("requestLog", {
|
||||
id: Math.random().toString().substr(2, 8),
|
||||
id: Math.random().toString().substring(2, 10),
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -47,8 +47,8 @@ export class Parser extends EventEmitter {
|
|||
if (root.length !== 2) continue;
|
||||
|
||||
// remove event and data markers
|
||||
const event: string = root[0].substr(7);
|
||||
const data: string = root[1].substr(6);
|
||||
const event: string = root[0].substring(7);
|
||||
const data: string = root[1].substring(6);
|
||||
|
||||
let jsonObj = {};
|
||||
try {
|
||||
|
|
Loading…
Reference in a new issue