New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@netlify/config

Package Overview
Dependencies
Maintainers
13
Versions
438
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@netlify/config - npm Package Compare versions

Comparing version 0.4.7 to 0.4.8

2

package.json
{
"name": "@netlify/config",
"version": "0.4.7",
"version": "0.4.8",
"description": "Netlify config module",

@@ -5,0 +5,0 @@ "main": "src/main.js",

@@ -10,5 +10,6 @@ const mapObj = require('map-obj')

const normalizeConfig = function(config) {
const configA = deepMerge(DEFAULT_CONFIG, config)
const configB = normalizeLifecycle({ config: configA })
return configB
const { build, plugins, ...configA } = deepMerge(DEFAULT_CONFIG, config)
const buildA = normalizeBuild(build)
const pluginsA = plugins.map(normalizePlugin)
return { ...configA, build: buildA, plugins: pluginsA }
}

@@ -21,28 +22,22 @@

const normalizeLifecycle = function({
config,
config: {
build: { command, lifecycle, ...build },
plugins,
},
}) {
const lifecycleA = normalizeOnBuild(lifecycle, command)
// Normalize `build` property
const normalizeBuild = function({ command, lifecycle, ...build }) {
const lifecycleA = normalizeOnBuild(command, lifecycle)
const lifecycleB = mapObj(lifecycleA, normalizeEvent)
const pluginsA = plugins.map(normalizePlugin)
return { ...config, build: { ...build, lifecycle: lifecycleB }, plugins: pluginsA }
return { ...build, lifecycle: lifecycleB }
}
// `build.lifecycle.onBuild` was previously called `build.command`
const normalizeOnBuild = function(lifecycle, command) {
if (command === undefined) {
const normalizeOnBuild = function(command, { onBuild = command, ...lifecycle }) {
if (onBuild === undefined) {
return lifecycle
}
return { ...lifecycle, onBuild: command }
return { ...lifecycle, onBuild }
}
const normalizeEvent = function(event, bashCommands) {
const normalizeEvent = function(event, bashCommand) {
const eventA = normalizeEventHandler(event)
const eventB = LEGACY_EVENTS[eventA] === undefined ? eventA : LEGACY_EVENTS[eventA]
return [eventB, bashCommands]
return [eventB, bashCommand]
}

@@ -49,0 +44,0 @@

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