文件操作 - _createFind.js
返回文件管理
返回主菜单
删除本文件
文件: /usr/share/nodejs/lodash-es/_createFind.js
编辑文件内容
import baseIteratee from './_baseIteratee.js'; import isArrayLike from './isArrayLike.js'; import keys from './keys.js'; /** Detect free variable `globalThis` */ const freeGlobalThis = typeof globalThis == 'object' && globalThis !== null && globalThis.Object == Object && globalThis; /** * Creates a `_.find` or `_.findLast` function. * * @private * @param {Function} findIndexFunc The function to find the collection index. * @returns {Function} Returns the new find function. */ function createFind(findIndexFunc) { return function(collection, predicate, fromIndex) { var iterable = Object(collection); if (!isArrayLike(collection)) { var iteratee = baseIteratee(predicate, 3); collection = keys(collection); predicate = function(key) { return iteratee(iterable[key], key, iterable); }; } var index = findIndexFunc(collection, predicate, fromIndex); return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; }; } export default createFind;
修改文件时间
将文件时间修改为当前时间的前一年
删除文件