export function createPicker ( fields ) { const wildcards = fields . filter ( ( field ) => field . endsWith ( '.*' ) ) . map ( ( field ) => field . replace ( '*' , '' ) ) ; return ( value , key ) => { return fields . includes ( key ) || wildcards . some ( ( field ) => key . startsWith ( field ) ) ; } ; }