UNPKG

475 BJavaScriptView Raw
1'use strict';
2
3var getIndent = require('./getIndent');
4var 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 */
12function 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
20module.exports = getCurrentIndent;
\No newline at end of file