1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4  value: true
5});
6exports.copyFilePathToPathAsync = copyFilePathToPathAsync;
7exports.removeFile = removeFile;
8function _fs() {
9  const data = _interopRequireDefault(require("fs"));
10  _fs = function () {
11    return data;
12  };
13  return data;
14}
15function _path() {
16  const data = _interopRequireDefault(require("path"));
17  _path = function () {
18    return data;
19  };
20  return data;
21}
22function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23/** A basic function that copies a single file to another file location. */
24async function copyFilePathToPathAsync(src, dest) {
25  const srcFile = await _fs().default.promises.readFile(src);
26  await _fs().default.promises.mkdir(_path().default.dirname(dest), {
27    recursive: true
28  });
29  await _fs().default.promises.writeFile(dest, srcFile);
30}
31
32/** Remove a single file (not directory). Returns `true` if a file was actually deleted. */
33function removeFile(filePath) {
34  try {
35    _fs().default.unlinkSync(filePath);
36    return true;
37  } catch (error) {
38    // Skip if the remove did nothing.
39    if (error.code === 'ENOENT') {
40      return false;
41    }
42    throw error;
43  }
44}
45//# sourceMappingURL=fs.js.map