diff options
author | bobzel <zzzman@gmail.com> | 2024-04-23 18:35:59 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2024-04-23 18:35:59 -0400 |
commit | 9d69ab27de83ead3e499edc9028ba85749407a1e (patch) | |
tree | fb7337fc899549665d6c7634435bc7ce518a58f9 /src/extensions/Extensions_String.ts | |
parent | 9e809f8748d1812bb03ec6471aa6f97467f8f75a (diff) |
more lint cleanup
Diffstat (limited to 'src/extensions/Extensions_String.ts')
-rw-r--r-- | src/extensions/Extensions_String.ts | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/extensions/Extensions_String.ts b/src/extensions/Extensions_String.ts new file mode 100644 index 000000000..c95095f8e --- /dev/null +++ b/src/extensions/Extensions_String.ts @@ -0,0 +1,16 @@ +/* eslint-disable no-extend-native */ +function Assign() { + String.prototype.removeTrailingNewlines = function () { + let sliced = this; + while (sliced.endsWith('\n')) { + sliced = sliced.substring(0, this.length - 1); + } + return sliced as string; + }; + + String.prototype.hasNewline = function () { + return this.endsWith('\n'); + }; +} + +export { Assign }; |