mirror of
https://github.com/denoland/deno.git
synced 2024-11-24 15:19:26 -05:00
feat(ext/node): export more symbols from streams and timers/promises (#25582)
This commit is contained in:
parent
5e0b2aa473
commit
05bd547238
7 changed files with 60 additions and 15 deletions
|
@ -5277,6 +5277,7 @@ var require_stream = __commonJS({
|
||||||
Stream._uint8ArrayToBuffer = function _uint8ArrayToBuffer(chunk) {
|
Stream._uint8ArrayToBuffer = function _uint8ArrayToBuffer(chunk) {
|
||||||
return Buffer2.from(chunk.buffer, chunk.byteOffset, chunk.byteLength);
|
return Buffer2.from(chunk.buffer, chunk.byteOffset, chunk.byteLength);
|
||||||
};
|
};
|
||||||
|
Stream._isArrayBufferView = isArrayBufferView;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
/* End esm.sh bundle */
|
/* End esm.sh bundle */
|
||||||
|
@ -5311,11 +5312,15 @@ export const Duplex = CustomStream.Duplex;
|
||||||
export const PassThrough = CustomStream.PassThrough;
|
export const PassThrough = CustomStream.PassThrough;
|
||||||
export const Stream = CustomStream.Stream;
|
export const Stream = CustomStream.Stream;
|
||||||
export const Transform = CustomStream.Transform;
|
export const Transform = CustomStream.Transform;
|
||||||
|
export const _isArrayBufferView = isArrayBufferView;
|
||||||
export const _isUint8Array = CustomStream._isUint8Array;
|
export const _isUint8Array = CustomStream._isUint8Array;
|
||||||
export const _uint8ArrayToBuffer = CustomStream._uint8ArrayToBuffer;
|
export const _uint8ArrayToBuffer = CustomStream._uint8ArrayToBuffer;
|
||||||
export const addAbortSignal = CustomStream.addAbortSignal;
|
export const addAbortSignal = CustomStream.addAbortSignal;
|
||||||
export const pipeline = CustomStream.pipeline;
|
export const pipeline = CustomStream.pipeline;
|
||||||
export { finished };
|
export const isDisturbed = CustomStream.isDisturbed;
|
||||||
|
export const isErrored = CustomStream.isErrored;
|
||||||
|
export const compose = CustomStream.compose;
|
||||||
|
export { destroy, finished, isDestroyed, isReadable, isWritable };
|
||||||
|
|
||||||
function isWritableStream(object) {
|
function isWritableStream(object) {
|
||||||
return object instanceof WritableStream;
|
return object instanceof WritableStream;
|
||||||
|
|
|
@ -7,6 +7,7 @@ export {
|
||||||
Buffer,
|
Buffer,
|
||||||
constants,
|
constants,
|
||||||
default,
|
default,
|
||||||
|
INSPECT_MAX_BYTES,
|
||||||
isAscii,
|
isAscii,
|
||||||
isUtf8,
|
isUtf8,
|
||||||
kMaxLength,
|
kMaxLength,
|
||||||
|
|
|
@ -65,7 +65,7 @@ const customInspectSymbol =
|
||||||
? Symbol["for"]("nodejs.util.inspect.custom")
|
? Symbol["for"]("nodejs.util.inspect.custom")
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
const INSPECT_MAX_BYTES = 50;
|
export const INSPECT_MAX_BYTES = 50;
|
||||||
|
|
||||||
export const constants = {
|
export const constants = {
|
||||||
MAX_LENGTH: kMaxLength,
|
MAX_LENGTH: kMaxLength,
|
||||||
|
|
|
@ -2,9 +2,24 @@
|
||||||
// Copyright Joyent and Node contributors. All rights reserved. MIT license.
|
// Copyright Joyent and Node contributors. All rights reserved. MIT license.
|
||||||
// deno-lint-ignore-file
|
// deno-lint-ignore-file
|
||||||
|
|
||||||
|
// TODO(bartlomieju): this should be 64?
|
||||||
|
let defaultHighWaterMarkBytes = 16 * 1024;
|
||||||
|
let defaultHighWaterMarkObjectMode = 16;
|
||||||
|
|
||||||
function getDefaultHighWaterMark(objectMode) {
|
function getDefaultHighWaterMark(objectMode) {
|
||||||
return objectMode ? 16 : 16 * 1024;
|
return objectMode
|
||||||
|
? defaultHighWaterMarkObjectMode
|
||||||
|
: defaultHighWaterMarkBytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default { getDefaultHighWaterMark };
|
function setDefaultHighWaterMark(objectMode, value) {
|
||||||
export { getDefaultHighWaterMark };
|
validateInteger(value, "value", 0);
|
||||||
|
if (objectMode) {
|
||||||
|
defaultHighWaterMarkObjectMode = value;
|
||||||
|
} else {
|
||||||
|
defaultHighWaterMarkBytes = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default { getDefaultHighWaterMark, setDefaultHighWaterMark };
|
||||||
|
export { getDefaultHighWaterMark, setDefaultHighWaterMark };
|
||||||
|
|
|
@ -4,14 +4,19 @@
|
||||||
|
|
||||||
// @deno-types="./_stream.d.ts"
|
// @deno-types="./_stream.d.ts"
|
||||||
import {
|
import {
|
||||||
|
_isArrayBufferView,
|
||||||
_isUint8Array,
|
_isUint8Array,
|
||||||
_uint8ArrayToBuffer,
|
_uint8ArrayToBuffer,
|
||||||
addAbortSignal,
|
addAbortSignal,
|
||||||
// compose,
|
compose,
|
||||||
// destroy,
|
destroy,
|
||||||
Duplex,
|
Duplex,
|
||||||
finished,
|
finished,
|
||||||
// isDisturbed,
|
isDestroyed,
|
||||||
|
isDisturbed,
|
||||||
|
isErrored,
|
||||||
|
isReadable,
|
||||||
|
isWritable,
|
||||||
PassThrough,
|
PassThrough,
|
||||||
pipeline,
|
pipeline,
|
||||||
Readable,
|
Readable,
|
||||||
|
@ -21,18 +26,28 @@ import {
|
||||||
} from "ext:deno_node/_stream.mjs";
|
} from "ext:deno_node/_stream.mjs";
|
||||||
import {
|
import {
|
||||||
getDefaultHighWaterMark,
|
getDefaultHighWaterMark,
|
||||||
|
setDefaultHighWaterMark,
|
||||||
} from "ext:deno_node/internal/streams/state.mjs";
|
} from "ext:deno_node/internal/streams/state.mjs";
|
||||||
|
|
||||||
export {
|
export {
|
||||||
|
_isArrayBufferView,
|
||||||
_isUint8Array,
|
_isUint8Array,
|
||||||
_uint8ArrayToBuffer,
|
_uint8ArrayToBuffer,
|
||||||
addAbortSignal,
|
addAbortSignal,
|
||||||
|
compose,
|
||||||
|
destroy,
|
||||||
Duplex,
|
Duplex,
|
||||||
finished,
|
finished,
|
||||||
getDefaultHighWaterMark,
|
getDefaultHighWaterMark,
|
||||||
|
isDestroyed,
|
||||||
|
isDisturbed,
|
||||||
|
isErrored,
|
||||||
|
isReadable,
|
||||||
|
isWritable,
|
||||||
PassThrough,
|
PassThrough,
|
||||||
pipeline,
|
pipeline,
|
||||||
Readable,
|
Readable,
|
||||||
|
setDefaultHighWaterMark,
|
||||||
Stream,
|
Stream,
|
||||||
Transform,
|
Transform,
|
||||||
Writable,
|
Writable,
|
||||||
|
|
|
@ -19,10 +19,16 @@ import {
|
||||||
TextDecoderStream,
|
TextDecoderStream,
|
||||||
TextEncoderStream,
|
TextEncoderStream,
|
||||||
} from "ext:deno_web/08_text_encoding.js";
|
} from "ext:deno_web/08_text_encoding.js";
|
||||||
|
import {
|
||||||
|
CompressionStream,
|
||||||
|
DecompressionStream,
|
||||||
|
} from "ext:deno_web/14_compression.js";
|
||||||
|
|
||||||
export {
|
export {
|
||||||
ByteLengthQueuingStrategy,
|
ByteLengthQueuingStrategy,
|
||||||
|
CompressionStream,
|
||||||
CountQueuingStrategy,
|
CountQueuingStrategy,
|
||||||
|
DecompressionStream,
|
||||||
ReadableByteStreamController,
|
ReadableByteStreamController,
|
||||||
ReadableStream,
|
ReadableStream,
|
||||||
ReadableStreamBYOBReader,
|
ReadableStreamBYOBReader,
|
||||||
|
@ -39,19 +45,21 @@ export {
|
||||||
};
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
ByteLengthQueuingStrategy,
|
||||||
|
CompressionStream,
|
||||||
|
CountQueuingStrategy,
|
||||||
|
DecompressionStream,
|
||||||
|
ReadableByteStreamController,
|
||||||
ReadableStream,
|
ReadableStream,
|
||||||
ReadableStreamBYOBReader,
|
ReadableStreamBYOBReader,
|
||||||
ReadableStreamBYOBRequest,
|
ReadableStreamBYOBRequest,
|
||||||
ReadableStreamDefaultReader,
|
|
||||||
ReadableByteStreamController,
|
|
||||||
ReadableStreamDefaultController,
|
ReadableStreamDefaultController,
|
||||||
|
ReadableStreamDefaultReader,
|
||||||
|
TextDecoderStream,
|
||||||
|
TextEncoderStream,
|
||||||
TransformStream,
|
TransformStream,
|
||||||
TransformStreamDefaultController,
|
TransformStreamDefaultController,
|
||||||
WritableStream,
|
WritableStream,
|
||||||
WritableStreamDefaultWriter,
|
|
||||||
WritableStreamDefaultController,
|
WritableStreamDefaultController,
|
||||||
ByteLengthQueuingStrategy,
|
WritableStreamDefaultWriter,
|
||||||
CountQueuingStrategy,
|
|
||||||
TextEncoderStream,
|
|
||||||
TextDecoderStream,
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -17,4 +17,5 @@ export default {
|
||||||
setTimeout,
|
setTimeout,
|
||||||
setImmediate,
|
setImmediate,
|
||||||
setInterval,
|
setInterval,
|
||||||
|
scheduler,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue