import { ImportExceptionListItemSchemaDecoded , ImportExceptionListSchemaDecoded , } from '@kbn/securitysolution-io-ts-list-types' ; param exceptions { array } returns { array } export const sortListsImportsByNamespace = ( exceptions ) : [ ImportExceptionListSchemaDecoded [ ] , ImportExceptionListSchemaDecoded [ ] ] => { return exceptions . reduce < [ ImportExceptionListSchemaDecoded [ ] , ImportExceptionListSchemaDecoded [ ] ] > ( ( [ agnostic , single ] , uniqueList ) => { if ( uniqueList . namespace_type === 'agnostic' ) { return [ [ ... agnostic , uniqueList ] , single ] ; } else { return [ agnostic , [ ... single , uniqueList ] ] ; } } , [ [ ] , [ ] ] ) ; } ; param exceptions { array } returns { array } export const sortItemsImportsByNamespace = ( exceptions ) : [ ImportExceptionListItemSchemaDecoded [ ] , ImportExceptionListItemSchemaDecoded [ ] ] => { return exceptions . reduce < [ ImportExceptionListItemSchemaDecoded [ ] , ImportExceptionListItemSchemaDecoded [ ] ] > ( ( [ agnostic , single ] , uniqueList ) => { if ( uniqueList . namespace_type === 'agnostic' ) { return [ [ ... agnostic , uniqueList ] , single ] ; } else { return [ agnostic , [ ... single , uniqueList ] ] ; } } , [ [ ] , [ ] ] ) ; } ;