文件操作 - stringifyComment.js
返回文件管理
返回主菜单
删除本文件
文件: /var/www/OLD/node_modules/yaml/browser/dist/stringify/stringifyComment.js
编辑文件内容
/** * Stringifies a comment. * * Empty comment lines are left empty, * lines consisting of a single space are replaced by `#`, * and all other lines are prefixed with a `#`. */ const stringifyComment = (str) => str.replace(/^(?!$)(?: $)?/gm, '#'); function indentComment(comment, indent) { if (/^\n+$/.test(comment)) return comment.substring(1); return indent ? comment.replace(/^(?! *$)/gm, indent) : comment; } const lineComment = (str, indent, comment) => str.endsWith('\n') ? indentComment(comment, indent) : comment.includes('\n') ? '\n' + indentComment(comment, indent) : (str.endsWith(' ') ? '' : ' ') + comment; export { indentComment, lineComment, stringifyComment };
修改文件时间
将文件时间修改为当前时间的前一年
删除文件