From 64f5c82c8c565396c8b2099e192e89c03525809d Mon Sep 17 00:00:00 2001 From: monoid Date: Sat, 16 Jan 2021 21:36:54 +0900 Subject: [PATCH] replace substr to slice --- src/client/component/contentinfo.tsx | 2 +- src/client/component/tagchip.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/component/contentinfo.tsx b/src/client/component/contentinfo.tsx index 3e90593..de8452a 100644 --- a/src/client/component/contentinfo.tsx +++ b/src/client/component/contentinfo.tsx @@ -97,7 +97,7 @@ export const ContentInfo = (props: { const subinfoContainer = props.short ? classes.short_subinfoContainer : classes.subinfoContainer; let allTag = document.tags; - const artists = allTag.filter(x => x.startsWith("artist:")).map(x => x.substr(7)); + const artists = allTag.filter(x => x.startsWith("artist:")).map(x => x.slice(7)); allTag = allTag.filter(x => !x.startsWith("artist:")); return ( & {tagname: string})=>{ let newlabel:string|undefined = undefined; if(typeof label === "string"){ if(label.startsWith("female:")){ - newlabel ="♀ "+label.substr(7); + newlabel ="♀ "+label.slice(7); } else if(label.startsWith("male:")){ - newlabel = "♂ "+label.substr(5); + newlabel = "♂ "+label.slice(5); } } return ;