文件操作 - prepare-tokens.js
返回文件管理
返回主菜单
删除本文件
文件: /var/www/OLD/node_modules/csso/node_modules/css-tree/lib/lexer/prepare-tokens.js
编辑文件内容
import { tokenize } from '../tokenizer/index.js'; const astToTokens = { decorator(handlers) { const tokens = []; let curNode = null; return { ...handlers, node(node) { const tmp = curNode; curNode = node; handlers.node.call(this, node); curNode = tmp; }, emit(value, type, auto) { tokens.push({ type, value, node: auto ? null : curNode }); }, result() { return tokens; } }; } }; function stringToTokens(str) { const tokens = []; tokenize(str, (type, start, end) => tokens.push({ type, value: str.slice(start, end), node: null }) ); return tokens; } export default function(value, syntax) { if (typeof value === 'string') { return stringToTokens(value); } return syntax.generate(value, astToTokens); };
修改文件时间
将文件时间修改为当前时间的前一年
删除文件