'use strict' ; import { IsNullOrEmpty , IsNotNullOrEmpty } from '@Tools/Misc' ; export interface VKeyedCollection { [ key ] : any ; } ; export interface VKeyValue { [ key ] : string ; } ; export class SArray { static has ( pArray , pCheck ) { return IsNullOrEmpty ( pArray ) ? false : pArray . includes ( pCheck ) ; } ; static hasNoCase ( pArray , pCheck ) { const pCheckLower = pCheck . toLowerCase ( ) ; if ( IsNotNullOrEmpty ( pArray ) ) { for ( const ent of pArray ) { if ( ent . toLowerCase ( ) === pCheckLower ) { return true ; } ; } } return false ; } ; static add ( pArray , pAdd ) { let added = false ; if ( typeof ( pAdd ) === 'string' ) { if ( ! pArray . includes ( pAdd ) ) { pArray . push ( pAdd ) ; added = true ; } ; } ; return added ; } ; static remove ( pArray , pRemove ) { const idx = pArray . indexOf ( pRemove ) ; if ( idx >= 0 ) { pArray . splice ( idx , 1 ) ; } ; } ; } ;