typescript-dotnet-amd
Version:
A JavaScript-Friendly .NET Based TypeScript Library.
6 lines • 2.5 kB
JavaScript
/*!
* @author electricessence / https://github.com/electricessence/
* Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md
*/
define(["require","exports","../Compare","./Array/Utility","./Enumeration/Enumerator","../Types","./CollectionBase","../../extends","./Enumeration/EnumeratorBase"],function(t,e,r,o,n,i,s,u,c){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=u["default"],p=void 0,l=function(t){function e(e,o){void 0===o&&(o=r.areEqual);var n=t.call(this,p,o)||this;return e instanceof Array?n._source=e.slice():(n._source=[],n._importEntries(e)),n}return a(e,t),e.prototype._onDispose=function(){t.prototype._onDispose.call(this),this._source=null},e.prototype.getCount=function(){return this._source.length},e.prototype._addInternal=function(t){return this._source.push(t),!0},e.prototype._removeInternal=function(t,e){return void 0===e&&(e=1/0),o.remove(this._source,t,e,this._equalityComparer)},e.prototype._clearInternal=function(){var t=this._source.length;return this._source.length=0,t},e.prototype._importEntries=function(e){if(i.Type.isArrayLike(e)){var r=e.length;if(!r)return 0;var o=this._source,n=o.length;o.length+=r;for(var s=0;s<r;s++)o[s+n]=e[s];return r}return t.prototype._importEntries.call(this,e)},e.prototype.get=function(t){return this._source[t]},e.prototype.set=function(t,e){var o=this._source;return!(t<o.length&&r.areEqual(e,o[t]))&&(o[t]=e,this._signalModification(!0),!0)},e.prototype.indexOf=function(t){return o.indexOf(this._source,t,this._equalityComparer)},e.prototype.insert=function(t,e){var r=this,o=r._source;t<o.length?r._source.splice(t,0,e):r._source[t]=e,r._signalModification(!0)},e.prototype.removeAt=function(t){return!!o.removeIndex(this._source,t)&&(this._signalModification(!0),!0)},e.prototype.contains=function(t){return o.contains(this._source,t,this._equalityComparer)},e.prototype.copyTo=function(t,e){return o.copyTo(this._source,t,0,e)},e.prototype.getEnumerator=function(){var t=this;t.throwIfDisposed();var e,r,o;return new c.EnumeratorBase(function(){e=t._source,o=t._version,r=0},function(n){if(r)t.throwIfDisposed();else if(t.wasDisposed)return n.yieldBreak();return t.assertVersion(o),r>=e.length?n.yieldBreak():n.yieldReturn(e[r++])})},e.prototype.sort=function(t){return this._source.sort(t),this},e.prototype.forEach=function(t,e){var r=this._source;return n.forEach(e?r.slice():this,t)},e}(s.CollectionBase);e.List=l,e["default"]=l});
//# sourceMappingURL=List.js.map