realm
Version:
Realm by MongoDB is an offline-first mobile database: an alternative to SQLite and key-value stores
69 lines • 2.44 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
////////////////////////////////////////////////////////////////////////////
//
// Copyright 2022 Realm Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////
const path_browserify_1 = require("path-browserify");
const file_system_1 = require("../file-system");
const debug_1 = require("../../debug");
const binding_1 = require("../binding");
var JsPlatformHelpers = binding_1.binding.JsPlatformHelpers;
var Helpers = binding_1.binding.Helpers;
const debug = (0, debug_1.extendDebug)("fs");
(0, file_system_1.inject)({
isAbsolutePath(path) {
return (0, path_browserify_1.isAbsolute)(path);
},
joinPaths(...segments) {
return (0, path_browserify_1.join)(...segments);
},
removeFile(path) {
debug("removeFile", path);
JsPlatformHelpers.removeFile(path);
},
removeDirectory(path) {
debug("removeDirectory", path);
JsPlatformHelpers.removeDirectory(path);
},
ensureDirectoryForFile(path) {
debug("ensureDirectoryForFile", path);
JsPlatformHelpers.ensureDirectoryExistsForFile(path);
},
setDefaultDirectoryPath(path) {
debug("setDefaultDirectoryPath", path);
return JsPlatformHelpers.setDefaultRealmFileDirectory(path);
},
getDefaultDirectoryPath() {
return JsPlatformHelpers.defaultRealmFileDirectory();
},
exists(path) {
return Helpers.fileExists(path);
},
copyBundledRealmFiles() {
JsPlatformHelpers.copyBundledRealmFiles();
},
/*
readDirectory(path) {
JsPlatformHelpers.
},
*/
removeRealmFilesFromDirectory(path) {
debug("removeRealmFilesFromDirectory", path);
JsPlatformHelpers.removeRealmFilesFromDirectory(path);
},
});
//# sourceMappingURL=fs.js.map