mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 17:35:10 +03:00
refactor: replace deprecated String.prototype.substr()
.substr() is deprecated 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:
3 files changed
+5
-4
No files matched your search
+1
-1
@@ -15,7 +15,7 @@ const Home = ({ user }) => {
|
||||
* Read more on https://supabase.com/docs/reference/javascript/reset-password-email#notes
|
||||
*/
|
||||
let url = window.location.hash;
|
||||
let query = url.substr(1);
|
||||
let query = url.slice(1);
|
||||
let result = {};
|
||||
|
||||
query.split("&").forEach((part) => {
|
||||
|
||||
@@ -101,8 +101,9 @@ function convertArgumentTypes(value: string) {
|
||||
if (isEmpty(value) || !items || items?.length == 0) return { value: [] }
|
||||
const temp = items.map((x) => {
|
||||
const str = x.trim()
|
||||
const name = str.substr(0, str.indexOf(' '))
|
||||
const type = str.substr(str.indexOf(' ') + 1)
|
||||
const space = str.indexOf(' ')
|
||||
const name = str.slice(0, space !== 1 ? space : 0)
|
||||
const type = str.slice(space + 1)
|
||||
return { name, type }
|
||||
})
|
||||
return { value: temp }
|
||||
|
||||
@@ -34,7 +34,7 @@ const PageConfig = () => {
|
||||
let rpcs: any = {}
|
||||
|
||||
Object.entries(paths || []).forEach(([name, val]) => {
|
||||
let trimmed = name.substr(1)
|
||||
let trimmed = name.slice(1)
|
||||
let id = trimmed.replace(functionPath, '')
|
||||
let displayName = id.replace(/_/g, ' ')
|
||||
let camelCase = snakeToCamel(id)
|
||||
|
||||
Reference in new issue
Block a user