mirror of
https://codeberg.org/Kankys/NewLukasBlog.git
synced 2026-11-11 14:14:36 +01:00
refactor
This commit is contained in:
1 parent
fc2547bd59
commit
231006e61d
2143 files changed
No files matched your search
-14
@@ -1,14 +0,0 @@
|
||||
export default function stripFinalNewline(input) {
|
||||
const LF = typeof input === 'string' ? '\n' : '\n'.charCodeAt();
|
||||
const CR = typeof input === 'string' ? '\r' : '\r'.charCodeAt();
|
||||
|
||||
if (input[input.length - 1] === LF) {
|
||||
input = input.slice(0, -1);
|
||||
}
|
||||
|
||||
if (input[input.length - 1] === CR) {
|
||||
input = input.slice(0, -1);
|
||||
}
|
||||
|
||||
return input;
|
||||
}
|
||||
Reference in new issue
Block a user