文件操作 - utils.js
返回文件管理
返回主菜单
删除本文件
文件: /var/www/OLD/node_modules/expand-brackets/lib/utils.js
编辑文件内容
'use strict'; var toRegex = require('to-regex'); var regexNot = require('regex-not'); var cached; /** * Get the last element from `array` * @param {Array} `array` * @return {*} */ exports.last = function(arr) { return arr[arr.length - 1]; }; /** * Create and cache regex to use for text nodes */ exports.createRegex = function(pattern, include) { if (cached) return cached; var opts = {contains: true, strictClose: false}; var not = regexNot.create(pattern, opts); var re; if (typeof include === 'string') { re = toRegex('^(?:' + include + '|' + not + ')', opts); } else { re = toRegex(not, opts); } return (cached = re); };
修改文件时间
将文件时间修改为当前时间的前一年
删除文件