@@ -221,6 +221,28 @@ export function isArray(a: unknown): boolean {
221
221
return Array . isArray ( a ) ;
222
222
}
223
223
224
+ export function parseEnv ( ) : void {
225
+ // We don't implement this function yet because it is currently under
226
+ // active development. We should implement it when it's stable
227
+ throw new Error ( 'node:util parseEnv is not implemented' ) ;
228
+ }
229
+
230
+ export function getSystemErrorMap ( ) : void {
231
+ throw new Error ( 'node:util getSystemErrorMap is not implemented' ) ;
232
+ }
233
+
234
+ export function getSystemErrorName ( ) : void {
235
+ throw new Error ( 'node:util getSystemErrorName is not implemented' ) ;
236
+ }
237
+
238
+ export function getSystemErrorMessage ( ) : void {
239
+ throw new Error ( 'node:util getSystemErrorMessage is not implemented' ) ;
240
+ }
241
+
242
+ export function styleText ( ) : void {
243
+ throw new Error ( 'node:util styleText is not implemented' ) ;
244
+ }
245
+
224
246
export default {
225
247
types,
226
248
callbackify,
@@ -239,45 +261,20 @@ export default {
239
261
debuglog,
240
262
debug,
241
263
deprecate,
264
+ getSystemErrorMap,
265
+ getSystemErrorMessage,
266
+ getSystemErrorName,
242
267
// Node.js originally exposed TextEncoder and TextDecoder off the util
243
268
// module originally, so let's just go ahead and do the same.
244
269
TextEncoder,
245
270
TextDecoder,
246
- // We currently have no plans to implement the following APIs but we want
247
- // to provide throwing placeholders for them. We may eventually come back
248
- // around and implement these later.
249
271
parseArgs,
272
+ parseEnv,
273
+ styleText,
250
274
transferableAbortController,
251
275
transferableAbortSignal,
252
276
getCallSite,
253
277
getCallSites,
254
278
isDeepStrictEqual,
255
279
isArray,
256
280
} ;
257
-
258
- // Node.js util APIs we're currently not supporting
259
- //
260
- // The following functions doesn't make sense for Workerd to support in runtime.
261
- // * util._errnoException
262
- // * util._exceptionWithHostPort
263
- // * util.getSystemErrorMap
264
- // * util.getSystemErrorName
265
- // * util.parseEnv
266
- // The following functions are removed from Node.js, and only supported using
267
- // a polyfill.
268
- // * util.isBoolean
269
- // * util.isBuffer
270
- // * util.isDate
271
- // * util.isError
272
- // * util.isFunction
273
- // * util.isNull
274
- // * util.isNullOrUndefined
275
- // * util.isNumber
276
- // * util.isObject
277
- // * util.isPrimitive
278
- // * util.isRegExp
279
- // * util.isString
280
- // * util.isSymbol
281
- // * util.isUndefined
282
- // TODO:
283
- // * util.styleText
0 commit comments