@travetto/model 3.4.0-rc.4 → 3.4.0-rc.5
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/package.json +7 -7
- package/support/test/stream.ts +4 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/model",
|
|
3
|
-
"version": "3.4.0-rc.
|
|
3
|
+
"version": "3.4.0-rc.5",
|
|
4
4
|
"description": "Datastore abstraction for core operations.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"datastore",
|
|
@@ -26,14 +26,14 @@
|
|
|
26
26
|
"directory": "module/model"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@travetto/config": "^3.4.0-rc.
|
|
30
|
-
"@travetto/di": "^3.4.0-rc.
|
|
31
|
-
"@travetto/registry": "^3.4.0-rc.
|
|
32
|
-
"@travetto/schema": "^3.4.0-rc.
|
|
29
|
+
"@travetto/config": "^3.4.0-rc.4",
|
|
30
|
+
"@travetto/di": "^3.4.0-rc.4",
|
|
31
|
+
"@travetto/registry": "^3.4.0-rc.5",
|
|
32
|
+
"@travetto/schema": "^3.4.0-rc.4"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@travetto/cli": "^3.4.0-rc.
|
|
36
|
-
"@travetto/test": "^3.4.0-rc.
|
|
35
|
+
"@travetto/cli": "^3.4.0-rc.5",
|
|
36
|
+
"@travetto/test": "^3.4.0-rc.4"
|
|
37
37
|
},
|
|
38
38
|
"peerDependenciesMeta": {
|
|
39
39
|
"@travetto/cli": {
|
package/support/test/stream.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import fs from 'fs/promises';
|
|
1
2
|
import assert from 'assert';
|
|
2
3
|
import crypto from 'crypto';
|
|
3
4
|
import { Readable } from 'stream';
|
|
4
5
|
|
|
5
6
|
import { Suite, Test, TestFixtures } from '@travetto/test';
|
|
7
|
+
import { StreamUtil } from '@travetto/base';
|
|
6
8
|
|
|
7
9
|
import { BaseModelSuite } from './base';
|
|
8
10
|
import { ModelStreamSupport } from '../../src/service/stream';
|
|
9
|
-
import { StreamUtil } from '@travetto/base';
|
|
10
11
|
|
|
11
12
|
@Suite()
|
|
12
13
|
export abstract class ModelStreamSuite extends BaseModelSuite<ModelStreamSupport> {
|
|
@@ -25,7 +26,8 @@ export abstract class ModelStreamSuite extends BaseModelSuite<ModelStreamSupport
|
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
async getStream(resource: string): Promise<readonly [{ size: number, contentType: string, hash: string, filename: string }, Readable]> {
|
|
28
|
-
const
|
|
29
|
+
const file = await this.fixture.resolve(resource);
|
|
30
|
+
const { size } = await fs.stat(file);
|
|
29
31
|
const hash = await this.getHash(await this.fixture.readStream(resource));
|
|
30
32
|
|
|
31
33
|
return [
|