-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
reduced package size fixed some issues improved select, selectmany, todictionary and zip generics
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
node_modules | ||
bower_components | ||
/.vscode | ||
/node_modules | ||
/bower_components |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,13 @@ | ||
Linq4JS.Helper.NonEnumerable("First", function<T> (this: T[], filter?: ((item: T) => boolean) | string): T { | ||
let result = this; | ||
|
||
if (filter != null) { | ||
let result: T[] = this.Where(filter); | ||
result = this.Where(filter); | ||
} | ||
|
||
if (result.Any()) { | ||
return result.Get(0); | ||
} else { | ||
throw new Error("Linq4JS: The First Entry was not found"); | ||
} | ||
if (result.Any()) { | ||
return result.Get(0); | ||
} else { | ||
if (this.Any()) { | ||
return this.Get(0); | ||
} else { | ||
throw new Error("Linq4JS: The First Entry was not found"); | ||
} | ||
throw new Error("Linq4JS: The First Entry was not found"); | ||
} | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,13 @@ | ||
Linq4JS.Helper.NonEnumerable("FirstOrDefault", function<T> (this: T[], filter?: ((item: T) => boolean) | string): (T | null) { | ||
let result = this; | ||
|
||
if (filter != null) { | ||
let result: T[] = this.Where(filter); | ||
result = this.Where(filter); | ||
} | ||
|
||
if (result.Any()) { | ||
return result.Get(0); | ||
} else { | ||
return null; | ||
} | ||
if (result.Any()) { | ||
return result.Get(0); | ||
} else { | ||
if (this.Any()) { | ||
return this.Get(0); | ||
} else { | ||
return null; | ||
} | ||
return null; | ||
} | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,13 @@ | ||
Linq4JS.Helper.NonEnumerable("Last", function<T> (this: T[], filter?: ((item: T) => boolean) | string): T { | ||
let result = this; | ||
|
||
if (filter != null) { | ||
let result: T[] = this.Where(filter); | ||
result = this.Where(filter); | ||
} | ||
|
||
if (result.Any()) { | ||
return result.Get(result.length - 1); | ||
} else { | ||
throw new Error("Linq4JS: The Last Entry was not found"); | ||
} | ||
if (result.Any()) { | ||
return result.Get(result.length - 1); | ||
} else { | ||
if (this.Any()) { | ||
return this.Get(this.length - 1); | ||
} else { | ||
throw new Error("Linq4JS: The Last Entry was not found"); | ||
} | ||
throw new Error("Linq4JS: The Last Entry was not found"); | ||
} | ||
}); | ||
}); |