diff options
author | bobzel <zzzman@gmail.com> | 2024-05-17 14:55:36 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2024-05-17 14:55:36 -0400 |
commit | 0b451af28e5aef6b749da61e8a9fcd0a840789ac (patch) | |
tree | bdee4e28ee4715b69299a8da1b615c70b6adc445 /src/extensions/Extensions_String.ts | |
parent | 8c1b420a143e4b72ec551277887c211ca6ca003b (diff) | |
parent | 38a382a03675d6a50ec7de75f05025efd093f570 (diff) |
merged with new master
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 }; |