1 | ;
|
2 |
|
3 | var getIndent = require('./getIndent');
|
4 | var getCurrentCode = require('./getCurrentCode');
|
5 |
|
6 | /**
|
7 | * Detect indentation in the current code block
|
8 | * @param {Options} opts
|
9 | * @param {State} state
|
10 | * @return {String}
|
11 | */
|
12 | function getCurrentIndent(opts, state) {
|
13 | var currentCode = getCurrentCode(opts, state);
|
14 | var text = currentCode.getTexts().map(function (t) {
|
15 | return t.text;
|
16 | }).join('\n');
|
17 | return getIndent(text);
|
18 | }
|
19 |
|
20 | module.exports = getCurrentIndent; |
\ | No newline at end of file |