oxc-parser 0.75.0 → 0.75.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -0
- package/bindings.js +0 -3
- package/generated/deserialize/js.js +287 -287
- package/generated/deserialize/ts.js +300 -300
- package/index.d.ts +0 -68
- package/index.js +0 -1
- package/package.json +17 -17
package/index.d.ts
CHANGED
|
@@ -113,14 +113,6 @@ export declare const enum ExportLocalNameKind {
|
|
|
113
113
|
None = 'None'
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
/**
|
|
117
|
-
* Get offset within a `Uint8Array` which is aligned on 4 GiB.
|
|
118
|
-
*
|
|
119
|
-
* Does not check that the offset is within bounds of `buffer`.
|
|
120
|
-
* To ensure it always is, provide a `Uint8Array` of at least 4 GiB size.
|
|
121
|
-
*/
|
|
122
|
-
export declare function getBufferOffset(buffer: Uint8Array): number
|
|
123
|
-
|
|
124
116
|
export interface ImportName {
|
|
125
117
|
kind: ImportNameKind
|
|
126
118
|
name?: string
|
|
@@ -144,38 +136,6 @@ export declare const enum ImportNameKind {
|
|
|
144
136
|
*/
|
|
145
137
|
export declare function parseAsync(filename: string, sourceText: string, options?: ParserOptions | undefined | null): Promise<ParseResult>
|
|
146
138
|
|
|
147
|
-
/**
|
|
148
|
-
* Parse AST into provided `Uint8Array` buffer, asynchronously.
|
|
149
|
-
*
|
|
150
|
-
* Note: This function can be slower than `parseSyncRaw` due to the overhead of spawning a thread.
|
|
151
|
-
*
|
|
152
|
-
* Source text must be written into the start of the buffer, and its length (in UTF-8 bytes)
|
|
153
|
-
* provided as `source_len`.
|
|
154
|
-
*
|
|
155
|
-
* This function will parse the source, and write the AST into the buffer, starting at the end.
|
|
156
|
-
*
|
|
157
|
-
* It also writes to the very end of the buffer the offset of `Program` within the buffer.
|
|
158
|
-
*
|
|
159
|
-
* Caller can deserialize data from the buffer on JS side.
|
|
160
|
-
*
|
|
161
|
-
* # SAFETY
|
|
162
|
-
*
|
|
163
|
-
* Caller must ensure:
|
|
164
|
-
* * Source text is written into start of the buffer.
|
|
165
|
-
* * Source text's UTF-8 byte length is `source_len`.
|
|
166
|
-
* * The 1st `source_len` bytes of the buffer comprises a valid UTF-8 string.
|
|
167
|
-
* * Contents of buffer must not be mutated by caller until the `AsyncTask` returned by this
|
|
168
|
-
* function resolves.
|
|
169
|
-
*
|
|
170
|
-
* If source text is originally a JS string on JS side, and converted to a buffer with
|
|
171
|
-
* `Buffer.from(str)` or `new TextEncoder().encode(str)`, this guarantees it's valid UTF-8.
|
|
172
|
-
*
|
|
173
|
-
* # Panics
|
|
174
|
-
*
|
|
175
|
-
* Panics if source text is too long, or AST takes more memory than is available in the buffer.
|
|
176
|
-
*/
|
|
177
|
-
export declare function parseAsyncRaw(filename: string, buffer: Uint8Array, sourceLen: number, options?: ParserOptions | undefined | null): Promise<unknown>
|
|
178
|
-
|
|
179
139
|
export interface ParserOptions {
|
|
180
140
|
/** Treat the source text as `js`, `jsx`, `ts`, or `tsx`. */
|
|
181
141
|
lang?: 'js' | 'jsx' | 'ts' | 'tsx'
|
|
@@ -220,34 +180,6 @@ export interface ParserOptions {
|
|
|
220
180
|
/** Parse synchronously. */
|
|
221
181
|
export declare function parseSync(filename: string, sourceText: string, options?: ParserOptions | undefined | null): ParseResult
|
|
222
182
|
|
|
223
|
-
/**
|
|
224
|
-
* Parse AST into provided `Uint8Array` buffer, synchronously.
|
|
225
|
-
*
|
|
226
|
-
* Source text must be written into the start of the buffer, and its length (in UTF-8 bytes)
|
|
227
|
-
* provided as `source_len`.
|
|
228
|
-
*
|
|
229
|
-
* This function will parse the source, and write the AST into the buffer, starting at the end.
|
|
230
|
-
*
|
|
231
|
-
* It also writes to the very end of the buffer the offset of `Program` within the buffer.
|
|
232
|
-
*
|
|
233
|
-
* Caller can deserialize data from the buffer on JS side.
|
|
234
|
-
*
|
|
235
|
-
* # SAFETY
|
|
236
|
-
*
|
|
237
|
-
* Caller must ensure:
|
|
238
|
-
* * Source text is written into start of the buffer.
|
|
239
|
-
* * Source text's UTF-8 byte length is `source_len`.
|
|
240
|
-
* * The 1st `source_len` bytes of the buffer comprises a valid UTF-8 string.
|
|
241
|
-
*
|
|
242
|
-
* If source text is originally a JS string on JS side, and converted to a buffer with
|
|
243
|
-
* `Buffer.from(str)` or `new TextEncoder().encode(str)`, this guarantees it's valid UTF-8.
|
|
244
|
-
*
|
|
245
|
-
* # Panics
|
|
246
|
-
*
|
|
247
|
-
* Panics if source text is too long, or AST takes more memory than is available in the buffer.
|
|
248
|
-
*/
|
|
249
|
-
export declare function parseSyncRaw(filename: string, buffer: Uint8Array, sourceLen: number, options?: ParserOptions | undefined | null): void
|
|
250
|
-
|
|
251
183
|
/** Returns `true` if raw transfer is supported on this platform. */
|
|
252
184
|
export declare function rawTransferSupported(): boolean
|
|
253
185
|
|
package/index.js
CHANGED
|
@@ -11,7 +11,6 @@ module.exports.ExportExportNameKind = bindings.ExportExportNameKind;
|
|
|
11
11
|
module.exports.ExportImportNameKind = bindings.ExportImportNameKind;
|
|
12
12
|
module.exports.ExportLocalNameKind = bindings.ExportLocalNameKind;
|
|
13
13
|
module.exports.ImportNameKind = bindings.ImportNameKind;
|
|
14
|
-
module.exports.parseWithoutReturn = bindings.parseWithoutReturn;
|
|
15
14
|
module.exports.Severity = bindings.Severity;
|
|
16
15
|
|
|
17
16
|
module.exports.parseSync = parseSync;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oxc-parser",
|
|
3
|
-
"version": "0.75.
|
|
3
|
+
"version": "0.75.1",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"browser": "wasm.mjs",
|
|
6
6
|
"engines": {
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"access": "public"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@oxc-project/types": "^0.75.
|
|
52
|
+
"@oxc-project/types": "^0.75.1"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@codspeed/vitest-plugin": "^4.0.0",
|
|
@@ -89,21 +89,21 @@
|
|
|
89
89
|
"dtsHeaderFile": "header.js"
|
|
90
90
|
},
|
|
91
91
|
"optionalDependencies": {
|
|
92
|
-
"@oxc-parser/binding-win32-x64-msvc": "0.75.
|
|
93
|
-
"@oxc-parser/binding-win32-arm64-msvc": "0.75.
|
|
94
|
-
"@oxc-parser/binding-linux-x64-gnu": "0.75.
|
|
95
|
-
"@oxc-parser/binding-linux-x64-musl": "0.75.
|
|
96
|
-
"@oxc-parser/binding-freebsd-x64": "0.75.
|
|
97
|
-
"@oxc-parser/binding-linux-arm64-gnu": "0.75.
|
|
98
|
-
"@oxc-parser/binding-linux-arm64-musl": "0.75.
|
|
99
|
-
"@oxc-parser/binding-linux-arm-gnueabihf": "0.75.
|
|
100
|
-
"@oxc-parser/binding-linux-arm-musleabihf": "0.75.
|
|
101
|
-
"@oxc-parser/binding-linux-s390x-gnu": "0.75.
|
|
102
|
-
"@oxc-parser/binding-linux-riscv64-gnu": "0.75.
|
|
103
|
-
"@oxc-parser/binding-darwin-x64": "0.75.
|
|
104
|
-
"@oxc-parser/binding-darwin-arm64": "0.75.
|
|
105
|
-
"@oxc-parser/binding-android-arm64": "0.75.
|
|
106
|
-
"@oxc-parser/binding-wasm32-wasi": "0.75.
|
|
92
|
+
"@oxc-parser/binding-win32-x64-msvc": "0.75.1",
|
|
93
|
+
"@oxc-parser/binding-win32-arm64-msvc": "0.75.1",
|
|
94
|
+
"@oxc-parser/binding-linux-x64-gnu": "0.75.1",
|
|
95
|
+
"@oxc-parser/binding-linux-x64-musl": "0.75.1",
|
|
96
|
+
"@oxc-parser/binding-freebsd-x64": "0.75.1",
|
|
97
|
+
"@oxc-parser/binding-linux-arm64-gnu": "0.75.1",
|
|
98
|
+
"@oxc-parser/binding-linux-arm64-musl": "0.75.1",
|
|
99
|
+
"@oxc-parser/binding-linux-arm-gnueabihf": "0.75.1",
|
|
100
|
+
"@oxc-parser/binding-linux-arm-musleabihf": "0.75.1",
|
|
101
|
+
"@oxc-parser/binding-linux-s390x-gnu": "0.75.1",
|
|
102
|
+
"@oxc-parser/binding-linux-riscv64-gnu": "0.75.1",
|
|
103
|
+
"@oxc-parser/binding-darwin-x64": "0.75.1",
|
|
104
|
+
"@oxc-parser/binding-darwin-arm64": "0.75.1",
|
|
105
|
+
"@oxc-parser/binding-android-arm64": "0.75.1",
|
|
106
|
+
"@oxc-parser/binding-wasm32-wasi": "0.75.1"
|
|
107
107
|
},
|
|
108
108
|
"scripts": {
|
|
109
109
|
"build-dev": "napi build --platform --js bindings.js",
|