import { basename , extname } from 'path' ; export function isGzip ( path ) { return extname ( path ) === '.gz' ; } param { String } path return { Boolean } export function isMappingFile ( path ) { return basename ( path , '.gz' ) === 'mappings.json' ; } param { Array < String > } filenames return { Array < String > } export function prioritizeMappings ( filenames ) { return filenames . slice ( ) . sort ( ( fa , fb ) => { if ( isMappingFile ( fa ) === isMappingFile ( fb ) ) return 0 ; return isMappingFile ( fb ) ? 1 : - 1 ; } ) ; }