UNPKG

cerevox

Version:

TypeScript SDK for browser automation and secure command execution in highly available and scalable micro computer environments

30 lines 1.04 kB
/** * 代码类型检测工具 * 用于检测 JavaScript/TypeScript/Python 代码类型 * 支持识别 ES 模块、CommonJS 模块和 Python 代码 */ /** * 检测代码类型(ES模块 vs CommonJS vs Python) * @param code - 要检测的代码字符串 * @returns 'esm' 表示ES模块,'cjs' 表示CommonJS,'py' 表示Python, 'sh' 表示Shell脚本 */ export declare function detectCodeType(code: string): 'esm' | 'cjs' | 'py' | 'sh'; /** * 检查代码是否为 ES 模块 * @param code - 要检测的代码字符串 * @returns 是否为 ES 模块 */ export declare function isESModule(code: string): boolean; /** * 检查代码是否为 CommonJS 模块 * @param code - 要检测的代码字符串 * @returns 是否为 CommonJS 模块 */ export declare function isCommonJS(code: string): boolean; /** * 检查代码是否为 Python * @param code - 要检测的代码字符串 * @returns 是否为 Python 代码 */ export declare function isPython(code: string): boolean; //# sourceMappingURL=detect-code.d.ts.map