Socket
Socket
Sign inDemoInstall

fs-jetpack

Package Overview
Dependencies
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fs-jetpack - npm Package Compare versions

Comparing version 0.10.5 to 0.11.0

lib/rename.js

171

CHANGELOG.md

@@ -1,120 +0,99 @@

0.10.5 (2016-12-07)
-------------------
* Fixed `find()` bug when directories is set to true and only negation glob is used.
# 0.11.0 (2017-02-09)
- Added input validation for the whole API
- **(breaking change)** Removed already deprecated option `buf` for `read()` method
0.10.4 (2016-12-06)
-------------------
* Fixed matcher edge cases, improved matcher tests (affects `find()` and `copy()` methods).
# 0.10.5 (2016-12-07)
- Fixed `find()` bug when `directories` is set to `true` and only negation glob is used.
0.10.3 (2016-11-23)
-------------------
* Fixed directory tree traversal bug which was causing problems for `findAsync()` and `copyAsync()`.
# 0.10.4 (2016-12-06)
- Fixed matcher edge cases, improved matcher tests (affects `find()` and `copy()` methods).
0.10.2 (2016-11-08)
-------------------
* Fixed `console.log(jetpack)` for node v6.6.0 or newer.
# 0.10.3 (2016-11-23)
- Fixed directory tree traversal bug which was causing problems for `findAsync()` and `copyAsync()`.
0.10.1 (2016-11-01)
-------------------
* Bugfixed case when `copyAsync()` was leaving open read stream if write stream errored.
* Tests ported from jasmine to mocha.
# 0.10.2 (2016-11-08)
- Fixed `console.log(jetpack)` for node v6.6.0 or newer.
0.10.0 (2016-10-17)
-------------------
* `copyAsync()` uses only streams (much more memory efficient).
* `find()` supports `recursive` option.
# 0.10.1 (2016-11-01)
- Bugfixed case when `copyAsync()` was leaving open read stream if write stream errored.
- Tests ported from jasmine to mocha.
0.9.2 (2016-06-27)
-------------------
* Updated third party dependencies to quell minimatch intallation warnings.
# 0.10.0 (2016-10-17)
- `copyAsync()` uses only streams (much more memory efficient).
- `find()` supports `recursive` option.
0.9.1 (2016-05-21)
-------------------
* Bug-fixed `jetpack.read('nonexistent_file', 'json')`.
# 0.9.2 (2016-06-27)
- Updated third party dependencies to quell minimatch intallation warnings.
0.9.0 (2016-05-10)
-------------------
* **(breaking change)** `read()`, `list()`, `inspect()` and `inspectTree()` returns `undefined` instead of `null` if path doesn't exist.
* More sane edge cases for `dir()`, `file()` and `list()`.
# 0.9.1 (2016-05-21)
- Bug-fixed `jetpack.read('nonexistent_file', 'json')`.
0.8.0 (2016-04-09)
-------------------
* **(breaking change)** `find()` now distinguishes between files and directories and by default searches only for files (previously searched for both).
* **(breaking change)** `find()` no longer can be configured with `returnAs` parameter and returns always relative paths (previously returned absolute).
* **(breaking change)** `list()` no longer accepts `useInspect` as a parameter. To achieve old behaviour use `jetpack.list()` with `Array.map()`.
* **(deprecation)** Don't do `jetpack.read('sth', 'buf')`, do `jetpack.read('sth', 'buffer')` instead.
* `remove()`, `list()` and `find()` now can be called without provided `path`, and defaults to CWD in that case.
# 0.9.0 (2016-05-10)
- **(breaking change)** `read()`, `list()`, `inspect()` and `inspectTree()` returns `undefined` instead of `null` if path doesn't exist.
- More sane edge cases for `dir()`, `file()` and `list()`.
0.7.3 (2016-03-21)
-------------------
* Bugfixed `copy()` with symlink overwrite
# 0.8.0 (2016-04-09)
- **(breaking change)** `find()` now distinguishes between files and directories and by default searches only for files (previously searched for both).
- **(breaking change)** `find()` no longer can be configured with `returnAs` parameter and returns always relative paths (previously returned absolute).
- **(breaking change)** `list()` no longer accepts `useInspect` as a parameter. To achieve old behaviour use `jetpack.list()` with `Array.map()`.
- **(deprecation)** Don't do `jetpack.read('sth', 'buf')`, do `jetpack.read('sth', 'buffer')` instead.
- `remove()`, `list()` and `find()` now can be called without provided `path`, and defaults to CWD in that case.
0.7.2 (2016-03-09)
-------------------
* Fixed .dotfiles copying
# 0.7.3 (2016-03-21)
- Bugfixed `copy()` with symlink overwrite
0.7.1 (2015-12-17)
-------------------
* Updated third party dependencies.
# 0.7.2 (2016-03-09)
- Fixed .dotfiles copying
0.7.0 (2015-07-20)
-------------------
* **(breaking change)** `matching` option in `copy()` and `find()` resolves glob patterns to the folder you want copy or find stuff in (previously CWD was used).
# 0.7.1 (2015-12-17)
- Updated third party dependencies.
0.6.5 (2015-06-19)
-------------------
* `exists()` can handle ENOTDIR error.
# 0.7.0 (2015-07-20)
- **(breaking change)** `matching` option in `copy()` and `find()` resolves glob patterns to the folder you want copy or find stuff in (previously CWD was used).
0.6.3 and 0.6.4 (2015-04-18)
-------------------
* Added support for symbolic links.
# 0.6.5 (2015-06-19)
- `exists()` can handle ENOTDIR error.
0.6.2 (2015-04-07)
-------------------
* Option `matching` in `copy()` and `find()` now accepts patterns anchored to CWD.
# 0.6.3 and 0.6.4 (2015-04-18)
- Added support for symbolic links.
0.6.1 (2015-04-03)
-------------------
* Option `matching` in `copy()` and `find()` now accepts negation patterns (e.g. `!some/file.txt`).
# 0.6.2 (2015-04-07)
- Option `matching` in `copy()` and `find()` now accepts patterns anchored to CWD.
0.6.0 (2015-03-30)
-------------------
* Lots of code refactoring
* **(breaking change)** `dir()` no longer has `exists` option.
* **(breaking change)** `file()` no longer has `exists` and `empty` options.
* **(breaking change)** `safe` option for `write()` renamed to `atomic` (and uses new algorithm under the hood).
* **(breaking change)** `safe` option for `read()` dropped (`atomic` while writing is enough).
* **(breaking change)** In `copy()` options `only` and `allBut` have been replaced by option `matching`.
* **(breaking change)** In `remove()` options `only` and `allBut` have been dropped (to do the same use `find()`, and then remove).
* **(breaking change)** Default jsonIndent changed form 0 to 2.
* `find()` method added.
* More telling errors when `read()` failed while parsing JSON.
# 0.6.1 (2015-04-03)
- Option `matching` in `copy()` and `find()` now accepts negation patterns (e.g. `!some/file.txt`).
0.5.3 (2015-01-06)
-------------------
* `inspect()` can return file access/modify/change time and mode.
# 0.6.0 (2015-03-30)
- Lots of code refactoring
- **(breaking change)** `dir()` no longer has `exists` option.
- **(breaking change)** `file()` no longer has `exists` and `empty` options.
- **(breaking change)** `safe` option for `write()` renamed to `atomic` (and uses new algorithm under the hood).
- **(breaking change)** `safe` option for `read()` dropped (`atomic` while writing is enough).
- **(breaking change)** In `copy()` options `only` and `allBut` have been replaced by option `matching`.
- **(breaking change)** In `remove()` options `only` and `allBut` have been dropped (to do the same use `find()`, and then remove).
- **(breaking change)** Default jsonIndent changed form 0 to 2.
- `find()` method added.
- More telling errors when `read()` failed while parsing JSON.
0.5.2 (2014-09-21)
-------------------
* `inspect()` checksum of empty file is now `null`.
# 0.5.3 (2015-01-06)
- `inspect()` can return file access/modify/change time and mode.
0.5.1 (2014-09-21)
-------------------
* `cwd()` accepts many arguments as path parts.
# 0.5.2 (2014-09-21)
- `inspect()` checksum of empty file is now `null`.
0.5.0 (2014-08-31)
-------------------
* **(breaking change)** Method `tree()` renamed to `inspectTree()`.
* **(breaking change)** Parameters passed to `list()` has changed.
* Methods `inspect()` and `inspectTree()` can calculate md5 and sha1 checksums.
* Added aliases to `fs.createReadStream()` and `fs.createWriteStream()`.
# 0.5.1 (2014-09-21)
- `cwd()` accepts many arguments as path parts.
0.4.1 (2014-07-16)
-------------------
* `copy()` now copies also file permissions on unix systems.
* `append()` can specify file mode if file doesn't exist.
* Can indent saved JSON data.
# 0.5.0 (2014-08-31)
- **(breaking change)** Method `tree()` renamed to `inspectTree()`.
- **(breaking change)** Parameters passed to `list()` has changed.
- Methods `inspect()` and `inspectTree()` can calculate md5 and sha1 checksums.
- Added aliases to `fs.createReadStream()` and `fs.createWriteStream()`.
0.4.0 (2014-07-14)
-------------------
* Changelog starts here.
# 0.4.1 (2014-07-16)
- `copy()` now copies also file permissions on unix systems.
- `append()` can specify file mode if file doesn't exist.
- Can indent saved JSON data.
# 0.4.0 (2014-07-14)
- Changelog starts here.

@@ -6,3 +6,13 @@ 'use strict';

var write = require('./write');
var validate = require('./utils/validate');
var validateInput = function (methodName, path, data, options) {
var methodSignature = methodName + '(path, data, [options])';
validate.argument(methodSignature, 'path', path, ['string']);
validate.argument(methodSignature, 'data', data, ['string', 'buffer']);
validate.options(methodSignature, 'options', options, {
mode: ['string', 'number']
});
};
// ---------------------------------------------------------

@@ -54,3 +64,4 @@ // SYNC

exports.validateInput = validateInput;
exports.sync = appendSync;
exports.async = appendAsync;

@@ -12,4 +12,15 @@ 'use strict';

var treeWalker = require('./utils/tree_walker');
var validate = require('./utils/validate');
var write = require('./write');
var validateInput = function (methodName, from, to, options) {
var methodSignature = methodName + '(from, to, [options])';
validate.argument(methodSignature, 'from', from, ['string']);
validate.argument(methodSignature, 'to', to, ['string']);
validate.options(methodSignature, 'options', options, {
overwrite: ['boolean'],
matching: ['string', 'array of string']
});
};
var parseOptions = function (options, from) {

@@ -265,3 +276,4 @@ var opts = options || {};

exports.validateInput = validateInput;
exports.sync = copySync;
exports.async = copyAsync;

@@ -10,3 +10,13 @@ 'use strict';

var modeUtil = require('./utils/mode');
var validate = require('./utils/validate');
var validateInput = function (methodName, path, criteria) {
var methodSignature = methodName + '(path, [criteria])';
validate.argument(methodSignature, 'path', path, ['string']);
validate.options(methodSignature, 'criteria', criteria, {
empty: ['boolean'],
mode: ['string', 'number']
});
};
var getCriteriaDefaults = function (passedCriteria) {

@@ -196,3 +206,4 @@ var criteria = passedCriteria || {};

module.exports.validateInput = validateInput;
module.exports.sync = dirSync;
module.exports.async = dirAsync;

@@ -5,3 +5,9 @@ 'use strict';

var Q = require('q');
var validate = require('./utils/validate');
var validateInput = function (methodName, path) {
var methodSignature = methodName + '(path)';
validate.argument(methodSignature, 'path', path, ['string']);
};
// ---------------------------------------------------------

@@ -60,3 +66,4 @@ // Sync

exports.validateInput = validateInput;
exports.sync = existsSync;
exports.async = existsAsync;

@@ -7,4 +7,15 @@ 'use strict';

var modeUtil = require('./utils/mode');
var validate = require('./utils/validate');
var write = require('./write');
var validateInput = function (methodName, path, criteria) {
var methodSignature = methodName + '(path, [criteria])';
validate.argument(methodSignature, 'path', path, ['string']);
validate.options(methodSignature, 'criteria', criteria, {
content: ['string', 'buffer', 'object', 'array'],
jsonIndent: ['number'],
mode: ['string', 'number']
});
};
var getCriteriaDefaults = function (passedCriteria) {

@@ -194,3 +205,4 @@ var criteria = passedCriteria || {};

exports.validateInput = validateInput;
exports.sync = fileSync;
exports.async = fileAsync;

@@ -8,3 +8,15 @@ 'use strict';

var matcher = require('./utils/matcher');
var validate = require('./utils/validate');
var validateInput = function (methodName, path, options) {
var methodSignature = methodName + '([path], options)';
validate.argument(methodSignature, 'path', path, ['string']);
validate.options(methodSignature, 'options', options, {
matching: ['string', 'array of string'],
files: ['boolean'],
directories: ['boolean'],
recursive: ['boolean']
});
};
var normalizeOptions = function (options) {

@@ -129,3 +141,4 @@ var opts = options || {};

exports.validateInput = validateInput;
exports.sync = findSyncInit;
exports.async = findAsyncInit;

@@ -8,3 +8,19 @@ 'use strict';

var list = require('./list');
var validate = require('./utils/validate');
var validateInput = function (methodName, path, options) {
var methodSignature = methodName + '(path, options)';
validate.argument(methodSignature, 'path', path, ['string']);
validate.options(methodSignature, 'options', options, {
checksum: ['string'],
relativePath: ['boolean']
});
if (options && options.checksum !== undefined
&& inspect.supportedChecksumAlgorithms.indexOf(options.checksum) === -1) {
throw new Error('Argument "options.checksum" passed to ' + methodSignature
+ ' must have one of values: ' + inspect.supportedChecksumAlgorithms.join(', '));
}
};
var generateTreeNodeRelativePath = function (parent, path) {

@@ -142,3 +158,4 @@ if (!parent) {

exports.validateInput = validateInput;
exports.sync = inspectTreeSync;
exports.async = inspectTreeAsync;

@@ -7,3 +7,24 @@ 'use strict';

var Q = require('q');
var validate = require('./utils/validate');
var supportedChecksumAlgorithms = ['md5', 'sha1', 'sha256', 'sha512'];
var validateInput = function (methodName, path, options) {
var methodSignature = methodName + '(path, [options])';
validate.argument(methodSignature, 'path', path, ['string']);
validate.options(methodSignature, 'options', options, {
checksum: ['string'],
mode: ['boolean'],
times: ['boolean'],
absolutePath: ['boolean'],
symlinks: ['boolean']
});
if (options && options.checksum !== undefined
&& supportedChecksumAlgorithms.indexOf(options.checksum) === -1) {
throw new Error('Argument "options.checksum" passed to ' + methodSignature
+ ' must have one of values: ' + supportedChecksumAlgorithms.join(', '));
}
};
var createInspectObj = function (path, options, stat) {

@@ -161,3 +182,5 @@ var obj = {};

exports.supportedChecksumAlgorithms = supportedChecksumAlgorithms;
exports.validateInput = validateInput;
exports.sync = inspectSync;
exports.async = inspectAsync;

@@ -21,2 +21,3 @@ /* eslint no-param-reassign:0 */

var remove = require('./remove');
var rename = require('./rename');
var symlink = require('./symlink');

@@ -73,5 +74,7 @@ var streams = require('./streams');

append: function (path, data, options) {
append.validateInput('append', path, data, options);
append.sync(resolvePath(path), data, options);
},
appendAsync: function (path, data, options) {
append.validateInput('appendAsync', path, data, options);
return append.async(resolvePath(path), data, options);

@@ -81,8 +84,8 @@ },

copy: function (from, to, options) {
var normalizedOptions = normalizeOptions(options);
copy.sync(resolvePath(from), resolvePath(to), normalizedOptions);
copy.validateInput('copy', from, to, options);
copy.sync(resolvePath(from), resolvePath(to), options);
},
copyAsync: function (from, to, options) {
var normalizedOptions = normalizeOptions(options);
return copy.async(resolvePath(from), resolvePath(to), normalizedOptions);
copy.validateInput('copyAsync', from, to, options);
return copy.async(resolvePath(from), resolvePath(to), options);
},

@@ -98,3 +101,5 @@

dir: function (path, criteria) {
var normalizedPath = resolvePath(path);
var normalizedPath;
dir.validateInput('dir', path, criteria);
normalizedPath = resolvePath(path);
dir.sync(normalizedPath, criteria);

@@ -105,3 +110,5 @@ return cwd(normalizedPath);

var deferred = Q.defer();
var normalizedPath = resolvePath(path);
var normalizedPath;
dir.validateInput('dirAsync', path, criteria);
normalizedPath = resolvePath(path);
dir.async(normalizedPath, criteria)

@@ -115,5 +122,7 @@ .then(function () {

exists: function (path) {
exists.validateInput('exists', path);
return exists.sync(resolvePath(path));
},
existsAsync: function (path) {
exists.validateInput('existsAsync', path);
return exists.async(resolvePath(path));

@@ -123,2 +132,3 @@ },

file: function (path, criteria) {
file.validateInput('file', path, criteria);
file.sync(resolvePath(path), criteria);

@@ -130,2 +140,3 @@ return this;

var that = this;
file.validateInput('fileAsync', path, criteria);
file.async(resolvePath(path), criteria)

@@ -141,6 +152,7 @@ .then(function () {

// to proper places and default startPath to CWD.
if (typeof startPath !== 'string') {
if (typeof options === 'undefined' && typeof startPath === 'object') {
options = startPath;
startPath = '.';
}
find.validateInput('find', startPath, options);
return find.sync(resolvePath(startPath), normalizeOptions(options));

@@ -151,6 +163,7 @@ },

// to proper places and default startPath to CWD.
if (typeof startPath !== 'string') {
if (typeof options === 'undefined' && typeof startPath === 'object') {
options = startPath;
startPath = '.';
}
find.validateInput('findAsync', startPath, options);
return find.async(resolvePath(startPath), normalizeOptions(options));

@@ -160,5 +173,7 @@ },

inspect: function (path, fieldsToInclude) {
inspect.validateInput('inspect', path, fieldsToInclude);
return inspect.sync(resolvePath(path), fieldsToInclude);
},
inspectAsync: function (path, fieldsToInclude) {
inspect.validateInput('inspectAsync', path, fieldsToInclude);
return inspect.async(resolvePath(path), fieldsToInclude);

@@ -168,5 +183,7 @@ },

inspectTree: function (path, options) {
inspectTree.validateInput('inspectTree', path, options);
return inspectTree.sync(resolvePath(path), options);
},
inspectTreeAsync: function (path, options) {
inspectTree.validateInput('inspectTreeAsync', path, options);
return inspectTree.async(resolvePath(path), options);

@@ -176,5 +193,7 @@ },

list: function (path) {
list.validateInput('list', path);
return list.sync(resolvePath(path || '.'));
},
listAsync: function (path) {
list.validateInput('listAsync', path);
return list.async(resolvePath(path || '.'));

@@ -184,5 +203,7 @@ },

move: function (from, to) {
move.validateInput('move', from, to);
move.sync(resolvePath(from), resolvePath(to));
},
moveAsync: function (from, to) {
move.validateInput('moveAsync', from, to);
return move.async(resolvePath(from), resolvePath(to));

@@ -192,5 +213,7 @@ },

read: function (path, returnAs) {
read.validateInput('read', path, returnAs);
return read.sync(resolvePath(path), returnAs);
},
readAsync: function (path, returnAs) {
read.validateInput('readAsync', path, returnAs);
return read.async(resolvePath(path), returnAs);

@@ -200,2 +223,3 @@ },

remove: function (path) {
remove.validateInput('remove', path);
// If path not specified defaults to CWD

@@ -205,2 +229,3 @@ remove.sync(resolvePath(path || '.'));

removeAsync: function (path) {
remove.validateInput('removeAsync', path);
// If path not specified defaults to CWD

@@ -211,16 +236,16 @@ return remove.async(resolvePath(path || '.'));

rename: function (path, newName) {
var resolvedPath = resolvePath(path);
var newPath = pathUtil.join(pathUtil.dirname(resolvedPath), newName);
move.sync(resolvedPath, newPath);
rename.validateInput('rename', path, newName);
rename.sync(resolvePath(path), newName);
},
renameAsync: function (path, newName) {
var resolvedPath = resolvePath(path);
var newPath = pathUtil.join(pathUtil.dirname(resolvedPath), newName);
return move.async(resolvedPath, newPath);
rename.validateInput('renameAsync', path, newName);
return rename.async(resolvePath(path), newName);
},
symlink: function (symlinkValue, path) {
symlink.validateInput('symlink', symlinkValue, path);
symlink.sync(symlinkValue, resolvePath(path));
},
symlinkAsync: function (symlinkValue, path) {
symlink.validateInput('symlinkAsync', symlinkValue, path);
return symlink.async(symlinkValue, resolvePath(path));

@@ -230,5 +255,7 @@ },

write: function (path, data, options) {
write.validateInput('write', path, data, options);
write.sync(resolvePath(path), data, options);
},
writeAsync: function (path, data, options) {
write.validateInput('writeAsync', path, data, options);
return write.async(resolvePath(path), data, options);

@@ -235,0 +262,0 @@ }

@@ -5,3 +5,9 @@ 'use strict';

var Q = require('q');
var validate = require('./utils/validate');
var validateInput = function (methodName, path) {
var methodSignature = methodName + '(path)';
validate.argument(methodSignature, 'path', path, ['string', 'undefined']);
};
// ---------------------------------------------------------

@@ -52,3 +58,4 @@ // Sync

exports.validateInput = validateInput;
exports.sync = listSync;
exports.async = listAsync;

@@ -8,3 +8,10 @@ 'use strict';

var exists = require('./exists');
var validate = require('./utils/validate');
var validateInput = function (methodName, from, to) {
var methodSignature = methodName + '(from, to)';
validate.argument(methodSignature, 'from', from, ['string']);
validate.argument(methodSignature, 'to', to, ['string']);
};
var generateSourceDoesntExistError = function (path) {

@@ -105,3 +112,4 @@ var err = new Error("Path to move doesn't exist " + path);

exports.validateInput = validateInput;
exports.sync = moveSync;
exports.async = moveAsync;

@@ -7,3 +7,17 @@ /* eslint no-console:1 */

var Q = require('q');
var validate = require('./utils/validate');
var supportedReturnAs = ['utf8', 'buffer', 'json', 'jsonWithDates'];
var validateInput = function (methodName, path, returnAs) {
var methodSignature = methodName + '(path, returnAs)';
validate.argument(methodSignature, 'path', path, ['string']);
validate.argument(methodSignature, 'returnAs', returnAs, ['string', 'undefined']);
if (returnAs && supportedReturnAs.indexOf(returnAs) === -1) {
throw new Error('Argument "returnAs" passed to ' + methodSignature
+ ' must have one of values: ' + supportedReturnAs.join(', '));
}
};
// Matches strings generated by Date.toJSON()

@@ -39,6 +53,2 @@ // which is called to serialize date to JSON.

encoding = null;
} else if (retAs === 'buf') {
console.warn("[fs-jetpack] DEPRECATION WARNING: Please use 'buffer' " +
"instead of 'buf' in read() method.");
encoding = null;
}

@@ -83,6 +93,2 @@

encoding = null;
} else if (retAs === 'buf') {
console.warn("[fs-jetpack] DEPRECATION WARNING: Please use 'buffer' " +
"instead of 'buf' in read() method.");
encoding = null;
}

@@ -122,3 +128,4 @@

exports.validateInput = validateInput;
exports.sync = readSync;
exports.async = readAsync;

@@ -6,2 +6,9 @@ 'use strict';

var validate = require('./utils/validate');
var validateInput = function (methodName, path) {
var methodSignature = methodName + '([path])';
validate.argument(methodSignature, 'path', path, ['string', 'undefined']);
};
// ---------------------------------------------------------

@@ -29,3 +36,4 @@ // Sync

exports.validateInput = validateInput;
exports.sync = removeSync;
exports.async = removeAsync;

@@ -7,3 +7,10 @@ 'use strict';

var pathUtil = require('path');
var validate = require('./utils/validate');
var validateInput = function (methodName, symlinkValue, path) {
var methodSignature = methodName + '(symlinkValue, path)';
validate.argument(methodSignature, 'symlinkValue', symlinkValue, ['string']);
validate.argument(methodSignature, 'path', path, ['string']);
};
// ---------------------------------------------------------

@@ -59,3 +66,4 @@ // Sync

exports.validateInput = validateInput;
exports.sync = symlinkSync;
exports.async = symlinkAsync;

@@ -7,3 +7,14 @@ 'use strict';

var pathUtil = require('path');
var validate = require('./utils/validate');
var validateInput = function (methodName, path, data, options) {
var methodSignature = methodName + '(path, data, [options])';
validate.argument(methodSignature, 'path', path, ['string']);
validate.argument(methodSignature, 'data', data, ['string', 'buffer', 'object', 'array']);
validate.options(methodSignature, 'options', options, {
atomic: ['boolean'],
jsonIndent: ['number']
});
};
// Temporary file extensions used for atomic file overwriting.

@@ -128,3 +139,4 @@ var newExt = '.__new__';

exports.validateInput = validateInput;
exports.sync = writeSync;
exports.async = writeAsync;
{
"name": "fs-jetpack",
"description": "Better file system API",
"version": "0.10.5",
"version": "0.11.0",
"author": "Jakub Szwacz <jakub@szwacz.com>",

@@ -21,3 +21,4 @@ "dependencies": {

"mocha": "^3.1.2",
"pre-commit": "^1.1.2"
"pre-commit": "^1.1.2",
"release-assist": "^1.0.1"
},

@@ -27,3 +28,5 @@ "scripts": {

"test-with-coverage": "istanbul cover node_modules/.bin/_mocha -- 'spec/**/*.spec.js'",
"lint": "eslint ."
"lint": "eslint .",
"release-start": "release-assist --start",
"release-finish": "release-assist --finish"
},

@@ -45,2 +48,2 @@ "main": "main.js",

]
}
}

@@ -18,16 +18,18 @@ fs-jetpack [![Build Status](https://travis-ci.org/szwacz/fs-jetpack.svg?branch=master)](https://travis-ci.org/szwacz/fs-jetpack) [![Build status](https://ci.appveyor.com/api/projects/status/er206e91fpuuqf58?svg=true)](https://ci.appveyor.com/project/szwacz/fs-jetpack) [![codecov](https://codecov.io/gh/szwacz/fs-jetpack/branch/master/graph/badge.svg)](https://codecov.io/gh/szwacz/fs-jetpack)

# Sync & Async
# API
API has the same set of synchronous and asynchronous methods. All async methods are promise based (no callbacks).
Commonly used naming convention in Node world is reversed in this library (no 'method' and 'methodSync' naming). Asynchronous methods are those with 'Async' suffix, all methods without 'Async' in the name are synchronous. Reason behind this is that it gives very nice look to blocking API, and promise based non-blocking code is verbose anyway, so one more word is not much of a difference.
Commonly used naming convention in Node world is reversed in this library (no 'method' and 'methodSync' naming). Asynchronous methods are those with 'Async' suffix, all methods without 'Async' in the name are synchronous. Reason behind this is that it gives very nice look to blocking API. And promise-based, non-blocking code is verbose anyway, so one more word is not much of a difference.
Also it's just convenient...
If you don't see the word "Async" in method name it returns value immediately.
```js
// If you don't see the word "Async", then method returns value immediately.
var data = jetpack.read('file.txt');
console.log(data);
```
// When you see "Async", method returns promise which when resolved returns value.
When you see "Async" that method returns promise which when resolved returns value.
```js
jetpack.readAsync('file.txt')

@@ -39,3 +41,4 @@ .then(function (data) {

**Methods:**
# API
- [append](#appendpath-data-options)

@@ -65,3 +68,3 @@ - [copy](#copyfrom-to-options)

Appends given data to the end of file. If file (or any parent directory) doesn't exist, creates it/them.
Appends given data to the end of file. If file or any parent directory doesn't exist it will be created.

@@ -169,3 +172,3 @@ **arguments:**

Ensures that directory on given path exists and meets given criteria. If any criterium is not met it will be after this call.
Ensures that directory on given path exists and meets given criteria. If any criterium is not met it will be after this call. If any parent directory in `path` doesn't exist it will be created (like `mkdir -p`).

@@ -212,3 +215,3 @@ **arguments:**

Ensures that file exists and meets given criteria. If any criterium is not met it will be after this call.
Ensures that file exists and meets given criteria. If any criterium is not met it will be after this call. If any parent directory in `path` doesn't exist it will be created (like `mkdir -p`).

@@ -286,3 +289,3 @@ **arguments:**

`options` (optional). Possible values:
* `checksum` if specified will return checksum of inspected file. Possible values are strings `'md5'`, `'sha1'` or `'sha256'`. If given path is directory this field is ignored.
* `checksum` if specified will return checksum of inspected file. Possible values are strings `'md5'`, `'sha1'`, `'sha256'` or `'sha512'`. If given path is directory this field is ignored.
* `mode` (default `false`) if set to `true` will add file mode (unix file permissions) value.

@@ -321,3 +324,3 @@ * `times` (default `false`) if set to `true` will add atime, mtime and ctime fields (here called `accessTime`, `modifyTime` and `changeTime`).

`options` (optional). Possible values:
* `checksum` if specified will also calculate checksum of every item in the tree. Possible values are strings `'md5'`, `'sha1'` or `'sha256'`. Checksums for directories are calculated as checksum of all children' checksums plus their filenames (see example below).
* `checksum` if specified will also calculate checksum of every item in the tree. Possible values are strings `'md5'`, `'sha1'`, `'sha256'` or `'sha512'`. Checksums for directories are calculated as checksum of all children' checksums plus their filenames (see example below).
* `relativePath` if set to `true` every tree node will have relative path anchored to root inspected folder.

@@ -410,3 +413,2 @@

* `'buffer'` content will be returned as a Buffer.
* `'buf'` **deprecated** use `'buffer'` instead.
* `'json'` content will be returned as parsed JSON object.

@@ -422,3 +424,3 @@ * `'jsonWithDates'` content will be returned as parsed JSON object, and date strings in [ISO format](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) will be automatically turned into Date objects.

Deletes given path, no matter what it is (file or directory). If path already doesn't exist ends without throwing, so you can use it as 'ensure path doesn't exist'.
Deletes given path, no matter what it is (file, directory or non-empty directory). If path already doesn't exist terminates gracefully without throwing, so you can use it as 'ensure path doesn't exist'.

@@ -480,3 +482,3 @@ **arguments:**

Writes data to file.
Writes data to file. If any parent directory in `path` doesn't exist it will be created (like `mkdir -p`).

@@ -509,1 +511,5 @@ **arguments:**

*(explanation borrowed from [glob](https://github.com/isaacs/node-glob) which is using [the same matching library](https://github.com/isaacs/minimatch) as this project)*
# License
Released under the MIT license.
var fse = require('fs-extra');
var expect = require('chai').expect;
var path = require('./assert_path');

@@ -125,2 +126,44 @@ var helper = require('./helper');

describe('input validation', function () {
var tests = [
{ type: 'sync', method: jetpack.append, methodName: 'append' },
{ type: 'async', method: jetpack.appendAsync, methodName: 'appendAsync' }
];
describe('"path" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method(undefined, 'xyz');
}).to.throw('Argument "path" passed to ' + test.methodName
+ '(path, data, [options]) must be a string. Received undefined');
});
});
});
describe('"data" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method('abc');
}).to.throw('Argument "data" passed to ' + test.methodName
+ '(path, data, [options]) must be a string or a buffer. Received undefined');
});
});
});
describe('"options" object', function () {
describe('"mode" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method('abc', 'xyz', { mode: true });
}).to.throw('Argument "options.mode" passed to ' + test.methodName
+ '(path, data, [options]) must be a string or a number. Received boolean');
});
});
});
});
});
if (process.platform !== 'win32') {

@@ -127,0 +170,0 @@ describe('sets file mode on created file (unix only)', function () {

@@ -514,2 +514,54 @@ var fse = require('fs-extra');

}
describe('input validation', function () {
var tests = [
{ type: 'sync', method: jetpack.copy, methodName: 'copy' },
{ type: 'async', method: jetpack.copyAsync, methodName: 'copyAsync' }
];
describe('"from" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method(undefined, 'xyz');
}).to.throw('Argument "from" passed to ' + test.methodName
+ '(from, to, [options]) must be a string. Received undefined');
});
});
});
describe('"to" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method('abc');
}).to.throw('Argument "to" passed to ' + test.methodName
+ '(from, to, [options]) must be a string. Received undefined');
});
});
});
describe('"options" object', function () {
describe('"overwrite" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method('abc', 'xyz', { overwrite: 1 });
}).to.throw('Argument "options.overwrite" passed to ' + test.methodName
+ '(from, to, [options]) must be a boolean. Received number');
});
});
});
describe('"matching" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method('abc', 'xyz', { matching: 1 });
}).to.throw('Argument "options.matching" passed to ' + test.methodName
+ '(from, to, [options]) must be a string or an array of string. Received number');
});
});
});
});
});
});

@@ -318,2 +318,43 @@ var fse = require('fs-extra');

}
describe('input validation', function () {
var tests = [
{ type: 'sync', method: jetpack.dir, methodName: 'dir' },
{ type: 'async', method: jetpack.dirAsync, methodName: 'dirAsync' }
];
describe('"path" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method(undefined);
}).to.throw('Argument "path" passed to ' + test.methodName
+ '(path, [criteria]) must be a string. Received undefined');
});
});
});
describe('"criteria" object', function () {
describe('"empty" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method('abc', { empty: 1 });
}).to.throw('Argument "criteria.empty" passed to ' + test.methodName
+ '(path, [criteria]) must be a boolean. Received number');
});
});
});
describe('"mode" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method('abc', { mode: true });
}).to.throw('Argument "criteria.mode" passed to ' + test.methodName
+ '(path, [criteria]) must be a string or a number. Received boolean');
});
});
});
});
});
});

@@ -131,2 +131,20 @@ var fse = require('fs-extra');

});
describe('input validation', function () {
var tests = [
{ type: 'sync', method: jetpack.exists, methodName: 'exists' },
{ type: 'async', method: jetpack.existsAsync, methodName: 'existsAsync' }
];
describe('"path" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method(undefined);
}).to.throw('Argument "path" passed to ' + test.methodName
+ '(path) must be a string. Received undefined');
});
});
});
});
});

@@ -394,2 +394,54 @@ var fse = require('fs-extra');

}
describe('input validation', function () {
var tests = [
{ type: 'sync', method: jetpack.file, methodName: 'file' },
{ type: 'async', method: jetpack.fileAsync, methodName: 'fileAsync' }
];
describe('"path" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method(undefined);
}).to.throw('Argument "path" passed to ' + test.methodName
+ '(path, [criteria]) must be a string. Received undefined');
});
});
});
describe('"criteria" object', function () {
describe('"content" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method('abc', { content: 1 });
}).to.throw('Argument "criteria.content" passed to ' + test.methodName
+ '(path, [criteria]) must be a string or a buffer or an object or '
+ 'an array. Received number');
});
});
});
describe('"jsonIndent" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method('abc', { jsonIndent: true });
}).to.throw('Argument "criteria.jsonIndent" passed to ' + test.methodName
+ '(path, [criteria]) must be a number. Received boolean');
});
});
});
describe('"mode" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method('abc', { mode: true });
}).to.throw('Argument "criteria.mode" passed to ' + test.methodName
+ '(path, [criteria]) must be a string or a number. Received boolean');
});
});
});
});
});
});

@@ -516,2 +516,63 @@ var fse = require('fs-extra');

});
describe('input validation', function () {
var tests = [
{ type: 'sync', method: jetpack.find, methodName: 'find' },
{ type: 'async', method: jetpack.findAsync, methodName: 'findAsync' }
];
describe('"path" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method(undefined, {});
}).to.throw('Argument "path" passed to ' + test.methodName
+ '([path], options) must be a string. Received undefined');
});
});
});
describe('"options" object', function () {
describe('"matching" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method({ matching: 1 });
}).to.throw('Argument "options.matching" passed to ' + test.methodName
+ '([path], options) must be a string or an array of string. Received number');
});
});
});
describe('"files" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method('abc', { files: 1 });
}).to.throw('Argument "options.files" passed to ' + test.methodName
+ '([path], options) must be a boolean. Received number');
});
});
});
describe('"directories" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method('abc', { directories: 1 });
}).to.throw('Argument "options.directories" passed to ' + test.methodName
+ '([path], options) must be a boolean. Received number');
});
});
});
describe('"recursive" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method('abc', { recursive: 1 });
}).to.throw('Argument "options.recursive" passed to ' + test.methodName
+ '([path], options) must be a boolean. Received number');
});
});
});
});
});
});

@@ -334,2 +334,49 @@ var fse = require('fs-extra');

});
describe('input validation', function () {
var tests = [
{ type: 'sync', method: jetpack.inspectTree, methodName: 'inspectTree' },
{ type: 'async', method: jetpack.inspectTreeAsync, methodName: 'inspectTreeAsync' }
];
describe('"path" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method(undefined);
}).to.throw('Argument "path" passed to ' + test.methodName
+ '(path, options) must be a string. Received undefined');
});
});
});
describe('"options" object', function () {
describe('"checksum" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method('abc', { checksum: 1 });
}).to.throw('Argument "options.checksum" passed to ' + test.methodName
+ '(path, options) must be a string. Received number');
});
it(test.type, function () {
expect(function () {
test.method('abc', { checksum: 'foo' });
}).to.throw('Argument "options.checksum" passed to ' + test.methodName
+ '(path, options) must have one of values: md5, sha1, sha256');
});
});
});
describe('"relativePath" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method('abc', { relativePath: 1 });
}).to.throw('Argument "options.relativePath" passed to ' + test.methodName
+ '(path, options) must be a boolean. Received number');
});
});
});
});
});
});

@@ -268,2 +268,9 @@ var fse = require('fs-extra');

{
name: 'sha512',
type: 'sha512',
content: 'abc',
expected: 'ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a21'
+ '92992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f'
},
{
name: 'calculates correctly checksum of an empty file',

@@ -297,7 +304,85 @@ type: 'md5',

done();
})
.catch(done);
});
});
});
});
describe('input validation', function () {
var tests = [
{ type: 'sync', method: jetpack.inspect, methodName: 'inspect' },
{ type: 'async', method: jetpack.inspectAsync, methodName: 'inspectAsync' }
];
describe('"path" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method(undefined);
}).to.throw('Argument "path" passed to ' + test.methodName
+ '(path, [options]) must be a string. Received undefined');
});
});
});
describe('"options" object', function () {
describe('"checksum" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method('abc', { checksum: 1 });
}).to.throw('Argument "options.checksum" passed to ' + test.methodName
+ '(path, [options]) must be a string. Received number');
});
it(test.type, function () {
expect(function () {
test.method('abc', { checksum: 'foo' });
}).to.throw('Argument "options.checksum" passed to ' + test.methodName
+ '(path, [options]) must have one of values: md5, sha1, sha256');
});
});
});
describe('"mode" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method('abc', { mode: 1 });
}).to.throw('Argument "options.mode" passed to ' + test.methodName
+ '(path, [options]) must be a boolean. Received number');
});
});
});
describe('"times" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method('abc', { times: 1 });
}).to.throw('Argument "options.times" passed to ' + test.methodName
+ '(path, [options]) must be a boolean. Received number');
});
});
});
describe('"absolutePath" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method('abc', { absolutePath: 1 });
}).to.throw('Argument "options.absolutePath" passed to ' + test.methodName
+ '(path, [options]) must be a boolean. Received number');
});
});
});
describe('"symlinks" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method('abc', { symlinks: 1 });
}).to.throw('Argument "options.symlinks" passed to ' + test.methodName
+ '(path, [options]) must be a boolean. Received number');
});
});
});
});
});
});

@@ -136,2 +136,20 @@ var fse = require('fs-extra');

});
describe('input validation', function () {
var tests = [
{ type: 'sync', method: jetpack.list, methodName: 'list' },
{ type: 'async', method: jetpack.listAsync, methodName: 'listAsync' }
];
describe('"path" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method(true);
}).to.throw('Argument "path" passed to ' + test.methodName
+ '(path) must be a string or an undefined. Received boolean');
});
});
});
});
});

@@ -141,2 +141,31 @@ var fse = require('fs-extra');

});
describe('input validation', function () {
var tests = [
{ type: 'sync', method: jetpack.move, methodName: 'move' },
{ type: 'async', method: jetpack.moveAsync, methodName: 'moveAsync' }
];
describe('"from" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method(undefined, 'xyz');
}).to.throw('Argument "from" passed to ' + test.methodName
+ '(from, to) must be a string. Received undefined');
});
});
});
describe('"to" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method('abc', undefined);
}).to.throw('Argument "to" passed to ' + test.methodName
+ '(from, to) must be a string. Received undefined');
});
});
});
});
});

@@ -67,29 +67,2 @@ var Q = require('q');

describe('reads file as a Buffer (deprecated)', function () {
var preparations = function () {
fse.outputFileSync('file.txt', new Buffer([11, 22]));
};
var expectations = function (content) {
expect(Buffer.isBuffer(content)).to.equal(true);
expect(content.length).to.equal(2);
expect(content[0]).to.equal(11);
expect(content[1]).to.equal(22);
};
it('sync', function () {
preparations();
expectations(jetpack.read('file.txt', 'buf'));
});
it('async', function (done) {
preparations();
jetpack.readAsync('file.txt', 'buf')
.then(function (content) {
expectations(content);
done();
});
});
});
describe('reads file as JSON', function () {

@@ -260,2 +233,35 @@ var obj = {

});
describe('input validation', function () {
var tests = [
{ type: 'sync', method: jetpack.read, methodName: 'read' },
{ type: 'async', method: jetpack.readAsync, methodName: 'readAsync' }
];
describe('"path" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method(undefined, 'xyz');
}).to.throw('Argument "path" passed to ' + test.methodName
+ '(path, returnAs) must be a string. Received undefined');
});
});
});
describe('"returnAs" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method('abc', true);
}).to.throw('Argument "returnAs" passed to ' + test.methodName
+ '(path, returnAs) must be a string or an undefined. Received boolean');
expect(function () {
test.method('abc', 'foo');
}).to.throw('Argument "returnAs" passed to ' + test.methodName
+ '(path, returnAs) must have one of values: utf8, buffer, json, jsonWithDates');
});
});
});
});
});

@@ -160,2 +160,20 @@ var fse = require('fs-extra');

});
describe('input validation', function () {
var tests = [
{ type: 'sync', method: jetpack.remove, methodName: 'remove' },
{ type: 'async', method: jetpack.removeAsync, methodName: 'removeAsync' }
];
describe('"path" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method(true);
}).to.throw('Argument "path" passed to ' + test.methodName
+ '([path]) must be a string or an undefined. Received boolean');
});
});
});
});
});
var fse = require('fs-extra');
var expect = require('chai').expect;
var path = require('./assert_path');

@@ -89,2 +90,31 @@ var helper = require('./helper');

});
describe('input validation', function () {
var tests = [
{ type: 'sync', method: jetpack.rename, methodName: 'rename' },
{ type: 'async', method: jetpack.renameAsync, methodName: 'renameAsync' }
];
describe('"path" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method(undefined, 'xyz');
}).to.throw('Argument "path" passed to ' + test.methodName
+ '(path, newName) must be a string. Received undefined');
});
});
});
describe('"newName" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method('abc', undefined);
}).to.throw('Argument "newName" passed to ' + test.methodName
+ '(path, newName) must be a string. Received undefined');
});
});
});
});
});

@@ -75,2 +75,31 @@ var fse = require('fs-extra');

});
describe('input validation', function () {
var tests = [
{ type: 'sync', method: jetpack.symlink, methodName: 'symlink' },
{ type: 'async', method: jetpack.symlinkAsync, methodName: 'symlinkAsync' }
];
describe('"symlinkValue" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method(undefined, 'abc');
}).to.throw('Argument "symlinkValue" passed to ' + test.methodName
+ '(symlinkValue, path) must be a string. Received undefined');
});
});
});
describe('"path" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method('xyz', undefined);
}).to.throw('Argument "path" passed to ' + test.methodName
+ '(symlinkValue, path) must be a string. Received undefined');
});
});
});
});
});

@@ -170,2 +170,55 @@ var Q = require('q');

});
describe('input validation', function () {
var tests = [
{ type: 'sync', method: jetpack.write, methodName: 'write' },
{ type: 'async', method: jetpack.writeAsync, methodName: 'writeAsync' }
];
describe('"path" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method(undefined);
}).to.throw('Argument "path" passed to ' + test.methodName
+ '(path, data, [options]) must be a string. Received undefined');
});
});
});
describe('"data" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method('abc', true);
}).to.throw('Argument "data" passed to ' + test.methodName
+ '(path, data, [options]) must be a string or a buffer or an object or '
+ 'an array. Received boolean');
});
});
});
describe('"options" object', function () {
describe('"atomic" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method('abc', 'xyz', { atomic: 1 });
}).to.throw('Argument "options.atomic" passed to ' + test.methodName
+ '(path, data, [options]) must be a boolean. Received number');
});
});
});
describe('"jsonIndent" argument', function () {
tests.forEach(function (test) {
it(test.type, function () {
expect(function () {
test.method('abc', 'xyz', { jsonIndent: true });
}).to.throw('Argument "options.jsonIndent" passed to ' + test.methodName
+ '(path, data, [options]) must be a number. Received boolean');
});
});
});
});
});
});

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc