Like map_list, but if the mapping function returns an array, concat it to the new...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 26 Jul 2005 14:41:45 +0000 (14:41 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 26 Jul 2005 14:41:45 +0000 (14:41 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1473 dcc99617-32d9-48b4-a31d-7c20da2025e4

Evergreen/staff_client/chrome/content/evergreen/util/functional.js

index df52039..f6d81b1 100644 (file)
@@ -42,6 +42,14 @@ function map_list(list,f) {
        return new_list;
 }
 
+function map_flat_list(list,f) {
+       var new_list = [];
+       for (var i in list) {
+               new_list = new_list.concat( f( list[i] );
+       }
+       return new_list;
+}
+
 function map_object(obj,f) {
        var new_obj = {};
        for (var i in obj) {