1
0
Fork 0
mirror of synced 2024-06-26 18:10:51 +12:00

Replace deprecated String.prototype.substr()

String.prototype.substr() is deprecated (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr) so we replace it with slice() which works similarily but isn't deprecated.
Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
This commit is contained in:
Tobias Speicher 2022-02-20 15:28:39 +01:00
parent 59a2e0c108
commit 9d25f26791
No known key found for this signature in database
GPG key ID: 2CF824BD810C3BDB
5 changed files with 5 additions and 5 deletions

View file

@ -60,7 +60,7 @@ export const createNotificationStore = () => {
}
function id() {
return "_" + Math.random().toString(36).substr(2, 9)
return "_" + Math.random().toString(36).slice(2, 9)
}
export const notifications = createNotificationStore()

View file

@ -68,7 +68,7 @@
})
function id() {
return "_" + Math.random().toString(36).substr(2, 9)
return "_" + Math.random().toString(36).slice(2, 9)
}
</script>

View file

@ -11,7 +11,7 @@
import { users } from "stores/portal"
const [email, error, touched] = createValidationStore("", emailValidator)
const password = Math.random().toString(36).substr(2, 20)
const password = Math.random().toString(36).slice(2, 20)
let builder = false,
admin = false

View file

@ -7,7 +7,7 @@
export let user
const password = Math.random().toString(36).substr(2, 20)
const password = Math.random().toString(36).slice(2, 20)
async function resetPassword() {
try {

View file

@ -51,7 +51,7 @@ function extractPaths(apidocJson) {
// Surrounds URL parameters with curly brackets -> :email with {email}
let pathKeys = []
for (let j = 1; j < matches.length; j++) {
let key = matches[j].substr(1)
let key = matches[j].slice(1)
url = url.replace(matches[j], "{" + key + "}")
pathKeys.push(key)
}