Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sanity/util

Package Overview
Dependencies
Maintainers
7
Versions
1357
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sanity/util - npm Package Compare versions

Comparing version 0.113.7 to 0.115.0-alpha.d2d05de5

6

lib/addPluginToManifest.js

@@ -11,5 +11,5 @@ 'use strict';

var _fsPromise = require('fs-promise');
var _fsExtra = require('fs-extra');
var _fsPromise2 = _interopRequireDefault(_fsPromise);
var _fsExtra2 = _interopRequireDefault(_fsExtra);

@@ -28,4 +28,4 @@ var _readLocalManifest = require('./readLocalManifest');

return manifest;
}).then(manifest => _fsPromise2.default.writeJson(_path2.default.join(sanityDir, 'sanity.json'), manifest, { spaces: 2 }));
}).then(manifest => _fsExtra2.default.writeJson(_path2.default.join(sanityDir, 'sanity.json'), manifest, { spaces: 2 }));
exports.default = addPluginToManifest;

@@ -12,3 +12,3 @@ 'use strict';

try {
return _fsPromise2.default.readJson(_path2.default.join(dirName, fileName));
return _fsExtra2.default.readJson(_path2.default.join(dirName, fileName));
} catch (err) {

@@ -28,5 +28,5 @@ if (err.code === 'ENOENT') {

var _fsPromise = require('fs-promise');
var _fsExtra = require('fs-extra');
var _fsPromise2 = _interopRequireDefault(_fsPromise);
var _fsExtra2 = _interopRequireDefault(_fsExtra);

@@ -33,0 +33,0 @@ var _path = require('path');

@@ -6,31 +6,21 @@ 'use strict';

});
exports.loadJson = undefined;
let loadJson = exports.loadJson = (() => {
var _ref = _asyncToGenerator(function* (file, defaultVal) {
return _fsPromise2.default.readJson(file).catch(function () {
return defaultVal;
});
});
return function loadJson(_x, _x2) {
return _ref.apply(this, arguments);
};
})();
exports.loadJsonSync = loadJsonSync;
exports.loadJson = loadJson;
exports.parseJson = parseJson;
var _fsPromise = require('fs-promise');
var _fsExtra = require('fs-extra');
var _fsPromise2 = _interopRequireDefault(_fsPromise);
var _fsExtra2 = _interopRequireDefault(_fsExtra);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }
function loadJsonSync(file, defaultVal) {
return _fsPromise2.default.readJsonSync(file, { throws: false }) || defaultVal;
// eslint-disable-next-line no-sync
return _fsExtra2.default.readJsonSync(file, { throws: false }) || defaultVal;
}
function loadJson(file, defaultVal) {
return _fsExtra2.default.readJson(file).catch(() => defaultVal);
}
function parseJson(json, defaultVal) {

@@ -37,0 +27,0 @@ try {

{
"name": "@sanity/util",
"version": "0.113.7",
"version": "0.115.0-alpha.d2d05de5",
"description": "Utilities shared across projects of Sanity",

@@ -25,3 +25,3 @@ "main": "lib/index.js",

"dependencies": {
"fs-promise": "^2.0.0",
"fs-extra": "^4.0.2",
"lodash": "^4.17.4",

@@ -37,3 +37,3 @@ "resolve-from": "^4.0.0"

"eslint": "^4.6.1",
"eslint-config-sanity": "^3.0.1",
"eslint-config-sanity": "^3.1.0",
"mocha": "^3.2.0",

@@ -40,0 +40,0 @@ "rimraf": "^2.6.1"

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