root / trunk / web / dojo / dojox / lang / functional / zip.js @ 13
History | View | Annotate | Download (696 Bytes)
1 |
/*
|
---|---|
2 |
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
|
3 |
Available via Academic Free License >= 2.1 OR the modified BSD license.
|
4 |
see: http://dojotoolkit.org/license for details
|
5 |
*/
|
6 |
|
7 |
|
8 |
if(!dojo._hasResource["dojox.lang.functional.zip"]){ |
9 |
dojo._hasResource["dojox.lang.functional.zip"]=true; |
10 |
dojo.provide("dojox.lang.functional.zip");
|
11 |
(function(){
|
12 |
var df=dojox.lang.functional;
|
13 |
dojo.mixin(df,{zip:function(){ |
14 |
var n=arguments[0].length,m=arguments.length,i=1,t=new Array(n),j,p; |
15 |
for(;i<m;n=Math.min(n,arguments[i++].length)){ |
16 |
} |
17 |
for(i=0;i<n;++i){ |
18 |
p=new Array(m);
|
19 |
for(j=0;j<m;p[j]=arguments[j][i],++j){ |
20 |
} |
21 |
t[i]=p; |
22 |
} |
23 |
return t;
|
24 |
},unzip:function(a){ |
25 |
return df.zip.apply(null,a); |
26 |
}}); |
27 |
})(); |
28 |
} |