packages/master-tasks/tasks/srcmap.js
function getCodeFromNode(node, renameSources, options) {
    const code_map = getCodeMap(node);
    const rename = renameSources;
    const objMap = code_map.map.toJSON();
    let i, n;

    if (rename) {
        if ('string' === typeof rename) {
            for (i = 0, n = objMap.sources.length; i < n; i++) {
                objMap.sources[i] = rename + objMap.sources[i];
            }
        } else if ('function' === typeof rename) {
            for (i = 0, n = objMap.sources.length; i < n; i++) {
                objMap.sources[i] = rename(objMap.sources[i]);
            }
        } else {
            console.warn('unexpected type of rename: ' + typeof rename);
        }
    }

    return node.toString() +
        convert.fromObject(objMap)
            .toComment(options)
            .replace(/charset=utf-8;/gm, '')
            .replace('data:application/json;', 'data:application/json;charset=utf-8;') + '\n';
}
function getCodeFromNode(node, renameSources, options) {
    const code_map = getCodeMap(node);
    const rename = renameSources;
    const objMap = code_map.map.toJSON();
    let i, n;

    if (rename) {
        if ('string' === typeof rename) {
            for (i = 0, n = objMap.sources.length; i < n; i++) {
                objMap.sources[i] = rename + objMap.sources[i];
            }
        } else if ('function' === typeof rename) {
            for (i = 0, n = objMap.sources.length; i < n; i++) {
                objMap.sources[i] = rename(objMap.sources[i]);
            }
        } else {
            console.warn('unexpected type of rename: ' + typeof rename);
        }
    }

    return node.toString() +
        convert.fromObject(objMap)
            .toComment(options)
            .replace(/charset=utf-8;/gm, '')
            .replace('data:application/json;', 'data:application/json;charset=utf-8;') + '\n';
}
function getCodeFromNode ( node , renameSources , options ) { const code_map = getCodeMap ( node ) ; const rename = renameSources ; const objMap = code_map . map . toJSON ( ) ; let i , n ; if ( rename ) { if ( 'string' === typeof rename ) { for ( i = 0 , n = objMap . sources . length ; i < n ; i ++ ) { objMap . sources [ i ] = rename + objMap . sources [ i ] ; } } else if ( 'function' === typeof rename ) { for ( i = 0 , n = objMap . sources . length ; i < n ; i ++ ) { objMap . sources [ i ] = rename ( objMap . sources [ i ] ) ; } } else { console . warn ( 'unexpected type of rename: ' + typeof rename ) ; } } return node . toString ( ) + convert . fromObject ( objMap ) . toComment ( options ) . replace ( / charset=utf-8; / gm , '' ) . replace ( 'data:application/json;' , 'data:application/json;charset=utf-8;' ) + '\n' ; }
get code with inline-source-map from file SourceNode
get code with inline - source - map from file SourceNode