Skip to content

Commit

Permalink
Isolated IEnumerable interface to just have getEnumerator. IEnumerabl…
Browse files Browse the repository at this point in the history
…eEx has extensions. Provided way to convert IEnumerable to IEnumerableEx.
  • Loading branch information
BSick7 committed Jun 18, 2014
1 parent e2b591a commit e524341
Show file tree
Hide file tree
Showing 31 changed files with 261 additions and 194 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "exjs",
"version": "0.1.8",
"version": "0.1.9",
"homepage": "https://github.com/BSick7/exjs",
"authors": [
"BSick7 <brad.sickles@gmail.com>"
Expand Down
136 changes: 70 additions & 66 deletions dist/ex.d.ts

Large diffs are not rendered by default.

44 changes: 31 additions & 13 deletions dist/ex.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/ex.min.js

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion exjs.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>exjs</id>
<version>0.1.8</version>
<version>0.1.9</version>
<title>exjs</title>
<authors>Brad Sickles</authors>
<licenseUrl>https://raw.githubusercontent.com/BSick7/exjs/master/LICENSE</licenseUrl>
Expand All @@ -29,3 +29,5 @@ This is a lightweight library to aid in data manipulation and transformation.</d





Binary file added nuget/exjs.0.1.9.nupkg
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "exjs",
"version": "0.1.8",
"version": "0.1.9",
"description": "Extension library",
"main": "Gruntfile.js",
"directories": {
Expand Down
2 changes: 1 addition & 1 deletion src/apply.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module exjs {
return e;
}

Enumerable.prototype.apply = function<T>(action: (t: T, index?: number) => void): IEnumerable<T> {
Enumerable.prototype.apply = function<T>(action: (t: T, index?: number) => void): IEnumerableEx<T> {
var e = new Enumerable<T>();
e.getEnumerator = () => applyEnumerator(<IEnumerable<T>>this, action);
return e;
Expand Down
10 changes: 2 additions & 8 deletions src/array.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// <reference path="enumerable.ts" />

interface Array<T> {
en():exjs.IEnumerable<T>;
en(): exjs.IEnumerableEx<T>;
}

module exjs {
Expand Down Expand Up @@ -34,13 +34,7 @@ module exjs {
}
}

export function _<T>(o: any): IEnumerable<T> {
if (o && o instanceof Array)
return new ArrayEnumerable<T>(o);
return new Enumerable<T>();
}

Array.prototype.en = function<T>() {
Array.prototype.en = function<T>(): IEnumerableEx<T> {
if (this && this instanceof Array)
return new ArrayEnumerable<T>(this);
return new Enumerable<T>();
Expand Down
2 changes: 1 addition & 1 deletion src/concat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module exjs {
return e;
}

Enumerable.prototype.concat = function<T>(second:any):IEnumerable<T> {
Enumerable.prototype.concat = function<T>(second:any):IEnumerableEx<T> {
var en:IEnumerable<T> = second instanceof Array ? second.en() : second;
var e = new Enumerable<T>();
e.getEnumerator = () => concatEnumerator<T>(<IEnumerable<T>>this, en);
Expand Down
2 changes: 1 addition & 1 deletion src/distinct.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module exjs {
return e;
}

Enumerable.prototype.distinct = function<T>(comparer?: (f: T, s: T) => boolean): IEnumerable<T> {
Enumerable.prototype.distinct = function<T>(comparer?: (f: T, s: T) => boolean): IEnumerableEx<T> {
var e = new Enumerable<T>();
e.getEnumerator = () => distinctEnumerator(<IEnumerable<T>>this, comparer);
return e;
Expand Down
Loading

0 comments on commit e524341

Please sign in to comment.