文件操作 - resolve-end.js
返回文件管理
返回主菜单
删除本文件
文件: /var/www/OLD/node_modules/yaml/dist/compose/resolve-end.js
编辑文件内容
'use strict'; function resolveEnd(end, offset, reqSpace, onError) { let comment = ''; if (end) { let hasSpace = false; let sep = ''; for (const token of end) { const { source, type } = token; switch (type) { case 'space': hasSpace = true; break; case 'comment': { if (reqSpace && !hasSpace) onError(token, 'MISSING_CHAR', 'Comments must be separated from other tokens by white space characters'); const cb = source.substring(1) || ' '; if (!comment) comment = cb; else comment += sep + cb; sep = ''; break; } case 'newline': if (comment) sep += source; hasSpace = true; break; default: onError(token, 'UNEXPECTED_TOKEN', `Unexpected ${type} at node end`); } offset += source.length; } } return { comment, offset }; } exports.resolveEnd = resolveEnd;
修改文件时间
将文件时间修改为当前时间的前一年
删除文件