Hugging Face
Models
Datasets
Spaces
Posts
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
Duplicated from
huggingchat/chat-ui
nirdrang
/
chat-ui
like
0
Build error
App
Files
Files
Community
9c038aa
chat-ui
/
src
/
lib
/
utils
/
trimSuffix.ts
coyotte508
HF staff
✨ Remove endoftext (#70)
0abf663
unverified
over 1 year ago
raw
Copy download link
history
blame
Safe
165 Bytes
export
function
trimSuffix
(
input:
string
, end:
string
):
string
{
if
(input.
endsWith
(end)) {
return
input.
slice
(
0
, input.
length
- end.
length
);
}
return
input;
}