import { shallowCompare as objectShallowCompare , deepCompare as objectDeepCompare , } from '../object/index' ; let _this = null ; const array = _this = { func desc return return return compareLength : function ( firstArray , secondArray ) : number { return firstArray . length - secondArray . length ; } , shallowCompare : function < T > ( firstArray , secondArray ) : boolean { return objectShallowCompare ( firstArray , secondArray ) ; } , deepCompare : function < T > ( firstArray , secondArray ) : boolean { return objectDeepCompare ( firstArray , secondArray ) ; } , deleteItem : function < T > ( array , value ) : T [ ] { let tempArray = [ ... array ] ; let index = tempArray . indexOf ( value ) ; if ( index !== - 1 ) { tempArray . splice ( index , 1 ) ; } return tempArray ; } , deleteItems : function < T > ( array , value ) : T [ ] { return array . filter ( ( item ) => item !== value ) ; } , deleteItemsExcept : function < T > ( array , exceptArray ) : T [ ] { return array . filter ( value => exceptArray . includes ( value ) ) ; } , map : function ( fn ) : < T > ( array : T [ ] ) => T [ ] { return < T > ( array ) => array . map ( fn ) ; } } ; export default array ; export const compareLength = array . compareLength ; export const shallowCompare = array . shallowCompare ; export const deepCompare = array . deepCompare ; export const deleteItem = array . deleteItem ; export const deleteItems = array . deleteItems ; export const deleteItemsExcept = array . deleteItemsExcept ; export const map = array . map ;