Sha256: 3331230d0d3f0fbe19e00b337203c458a73eab1878022e5a14a79e06eb0c4a72

Contents?: true

Size: 623 Bytes

Versions: 3

Compression:

Stored size: 623 Bytes

Contents

export default function calculateLocationDisplay(moduleName, loc) {
    let moduleInfo = '';
    if (moduleName) {
        moduleInfo += `'${moduleName}' `;
    }
    if (loc) {
        let { column, line } = loc.start || { line: undefined, column: undefined };
        if (line !== undefined && column !== undefined) {
            if (moduleName) {
                // only prepend @ if the moduleName was present
                moduleInfo += '@ ';
            }
            moduleInfo += `L${line}:C${column}`;
        }
    }
    if (moduleInfo) {
        moduleInfo = `(${moduleInfo}) `;
    }
    return moduleInfo;
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
discourse-ember-source-3.6.0.0 dist/es/ember-template-compiler/lib/system/calculate-location-display.js
discourse-ember-source-3.5.1.1 dist/es/ember-template-compiler/lib/system/calculate-location-display.js
discourse-ember-source-3.5.1.0 dist/dist/es/ember-template-compiler/lib/system/calculate-location-display.js