From 22e9d64c41a8a1e76253255499d650d39f8b0148 Mon Sep 17 00:00:00 2001 From: phasefx Date: Tue, 26 Jul 2005 14:41:45 +0000 Subject: [PATCH] Like map_list, but if the mapping function returns an array, concat it to the new list git-svn-id: svn://svn.open-ils.org/ILS/trunk@1473 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../chrome/content/evergreen/util/functional.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Evergreen/staff_client/chrome/content/evergreen/util/functional.js b/Evergreen/staff_client/chrome/content/evergreen/util/functional.js index df52039e2b..f6d81b128c 100644 --- a/Evergreen/staff_client/chrome/content/evergreen/util/functional.js +++ b/Evergreen/staff_client/chrome/content/evergreen/util/functional.js @@ -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) { -- 2.43.2