28
28
- [ Number Array] [ Number Array ]
29
29
- [ ReadableStream] [ ReadableStream ]
30
30
- [ Response] [ Response ]
31
- - [ String ] [ String ]
31
+ - [ Text ] [ Text ]
32
32
- [ Uint8Array] [ Uint8Array ]
33
33
34
34
## Usage
@@ -87,10 +87,10 @@ Undio automatically detects the input type and uses the proper method to convert
87
87
** Example:**
88
88
89
89
``` ts
90
- import { detectType , toString , toReadableStream } from " undio" ;
90
+ import { detectType , toText , toReadableStream } from " undio" ;
91
91
92
92
// Convert any supported type (auto-detected)
93
- const string = await toString (value );
93
+ const string = await toText (value );
94
94
const stream = await toReadableStream (value );
95
95
96
96
// "ArrayBuffer" | "Blob"| "DataView" | "NumberArray" | "ReadableStream" | "String" | "Uint8Array";
@@ -157,9 +157,9 @@ Convert from [ArrayBuffer][ArrayBuffer] to [ReadableStream][ReadableStream]
157
157
158
158
Convert from [ ArrayBuffer] [ ArrayBuffer ] to [ Response] [ Response ]
159
159
160
- ### ` arrayBufferToString (arrayBuffer)`
160
+ ### ` arrayBufferToText (arrayBuffer)`
161
161
162
- Convert from [ ArrayBuffer] [ ArrayBuffer ] to [ String ] [ String ]
162
+ Convert from [ ArrayBuffer] [ ArrayBuffer ] to [ Text ] [ Text ]
163
163
164
164
### ` arrayBufferToUint8Array(arrayBuffer) `
165
165
@@ -181,7 +181,7 @@ Convert from any value to [ArrayBuffer][ArrayBuffer]
181
181
182
182
### ` assertBase64(input, opts?) `
183
183
184
- Assert that input is an instance of [ String ] [ String ] and matches the [ Base64] [ Base64 ] pattern or throw a ` TypeError ` .
184
+ Assert that input is an instance of [ Text ] [ Text ] and matches the [ Base64] [ Base64 ] pattern or throw a ` TypeError ` .
185
185
186
186
### ` base64ToArrayBuffer(string, base64Options?) `
187
187
@@ -207,9 +207,9 @@ Convert from [Base64][Base64] to [ReadableStream][ReadableStream]
207
207
208
208
Convert from [ Base64] [ Base64 ] to [ Response] [ Response ]
209
209
210
- ### ` base64ToString (string, opts?)`
210
+ ### ` base64ToText (string, opts?)`
211
211
212
- Convert from [ Base64] [ Base64 ] to [ String ] [ String ]
212
+ Convert from [ Base64] [ Base64 ] to [ Text ] [ Text ]
213
213
214
214
### ` base64ToUint8Array(string, base64Options?) `
215
215
@@ -253,9 +253,9 @@ Convert from [Blob][Blob] to [ReadableStream][ReadableStream]
253
253
254
254
Convert from [ Blob] [ Blob ] to [ Response] [ Response ]
255
255
256
- ### ` blobToString (blob)`
256
+ ### ` blobToText (blob)`
257
257
258
- Convert from [ Blob] [ Blob ] to [ String ] [ String ]
258
+ Convert from [ Blob] [ Blob ] to [ Text ] [ Text ]
259
259
260
260
### ` blobToUint8Array(blob) `
261
261
@@ -299,9 +299,9 @@ Convert from [DataView][DataView] to [ReadableStream][ReadableStream]
299
299
300
300
Convert from [ DataView] [ DataView ] to [ Response] [ Response ]
301
301
302
- ### ` dataViewToString (dataView)`
302
+ ### ` dataViewToText (dataView)`
303
303
304
- Convert from [ DataView] [ DataView ] to [ String ] [ String ]
304
+ Convert from [ DataView] [ DataView ] to [ Text ] [ Text ]
305
305
306
306
### ` dataViewToUint8Array(dataView) `
307
307
@@ -345,9 +345,9 @@ Convert from [Number Array][Number Array] to [DataView][DataView]
345
345
346
346
Convert from [ Number Array] [ Number Array ] to [ ReadableStream] [ ReadableStream ]
347
347
348
- ### ` numberArrayToString (numberArray)`
348
+ ### ` numberArrayToText (numberArray)`
349
349
350
- Convert from [ Number Array] [ Number Array ] to [ String ] [ String ]
350
+ Convert from [ Number Array] [ Number Array ] to [ Text ] [ Text ]
351
351
352
352
### ` numberArrayToUint8Array(numberArray) `
353
353
@@ -387,9 +387,9 @@ Convert from [ReadableStream][ReadableStream] to [DataView][DataView]
387
387
388
388
Convert from [ ReadableStream] [ ReadableStream ] to [ Number Array] [ Number Array ]
389
389
390
- ### ` readableStreamToString (readableStream)`
390
+ ### ` readableStreamToText (readableStream)`
391
391
392
- Convert from [ ReadableStream] [ ReadableStream ] to [ String ] [ String ]
392
+ Convert from [ ReadableStream] [ ReadableStream ] to [ Text ] [ Text ]
393
393
394
394
### ` readableStreamToUint8Array(readableStream) `
395
395
@@ -437,51 +437,57 @@ Convert from [Response][Response] to [Number Array][Number Array]
437
437
438
438
Convert from [ Response] [ Response ] to [ ReadableStream] ReadableStream]
439
439
440
- ### ` responseToString (response)`
440
+ ### ` responseToText (response)`
441
441
442
- Convert from [ Response] [ Response ] to [ String ] [ String ]
442
+ Convert from [ Response] [ Response ] to [ Text ] [ Text ]
443
443
444
444
### ` responseToUint8Array(response) `
445
445
446
446
Convert from [ Response] [ Response ] to [ Uint8Array] [ Uint8Array ]
447
447
448
448
## String
449
449
450
- ### ` assertString (input)`
450
+ ### ` toText (input)`
451
451
452
- Assert that input is an instance of [ String ] [ String ] or throw a ` TypeError ` .
452
+ Convert from any value to [ Text ] [ Text ]
453
453
454
- ### ` isString(input) `
454
+ ## Text
455
455
456
- Test if input is an instance of [ String ] [ String ] and return ` true ` or ` false ` .
456
+ ### ` assertText( input) `
457
457
458
- ### ` stringToArrayBuffer(string) `
458
+ Assert that input is an instance of [ Text ] [ Text ] or throw a ` TypeError ` .
459
459
460
- Convert from [ string ] [ string ] to [ ArrayBuffer ] [ ArrayBuffer ]
460
+ ### ` isText(input) `
461
461
462
- ### ` stringToBase64(string, opts?) `
462
+ Test if input is an instance of [ Text ] [ Text ] and return ` true ` or ` false ` .
463
463
464
- Convert from [ string] [ string ] to [ Base64 ] [ Base64 ]
464
+ ### ` textToArrayBuffer( string) `
465
465
466
- ### ` stringToBlob(string, options?) `
466
+ Convert from [ Text ] [ Text ] to [ ArrayBuffer ] [ ArrayBuffer ]
467
467
468
- Convert from [ string] [ string ] to [ Blob ] [ Blob ]
468
+ ### ` textToBase64( string, opts?) `
469
469
470
- ### ` stringToDataView(string) `
470
+ Convert from [ Text ] [ Text ] to [ Base64 ] [ Base64 ]
471
471
472
- Convert from [ string] [ string ] to [ DataView ] [ DataView ]
472
+ ### ` textToBlob( string, options?) `
473
473
474
- ### ` stringToNumberArray(string) `
474
+ Convert from [ Text ] [ Text ] to [ Blob ] [ Blob ]
475
475
476
- Convert from [ string] [ string ] to [ Number Array ] [ Number Array ]
476
+ ### ` textToDataView( string) `
477
477
478
- ### ` stringToReadableStream(string) `
478
+ Convert from [ Text ] [ Text ] to [ DataView ] [ DataView ]
479
479
480
- Convert from [ string] [ string ] to [ ReadableStream ] [ ReadableStream ]
480
+ ### ` textToNumberArray( string) `
481
481
482
- ### ` stringToUint8Array(string) `
482
+ Convert from [ Text ] [ Text ] to [ Number Array ] [ Number Array ]
483
483
484
- Convert from [ string] [ string ] to [ Uint8Array] [ Uint8Array ]
484
+ ### ` textToReadableStream(string) `
485
+
486
+ Convert from [ Text] [ Text ] to [ ReadableStream] [ ReadableStream ]
487
+
488
+ ### ` textToUint8Array(string) `
489
+
490
+ Convert from [ Text] [ Text ] to [ Uint8Array] [ Uint8Array ]
485
491
486
492
## Uint8 Array
487
493
@@ -525,9 +531,9 @@ Convert from [Uint8Array][Uint8Array] to [ReadableStream][ReadableStream]
525
531
526
532
Convert from [ Uint8Array] [ Uint8Array ] to [ Response] [ Response ]
527
533
528
- ### ` uint8ArrayToString (uint8Array)`
534
+ ### ` uint8ArrayToText (uint8Array)`
529
535
530
- Convert from [ Uint8Array] [ Uint8Array ] to [ String ] [ String ]
536
+ Convert from [ Uint8Array] [ Uint8Array ] to [ Text ] [ Text ]
531
537
532
538
### ` convertTo(toType, input, fromType?) `
533
539
@@ -543,7 +549,7 @@ Convert from [Number Array][Number Array] to [Response][Response]
543
549
544
550
Convert from [ ReadableStream] [ ReadableStream ] to [ Response] [ Response ]
545
551
546
- ### ` stringToResponse (string, init?)`
552
+ ### ` textToResponse (string, init?)`
547
553
548
554
<!-- /automd -->
549
555
0 commit comments