(str)
| 9 | |
| 10 | // Source: https://github.com/sindresorhus/strip-indent |
| 11 | function stripIndent(str) { |
| 12 | var match = str.match(/^[ \t]*(?=\S)/gm); |
| 13 | if (!match) { |
| 14 | return str; |
| 15 | } |
| 16 | |
| 17 | var indent = Math.min.apply(Math, match.map(function (x) { |
| 18 | return x.length; |
| 19 | })); |
| 20 | |
| 21 | if (indent === 0) { |
| 22 | return str; |
| 23 | } |
| 24 | |
| 25 | var re = new RegExp('^[ \\t]{' + indent + '}', 'gm'); |
| 26 | return str.replace(re, ''); |
| 27 | } |
| 28 | |
| 29 | function validate(node) { |
| 30 | var isValid = true; |