elearning/Frontend-Learner/node_modules/eslint-plugin-import-x/lib/utils/get-value.js

15 lines
437 B
JavaScript
Raw Normal View History

2026-01-13 10:46:40 +07:00
import { TSESTree } from '@typescript-eslint/types';
export const getValue = (node) => {
switch (node.type) {
case TSESTree.AST_NODE_TYPES.Identifier: {
return node.name;
}
case TSESTree.AST_NODE_TYPES.Literal: {
return node.value;
}
default: {
throw new Error(`Unsupported node type: ${node.type}`);
}
}
};
//# sourceMappingURL=get-value.js.map