mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2025-05-24 14:44:45 +00:00
.
This commit is contained in:
parent
fc725ba36b
commit
422b9fdb15
7395 changed files with 1786235 additions and 3476 deletions
30
node_modules/collection-visit/index.js
generated
vendored
Normal file
30
node_modules/collection-visit/index.js
generated
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
/*!
|
||||
* collection-visit <https://github.com/jonschlinkert/collection-visit>
|
||||
*
|
||||
* Copyright (c) 2015, 2017, Jon Schlinkert.
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var visit = require('object-visit');
|
||||
var mapVisit = require('map-visit');
|
||||
|
||||
module.exports = function(collection, method, val) {
|
||||
var result;
|
||||
|
||||
if (typeof val === 'string' && (method in collection)) {
|
||||
var args = [].slice.call(arguments, 2);
|
||||
result = collection[method].apply(collection, args);
|
||||
} else if (Array.isArray(val)) {
|
||||
result = mapVisit.apply(null, arguments);
|
||||
} else {
|
||||
result = visit.apply(null, arguments);
|
||||
}
|
||||
|
||||
if (typeof result !== 'undefined') {
|
||||
return result;
|
||||
}
|
||||
|
||||
return collection;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue