mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-25 01:45:15 +00:00
15 lines
257 B
JavaScript
15 lines
257 B
JavaScript
'use strict';
|
|
const minIndent = require('min-indent');
|
|
|
|
module.exports = string => {
|
|
const indent = minIndent(string);
|
|
|
|
if (indent === 0) {
|
|
return string;
|
|
}
|
|
|
|
const regex = new RegExp(`^[ \\t]{${indent}}`, 'gm');
|
|
|
|
return string.replace(regex, '');
|
|
};
|