import { SCOPE_PREFIX } from './common' ; export function generateSelector ( namespace ) { return namespace . filter ( findSelector ) . join ( ' ' ) ; } function findSelector ( selector ) { return ! findScope ( selector ) ; } export function generateScope ( namespace ) { const scopes = namespace . filter ( findScope ) ; return scopes [ scopes . length - 1 ] ; } function findScope ( selector ) { return selector . indexOf ( SCOPE_PREFIX ) === 0 ; }