Sha256: 52a8d34114cbcd647fcc8a237cb854f7352d8d7fa47214d24264f14d40294647
Contents?: true
Size: 320 Bytes
Versions: 35
Compression:
Stored size: 320 Bytes
Contents
'use strict'; module.exports = function (str) { var match = str.match(/^[ \t]*(?=\S)/gm); if (!match) { return str; } var indent = Math.min.apply(Math, match.map(function (el) { return el.length; })); var re = new RegExp('^[ \\t]{' + indent + '}', 'gm'); return indent > 0 ? str.replace(re, '') : str; };
Version data entries
35 entries across 34 versions & 15 rubygems