@contentstack/datasync-manager 2.0.9 → 2.0.10

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.
Files changed (2) hide show
  1. package/dist/util/fs.js +5 -15
  2. package/package.json +2 -2
package/dist/util/fs.js CHANGED
@@ -13,7 +13,7 @@ exports.mkdirpSync = exports.stat = exports.mkdir = exports.readFileSync = expor
13
13
  const Debug = require("debug");
14
14
  const fs_1 = require("fs");
15
15
  Object.defineProperty(exports, "existsSync", { enumerable: true, get: function () { return fs_1.existsSync; } });
16
- const mkdirp_1 = __importDefault(require("mkdirp"));
16
+ const mkdirp_1 = require("mkdirp");
17
17
  const path_1 = require("path");
18
18
  const write_file_atomic_1 = __importDefault(require("write-file-atomic"));
19
19
  const debug = Debug('sm:util-fs');
@@ -29,7 +29,7 @@ const writeFile = (filePath, data) => {
29
29
  try {
30
30
  const fileDirectory = (0, path_1.dirname)(filePath);
31
31
  if (!(0, fs_1.existsSync)(fileDirectory)) {
32
- mkdirp_1.default.sync(fileDirectory);
32
+ (0, mkdirp_1.mkdirpSync)(fileDirectory);
33
33
  }
34
34
  return (0, write_file_atomic_1.default)(filePath, (typeof data === 'object') ? JSON.stringify(data) : data, (wfError) => {
35
35
  if (wfError) {
@@ -98,19 +98,9 @@ exports.readFileSync = readFileSync;
98
98
  */
99
99
  const mkdir = (path) => {
100
100
  debug(`mkdir called on ${path}`);
101
- return new Promise((resolve, reject) => {
102
- try {
103
- return (0, mkdirp_1.default)(path, (error) => {
104
- if (error) {
105
- return reject(error);
106
- }
107
- return resolve('');
108
- });
109
- }
110
- catch (error) {
111
- return reject(error);
112
- }
113
- });
101
+ return (0, mkdirp_1.mkdirp)(path)
102
+ .then(() => '')
103
+ .catch(error => Promise.reject(error));
114
104
  };
115
105
  exports.mkdir = mkdir;
116
106
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@contentstack/datasync-manager",
3
3
  "author": "Contentstack LLC <support@contentstack.com>",
4
- "version": "2.0.9",
4
+ "version": "2.0.10",
5
5
  "description": "The primary module of Contentstack DataSync. Syncs Contentstack data with your server using Contentstack Sync API",
6
6
  "main": "dist/index.js",
7
7
  "dependencies": {
@@ -30,7 +30,7 @@
30
30
  "husky": "^9.1.7",
31
31
  "jest": "^29.7.0",
32
32
  "jest-html-reporter": "^3.10.2",
33
- "mkdirp": "^1.0.4",
33
+ "mkdirp": "^3.0.1",
34
34
  "nock": "^10.0.6",
35
35
  "node-notifier": "^10.0.1",
36
36
  "rimraf": "^2.7.1",