mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-27 10:32:58 +02:00
294cc4a440
Co-authored-by: Laurent Cozic <laurent22@users.noreply.github.com> Co-authored-by: Henry Heino <46334387+personalizedrefrigerator@users.noreply.github.com>
322 B
322 B
let str = ` hello world ! `;
let _trim = function () {
if (typeof this == "number") new Error("Invalid or unexpected token");
if (typeof this !== "string")
new Error("Cannot read property 'trim' of" + this);
let reg = /^\s*|\s*$/g;
return this.replace(reg, "");
};
String.prototype._trim = _trim;