lix-website/themes/lix/assets/bootstrap/node_modules/strip-indent/index.js

15 lines
257 B
JavaScript
Raw Normal View History

2024-04-27 03:39:10 +00:00
'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, '');
};