From 24f9f38cb058c12c10ac0cd43e7824ff514e9f7b Mon Sep 17 00:00:00 2001 From: Tobias Speicher Date: Tue, 22 Mar 2022 09:57:56 +0100 Subject: [PATCH] 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 --- src/proto.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/proto.ts b/src/proto.ts index 3eba5ca..3a81424 100644 --- a/src/proto.ts +++ b/src/proto.ts @@ -98,7 +98,7 @@ export function jsonTemplate(message: protobuf.Type): any { // Returns obj.fullName without the first period. export function fullName(obj: protobuf.ReflectionObject) { - return obj.fullName[0] === '.' ? obj.fullName.substr(1) : obj.fullName; + return obj.fullName[0] === '.' ? obj.fullName.slice(1) : obj.fullName; } export const typeName = (obj: protobuf.ReflectionObject): string => {