mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-02 18:11:04 +08:00
Bug: none Change-Id: I9389834400d90beed8df9f28356720031abe9ef1 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6225902 Commit-Queue: Benedikt Meurer <bmeurer@chromium.org> Auto-Submit: Nikolay Vitkov <nvitkov@chromium.org> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
29 lines
665 B
JavaScript
29 lines
665 B
JavaScript
import { walk } from 'css-tree';
|
|
import Atrule from './Atrule.js';
|
|
import Comment from './Comment.js';
|
|
import Declaration from './Declaration.js';
|
|
import Raw from './Raw.js';
|
|
import Rule from './Rule.js';
|
|
import TypeSelector from './TypeSelector.js';
|
|
import WhiteSpace from './WhiteSpace.js';
|
|
|
|
const handlers = {
|
|
Atrule,
|
|
Comment,
|
|
Declaration,
|
|
Raw,
|
|
Rule,
|
|
TypeSelector,
|
|
WhiteSpace
|
|
};
|
|
|
|
export default function(ast, options) {
|
|
walk(ast, {
|
|
leave(node, item, list) {
|
|
if (handlers.hasOwnProperty(node.type)) {
|
|
handlers[node.type].call(this, node, item, list, options);
|
|
}
|
|
}
|
|
});
|
|
};
|