@fluidframework/map 0.58.2000 → 0.58.3000-61081

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/map",
3
- "version": "0.58.2000",
3
+ "version": "0.58.3000-61081",
4
4
  "description": "Distributed map",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -32,7 +32,7 @@
32
32
  "lint:fix": "npm run eslint:fix",
33
33
  "test": "npm run test:mocha",
34
34
  "test:coverage": "nyc npm test -- --reporter xunit --reporter-option output=nyc/junit-report.xml",
35
- "test:mocha": "mocha --recursive dist/test -r node_modules/@fluidframework/mocha-test-setup --unhandled-rejections=strict",
35
+ "test:mocha": "mocha --ignore 'dist/test/types/*' --recursive dist/test -r node_modules/@fluidframework/mocha-test-setup --unhandled-rejections=strict",
36
36
  "test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
37
37
  "tsc": "tsc",
38
38
  "tsfmt": "tsfmt --verify",
@@ -61,22 +61,23 @@
61
61
  "dependencies": {
62
62
  "@fluidframework/common-definitions": "^0.20.1",
63
63
  "@fluidframework/common-utils": "^0.32.1",
64
- "@fluidframework/container-utils": "^0.58.2000",
64
+ "@fluidframework/container-utils": "0.58.3000-61081",
65
65
  "@fluidframework/core-interfaces": "^0.42.0",
66
- "@fluidframework/datastore-definitions": "^0.58.2000",
67
- "@fluidframework/driver-utils": "^0.58.2000",
66
+ "@fluidframework/datastore-definitions": "0.58.3000-61081",
67
+ "@fluidframework/driver-utils": "0.58.3000-61081",
68
68
  "@fluidframework/protocol-definitions": "^0.1027.1000",
69
- "@fluidframework/runtime-definitions": "^0.58.2000",
70
- "@fluidframework/runtime-utils": "^0.58.2000",
71
- "@fluidframework/shared-object-base": "^0.58.2000",
69
+ "@fluidframework/runtime-definitions": "0.58.3000-61081",
70
+ "@fluidframework/runtime-utils": "0.58.3000-61081",
71
+ "@fluidframework/shared-object-base": "0.58.3000-61081",
72
72
  "path-browserify": "^1.0.1"
73
73
  },
74
74
  "devDependencies": {
75
- "@fluid-internal/test-dds-utils": "^0.58.2000",
75
+ "@fluid-internal/test-dds-utils": "0.58.3000-61081",
76
76
  "@fluidframework/build-common": "^0.23.0",
77
- "@fluidframework/eslint-config-fluid": "^0.27.0",
78
- "@fluidframework/mocha-test-setup": "^0.58.2000",
79
- "@fluidframework/test-runtime-utils": "^0.58.2000",
77
+ "@fluidframework/eslint-config-fluid": "^0.27.2000-59622",
78
+ "@fluidframework/map-previous": "npm:@fluidframework/map@0.58.1001",
79
+ "@fluidframework/mocha-test-setup": "0.58.3000-61081",
80
+ "@fluidframework/test-runtime-utils": "0.58.3000-61081",
80
81
  "@microsoft/api-extractor": "^7.16.1",
81
82
  "@rushstack/eslint-config": "^2.5.1",
82
83
  "@types/mocha": "^8.2.2",
@@ -98,5 +99,15 @@
98
99
  "rimraf": "^2.6.2",
99
100
  "typescript": "~4.1.3",
100
101
  "typescript-formatter": "7.1.0"
102
+ },
103
+ "typeValidation": {
104
+ "version": "0.58.3000",
105
+ "broken": {
106
+ "0.58.1001": {
107
+ "ClassDeclaration_SharedDirectory": {
108
+ "forwardCompat": false
109
+ }
110
+ }
111
+ }
101
112
  }
102
113
  }
package/src/directory.ts CHANGED
@@ -489,6 +489,13 @@ export class SharedDirectory extends SharedObject<ISharedDirectoryEvents> implem
489
489
  return this.root.entries();
490
490
  }
491
491
 
492
+ /**
493
+ * {@inheritDoc IDirectory.countSubDirectory}
494
+ */
495
+ public countSubDirectory(): number {
496
+ return this.root.countSubDirectory();
497
+ }
498
+
492
499
  /**
493
500
  * Get an iterator over the keys under this IDirectory.
494
501
  * @returns The iterator
@@ -940,6 +947,13 @@ class SubDirectory extends TypedEventEmitter<IDirectoryEvents> implements IDirec
940
947
  return this;
941
948
  }
942
949
 
950
+ /**
951
+ * {@inheritDoc IDirectory.countSubDirectory}
952
+ */
953
+ public countSubDirectory(): number {
954
+ return this._subdirectories.size;
955
+ }
956
+
943
957
  /**
944
958
  * {@inheritDoc IDirectory.createSubDirectory}
945
959
  */
@@ -1550,6 +1564,8 @@ class SubDirectory extends TypedEventEmitter<IDirectoryEvents> implements IDirec
1550
1564
  for (const [_, subDirectory] of subDirectories) {
1551
1565
  this.disposeSubDirectoryTree(subDirectory);
1552
1566
  }
1553
- directory.dispose();
1567
+ if (typeof directory.dispose === "function") {
1568
+ directory.dispose();
1569
+ }
1554
1570
  }
1555
1571
  }
package/src/interfaces.ts CHANGED
@@ -27,7 +27,7 @@ export interface IValueChanged {
27
27
  * @remarks
28
28
  * When used as a Map, operates on its keys.
29
29
  */
30
- export interface IDirectory extends Map<string, any>, IEventProvider<IDirectoryEvents>, IDisposable {
30
+ export interface IDirectory extends Map<string, any>, IEventProvider<IDirectoryEvents>, Partial<IDisposable> {
31
31
  /**
32
32
  * The absolute path of the directory.
33
33
  */
@@ -48,6 +48,12 @@ export interface IDirectory extends Map<string, any>, IEventProvider<IDirectoryE
48
48
  */
49
49
  set<T = any>(key: string, value: T): this;
50
50
 
51
+ /**
52
+ * Get the number of sub directory within the directory.
53
+ * @returns The number of sub directory within a directory.
54
+ */
55
+ countSubDirectory?(): number;
56
+
51
57
  /**
52
58
  * Creates an IDirectory child of this IDirectory, or retrieves the existing IDirectory child if one with the
53
59
  * same name already exists.
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/map";
9
- export const pkgVersion = "0.58.2000";
9
+ export const pkgVersion = "0.58.3000-61081";