• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

realm / realm-js / 6470176423

10 Oct 2023 01:41PM UTC coverage: 85.397%. Remained the same
6470176423

Pull #6192

github

web-flow
[realm-react-realm-react-v0.6.2-rc.1] Bump version
Pull Request #6192: Prepare for realm-react-realm-react-v0.6.2-rc.1

897 of 1112 branches covered (0.0%)

Branch coverage included in aggregate %.

2331 of 2668 relevant lines covered (87.37%)

983.92 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

16.67
/packages/realm/src/platform/file-system.ts
1
////////////////////////////////////////////////////////////////////////////
2
//
3
// Copyright 2022 Realm Inc.
4
//
5
// Licensed under the Apache License, Version 2.0 (the "License");
6
// you may not use this file except in compliance with the License.
7
// You may obtain a copy of the License at
8
//
9
// http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing, software
12
// distributed under the License is distributed on an "AS IS" BASIS,
13
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
// See the License for the specific language governing permissions and
15
// limitations under the License.
16
//
17
////////////////////////////////////////////////////////////////////////////
18

19
type FileSystemType = {
20
  isAbsolutePath(path: string): boolean;
21
  joinPaths(...segments: string[]): string;
22
  removeFile(path: string): void;
23
  removeDirectory(path: string): void;
24
  ensureDirectoryForFile(path: string): void;
25
  setDefaultDirectoryPath(path: string): void;
26
  getDefaultDirectoryPath(): string;
27
  exists(path: string): boolean;
28
  copyBundledRealmFiles(): void;
29
  // readDirectory(path: string): Dirent[];
30
  removeRealmFilesFromDirectory(path: string): void;
31
};
32

33
export type Dirent = {
34
  name: string;
35
  isFile(): boolean;
36
  isDirectory(): boolean;
37
};
38

39
export const fs: FileSystemType = {
1✔
40
  isAbsolutePath() {
41
    throw new Error("Not supported on this platform");
×
42
  },
43
  joinPaths() {
44
    throw new Error("Not supported on this platform");
×
45
  },
46
  removeFile() {
47
    throw new Error("Not supported on this platform");
×
48
  },
49
  setDefaultDirectoryPath() {
50
    throw new Error("Not supported on this platform");
×
51
  },
52
  getDefaultDirectoryPath() {
53
    throw new Error("Not supported on this platform");
×
54
  },
55
  exists() {
56
    throw new Error("Not supported on this platform");
×
57
  },
58
  copyBundledRealmFiles() {
59
    throw new Error("Not supported on this platform");
×
60
  },
61
  removeDirectory() {
62
    throw new Error("Not supported on this platform");
×
63
  },
64
  ensureDirectoryForFile() {
65
    throw new Error("Not supported on this platform");
×
66
  },
67
  /*
68
  readDirectory() {
69
    throw new Error("Not supported on this platform");
70
  },
71
  */
72
  removeRealmFilesFromDirectory() {
73
    throw new Error("Not supported on this platform");
×
74
  },
75
};
76

77
export function inject(injected: FileSystemType) {
78
  Object.freeze(Object.assign(fs, injected));
1✔
79
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc