/usr/share/javascript/yui3/array-invoke/array-invoke-debug.js is in libjs-yui3-debug 3.5.1-1ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | /*
YUI 3.5.1 (build 22)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add('array-invoke', function(Y) {
/**
@module collection
@submodule array-invoke
*/
/**
Executes a named method on each item in an array of objects. Items in the array
that do not have a function by that name will be skipped.
@example
Y.Array.invoke(arrayOfDrags, 'plug', Y.Plugin.DDProxy);
@method invoke
@param {Array} items Array of objects supporting the named method.
@param {String} name the name of the method to execute on each item.
@param {Any} [args*] Any number of additional args are passed as parameters to
the execution of the named method.
@return {Array} All return values, indexed according to the item index.
@static
@for Array
**/
Y.Array.invoke = function(items, name) {
var args = Y.Array(arguments, 2, true),
isFunction = Y.Lang.isFunction,
ret = [];
Y.Array.each(Y.Array(items), function(item, i) {
if (item && isFunction(item[name])) {
ret[i] = item[name].apply(item, args);
}
});
return ret;
};
}, '3.5.1' ,{requires:['yui-base']});
|