@fluidframework/driver-utils 1.2.2 → 2.0.0-internal.1.0.0.81589
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/dist/network.d.ts +7 -1
- package/dist/network.d.ts.map +1 -1
- package/dist/network.js +10 -1
- package/dist/network.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/parallelRequests.d.ts +14 -2
- package/dist/parallelRequests.d.ts.map +1 -1
- package/dist/parallelRequests.js +21 -7
- package/dist/parallelRequests.js.map +1 -1
- package/dist/readAndParse.d.ts +9 -4
- package/dist/readAndParse.d.ts.map +1 -1
- package/dist/readAndParse.js +9 -4
- package/dist/readAndParse.js.map +1 -1
- package/lib/network.d.ts +7 -1
- package/lib/network.d.ts.map +1 -1
- package/lib/network.js +8 -0
- package/lib/network.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/parallelRequests.d.ts +14 -2
- package/lib/parallelRequests.d.ts.map +1 -1
- package/lib/parallelRequests.js +21 -7
- package/lib/parallelRequests.js.map +1 -1
- package/lib/readAndParse.d.ts +9 -4
- package/lib/readAndParse.d.ts.map +1 -1
- package/lib/readAndParse.js +9 -4
- package/lib/readAndParse.js.map +1 -1
- package/package.json +27 -13
- package/src/network.ts +15 -0
- package/src/packageVersion.ts +1 -1
- package/src/parallelRequests.ts +21 -6
- package/src/readAndParse.ts +9 -4
package/src/readAndParse.ts
CHANGED
|
@@ -7,11 +7,16 @@ import { bufferToString } from "@fluidframework/common-utils";
|
|
|
7
7
|
import { IDocumentStorageService } from "@fluidframework/driver-definitions";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* Read a blob from IDocumentStorageService and
|
|
10
|
+
* Read a blob from {@link @fluidframework/driver-definitions#IDocumentStorageService} and
|
|
11
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse | JSON.parse}
|
|
12
|
+
* it into object of type `T`.
|
|
11
13
|
*
|
|
12
|
-
* @param storage -
|
|
13
|
-
* @param id -
|
|
14
|
-
*
|
|
14
|
+
* @param storage - The `DocumentStorageService` to read from.
|
|
15
|
+
* @param id - The ID of the blob to read and parse.
|
|
16
|
+
*
|
|
17
|
+
* @typeParam T - Output type matching JSON format of inpyt blob data.
|
|
18
|
+
*
|
|
19
|
+
* @returns The object that we decoded and parsed via `JSON.parse`.
|
|
15
20
|
*/
|
|
16
21
|
export async function readAndParse<T>(storage: Pick<IDocumentStorageService, "readBlob">, id: string): Promise<T> {
|
|
17
22
|
const blob = await storage.readBlob(id);
|