Socket
Socket
Sign inDemoInstall

@sanity/util

Package Overview
Dependencies
2
Maintainers
7
Versions
1272
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.103.6 to 0.103.7

yarn.lock

17

lib/reduceConfig.js

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

var _lodash = require('lodash.merge');
var _lodash = require('lodash');
var _lodash2 = _interopRequireDefault(_lodash);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const sanityEnv = process.env.SANITY_ENV || 'production'; // eslint-disable-line no-process-env

@@ -20,2 +16,11 @@ const apiHosts = {

function merge(objValue, srcValue, key) {
if (Array.isArray(objValue)) {
return objValue.concat(srcValue);
}
// Pass on to default merging strategy
return undefined;
}
exports.default = function (rawConfig) {

@@ -27,5 +32,5 @@ let env = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'development';

const envConfig = (rawConfig.env || {})[env] || {};
const config = (0, _lodash2.default)({}, rawConfig, envConfig, sanityConf);
const config = (0, _lodash.mergeWith)({}, rawConfig, envConfig, sanityConf, merge);
delete config.env;
return config;
};
{
"name": "@sanity/util",
"version": "0.103.6",
"version": "0.103.7",
"description": "Utilities shared across projects of Sanity",

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

"fs-promise": "^0.5.0",
"lodash.merge": "^4.6.0"
"lodash": "^4.17.4"
},

@@ -29,0 +29,0 @@ "devDependencies": {

@@ -39,3 +39,14 @@ import {describe, it} from 'mocha'

})
it('concats arrays', () => {
const reduced = reduceConfig({
root: true,
plugins: ['@sanity/base', '@sanity/components'],
env: {development: {plugins: ['vision']}}
}, 'development')
expect(reduced.root, true)
expect(reduced.plugins).to.deep.equal(['@sanity/base', '@sanity/components', 'vision'])
})
})
})
SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc