mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 12:19:15 +00:00
- Added TypeScript annotation for `ParseResult.program` - Modified the entrypoint for `oxc-parser` to allow wrapping the napi functions - Updated `index.js` to parse the `program` string into a JSON object - Updated tests - Added a dependency on `@oxc/types`
16 lines
585 B
JavaScript
16 lines
585 B
JavaScript
const bindings = require('./bindings.js');
|
|
|
|
module.exports.moduleLexerAsync = bindings.moduleLexerAsync;
|
|
module.exports.moduleLexerSync = bindings.moduleLexerSync;
|
|
module.exports.parseWithoutReturn = bindings.parseWithoutReturn;
|
|
|
|
module.exports.parseAsync = async function parseAsync(...args) {
|
|
const result = await bindings.parseAsync(...args);
|
|
result.program = JSON.parse(result.program);
|
|
return result;
|
|
};
|
|
module.exports.parseSync = function parseSync(...args) {
|
|
const result = bindings.parseSync(...args);
|
|
result.program = JSON.parse(result.program);
|
|
return result;
|
|
};
|