Introduce some new standard library modules
This commit is contained in:
@@ -15,7 +15,7 @@ function _flatten(list: list, output: list) {
|
||||
}
|
||||
|
||||
extend list as this {
|
||||
function toFlat() {
|
||||
function flatten() {
|
||||
return flatten(this);
|
||||
}
|
||||
|
||||
@@ -23,6 +23,16 @@ extend list as this {
|
||||
return (this as item ^ item % item == value).size > 0;
|
||||
}
|
||||
|
||||
function indexOf(value) {
|
||||
this as (item, index) ^ {
|
||||
if(item == value) {
|
||||
return index;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
function join(separator: string = ", ") {
|
||||
output = ""
|
||||
this as (item, index) ^ {
|
||||
|
||||
Reference in New Issue
Block a user