From 136d895d155f28c2e75b3af206549acaa2a354ed Mon Sep 17 00:00:00 2001 From: Philip Molares Date: Mon, 15 Feb 2021 09:42:51 +0100 Subject: Linter: Fix all lint errors Signed-off-by: Philip Molares --- public/js/utils.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'public/js/utils.js') diff --git a/public/js/utils.js b/public/js/utils.js index 91e7f133..d42a18e7 100644 --- a/public/js/utils.js +++ b/public/js/utils.js @@ -1,9 +1,9 @@ import base64url from 'base64url' -let uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i +const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i export function checkNoteIdValid (id) { - let result = id.match(uuidRegex) + const result = id.match(uuidRegex) if (result && result.length === 1) { return true } else { @@ -13,16 +13,16 @@ export function checkNoteIdValid (id) { export function encodeNoteId (id) { // remove dashes in UUID and encode in url-safe base64 - let str = id.replace(/-/g, '') - let hexStr = Buffer.from(str, 'hex') + const str = id.replace(/-/g, '') + const hexStr = Buffer.from(str, 'hex') return base64url.encode(hexStr) } export function decodeNoteId (encodedId) { // decode from url-safe base64 - let id = base64url.toBuffer(encodedId).toString('hex') + const id = base64url.toBuffer(encodedId).toString('hex') // add dashes between the UUID string parts - let idParts = [] + const idParts = [] idParts.push(id.substr(0, 8)) idParts.push(id.substr(8, 4)) idParts.push(id.substr(12, 4)) -- cgit v1.2.3