lib/utils.js
function extractLiteralFromDef(stats, element) {
    if (validLiteral(element)) {
        stats.setPath(element.value);
        let arrayLiteral = element.value.split('/');
        let length = arrayLiteral.length;
        if (length > 0) {
            const index = validIndex(arrayLiteral);
            stats.setPackageName(arrayLiteral[index].split("$")[0]);
            stats.setVersion(arrayLiteral[index].split("$")[1] || '');
            stats.setFileName(arrayLiteral.splice(index + 1, length).join('/'));
        }
    }
    return stats;
}
function extractLiteralFromDef(stats, element) {
    if (validLiteral(element)) {
        stats.setPath(element.value);
        let arrayLiteral = element.value.split('/');
        let length = arrayLiteral.length;
        if (length > 0) {
            const index = validIndex(arrayLiteral);
            stats.setPackageName(arrayLiteral[index].split("$")[0]);
            stats.setVersion(arrayLiteral[index].split("$")[1] || '');
            stats.setFileName(arrayLiteral.splice(index + 1, length).join('/'));
        }
    }
    return stats;
}
function extractLiteralFromDef ( stats , element ) { if ( validLiteral ( element ) ) { stats . setPath ( element . value ) ; let arrayLiteral = element . value . split ( '/' ) ; let length = arrayLiteral . length ; if ( length > 0 ) { const index = validIndex ( arrayLiteral ) ; stats . setPackageName ( arrayLiteral [ index ] . split ( "$" ) [ 0 ] ) ; stats . setVersion ( arrayLiteral [ index ] . split ( "$" ) [ 1 ] || '' ) ; stats . setFileName ( arrayLiteral . splice ( index + 1 , length ) . join ( '/' ) ) ; } } return stats ; }
Extract packageName, version and fileName from given literal if type = "def".
Extract packageName version and fileName from given literal if type = def .