1.0.6 • Published 5 years ago

@mgmguardiana/linqts v1.0.6

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

linqTS

npm install @mgmguardiana/linqts

Import to your typescript file import {Linq} from '@mgmguardiana/linqts/linq';

Initialize instance and use array objects inside the instance using Linq.create export class SampleModel{ constructor(public province:string,public city:string,public barangay:string){} } export class main{ var arrays= new SampleModel("Batangas","Calaca","Cawong"), new SampleModel("Cavite","Dasmarinas","San Agustin"), new SampleModel("Batangas","Calaca","Dacanlao"), new SampleModel("Batangas","Balayan","Lanatan"), new SampleModel("Batangas","Balayan","Sampaga") ; var linq=Linq.create(arrays);//Linq uses generic, it will detect the type that your array use } Sample functions var orderedByProvinceArrays=linq.orderBy(x=>x.province) .toArray(); var orderByThenArrays=linq.orderBy(x=>x.province) .thenBy(x=>x.city) .thenByDescending(x=>x.barangay) .toArray();

var batangasAreas=linq.where(x=>x.province=="Batangas") .toArray(); }

1.0.6

5 years ago

1.0.5

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago