UNPKG

decova-dotnet-developer

Version:

This package provides fundumentals that a .net developer may miss while working with Typescript, whether they are missing functinalities or funcionalities provided in a non-elegant design in javascript. Bad naming, bad design of optional parameters, non-c

105 lines 3.18 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); require("../../x"); const List_1 = require("../List/List"); let proto = Array.prototype; proto.Count = function () { return this.length; }; proto.Select = function (mapper) { return new List_1.List(this).Select(mapper).Array; }; proto.SelectMany = function (func) { return new List_1.List(this).SelectMany(func).Array; }; proto.Sort = function (toSimpleValue) { return new List_1.List(this).Sort(toSimpleValue).Array; }; proto.Reverse = function () { return new List_1.List(this).Array; }; proto.Foreach = function (func) { new List_1.List(this).Foreach(i => func(i)); }; proto.Any = function (func = null) { return new List_1.List(this).Any(func); }; proto.All = function (func) { return new List_1.List(this).All(func); }; proto.IsEmpty = function () { return this.length == 0; }; proto.Add = function (item) { this.push(item); }; proto.EnsureItem = function (item) { new List_1.List(this).EnsureItem(item); }; proto.AddRange = function (items) { new List_1.List(this).AddRange(items); }; proto.Union = function (another) { return new List_1.List(this).Union(another).Array; }; proto.Where = function (func) { return new List_1.List(this).Where(func).Array; }; proto.ItemAt = function (index) { return new List_1.List(this).ItemAt(index); }; proto.IndexOf = function (item) { return new List_1.List(this).IndexOf(item); }; proto.RemoveAt = function (index) { new List_1.List(this).RemoveAt(index); }; proto.RemoveRange = function (index, lenght) { new List_1.List(this).RemoveRange(index, lenght); }; proto.RemoveWhere = function (func) { new List_1.List(this).RemoveWhere(func); }; proto.GetRange = function (index, length = undefined) { return new List_1.List(this).GetRange(index, length).Array; }; proto.Insert = function (index, item) { new List_1.List(this).Insert(index, item); }; proto.InsertRange = function (index, items) { new List_1.List(this).InsertRange(index, items); }; proto.FirstOrDefault = function (func) { return new List_1.List(this).FirstOrDefault(func); }; proto.First = function (func) { return new List_1.List(this).First(func); }; proto.LastOrDefault = function (func = null) { return new List_1.List(this).LastOrDefault(func); }; proto.Last = function (func = null) { return new List_1.List(this).Last(func); }; proto.Skip = function (countToSkip) { return new List_1.List(this).Skip(countToSkip).Array; }; proto.Take = function (countToTake) { return new List_1.List(this).Array; }; proto.Contains = function (obj) { return new List_1.List(this).Contains(obj); }; proto.Distinct = function () { return new List_1.List(this).Distinct().Array; }; proto.Except = function (except) { return new List_1.List(this).Except(except).Array; }; proto.Clone = function () { return new List_1.List(this).Array; }; proto.Intersect = function (otherArray) { return new List_1.List(this).Intersect(otherArray).Array; }; //# sourceMappingURL=Array.x.js.map