文件操作 - sample.js
返回文件管理
返回主菜单
删除本文件
文件: /usr/share/nodejs/lodash-es/sample.js
编辑文件内容
import arraySample from './_arraySample.js'; import baseSample from './_baseSample.js'; import isArray from './isArray.js'; /** Detect free variable `globalThis` */ const freeGlobalThis = typeof globalThis == 'object' && globalThis !== null && globalThis.Object == Object && globalThis; /** * Gets a random element from `collection`. * * @static * @memberOf _ * @since 2.0.0 * @category Collection * @param {Array|Object} collection The collection to sample. * @returns {*} Returns the random element. * @example * * _.sample([1, 2, 3, 4]); * // => 2 */ function sample(collection) { var func = isArray(collection) ? arraySample : baseSample; return func(collection); } export default sample;
修改文件时间
将文件时间修改为当前时间的前一年
删除文件