tiny-dedent
Version:
A Tiny module for stripping indentation from multi-line strings
8 lines (7 loc) • 544 B
JavaScript
/*!
* tiny-dedent v1.0.2 (https://github.com/victornpb/tiny-dedent)
* Copyright (c) victornpb
* @license MIT
*/
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).S=n()}(this,(function(){"use strict";return function(e){e=e.replace(/^[ \t]*\r?\n/,"");var n=/^[ \t]+/m.exec(e);return n&&(e=e.replace(new RegExp("^"+n[0],"gm"),"")),e.replace(/(\r?\n)[ \t]+$/,"$1")}}));
//# sourceMappingURL=dedent.js.map