ICT30016-Assignment-3/node_modules/strip-indent 2/index.js
dlawler489 a23de4f0dd .
2025-09-16 13:00:57 +10:00

14 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, '');
};