Sha256: 985c7e8885ffc3fba110be4fbdf74833d8e5c7d87f4d0648f80da1159aebd2e8

Contents?: true

Size: 455 Bytes

Versions: 5

Compression:

Stored size: 455 Bytes

Contents

module.exports = {
    getLocation: function(index, inputStream) {
        var n = index + 1,
            line = null,
            column = -1;

        while (--n >= 0 && inputStream.charAt(n) !== '\n') {
            column++;
        }

        if (typeof index === 'number') {
            line = (inputStream.slice(0, index).match(/\n/g) || "").length;
        }

        return {
            line: line,
            column: column
        };
    }
};

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
ilog-0.4.1 node_modules/less/lib/less/utils.js
ilog-0.4.0 node_modules/less/lib/less/utils.js
ilog-0.3.3 node_modules/less/lib/less/utils.js
less-execjs-2.6.0.4 lib/less/js/less/lib/less/utils.js
less-execjs-2.6.0.3 lib/less/js/less/lib/less/utils.js