diff options
author | bobzel <zzzman@gmail.com> | 2024-05-16 23:42:12 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2024-05-16 23:42:12 -0400 |
commit | 99931c4ca423d51555c24533a98e921c83c941e1 (patch) | |
tree | 07baab3cb627eae837c18fb2a6981a746765ec61 /src/extensions/Extensions_String.ts | |
parent | a197d8d37e62235bfa59bc8e3bb74c39381c30a4 (diff) | |
parent | 69e286b504c2f1bbef7d489dc675b9e54ef8d983 (diff) |
Merge branch 'restoringEslint' into eleanor-starter
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 }; |