From 755ee333d06391ffa011c6323f2695594836413e Mon Sep 17 00:00:00 2001 From: CommanderRoot Date: Wed, 23 Mar 2022 15:31:25 +0100 Subject: [PATCH] refactor: replace deprecated String.prototype.substr() (#2187) --- packages/hoppscotch-app/components/profile/Picture.vue | 2 +- packages/hoppscotch-app/helpers/oauth.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/hoppscotch-app/components/profile/Picture.vue b/packages/hoppscotch-app/components/profile/Picture.vue index 8bae61172..27af19686 100644 --- a/packages/hoppscotch-app/components/profile/Picture.vue +++ b/packages/hoppscotch-app/components/profile/Picture.vue @@ -74,7 +74,7 @@ export default defineComponent({ let color = "#" for (let i = 0; i < 3; i++) { const value = (hash >> (i * 8)) & 255 - color += `00${value.toString(16)}`.substr(-2) + color += `00${value.toString(16)}`.slice(-2) } return color }, diff --git a/packages/hoppscotch-app/helpers/oauth.js b/packages/hoppscotch-app/helpers/oauth.js index 6a317d4d2..83cae8c3e 100644 --- a/packages/hoppscotch-app/helpers/oauth.js +++ b/packages/hoppscotch-app/helpers/oauth.js @@ -88,7 +88,7 @@ const getTokenConfiguration = async (endpoint) => { const generateRandomString = () => { const array = new Uint32Array(28) window.crypto.getRandomValues(array) - return Array.from(array, (dec) => `0${dec.toString(16)}`.substr(-2)).join("") + return Array.from(array, (dec) => `0${dec.toString(16)}`.slice(-2)).join("") } /**