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

nuxt-typo3-config

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nuxt-typo3-config - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

test/fixture/apimock.js

3

.eslintrc.js
module.exports = {
env: {
node: true,
"jest/globals": true
'jest/globals': true
},
plugins: ['jest'],
extends: ['macopedia'],

@@ -7,0 +8,0 @@ rules: {

module.exports = {
presets: [['@babel/preset-env', {targets: {node: 'current'}}]],
};
presets: [['@babel/preset-env', { targets: { node: 'current' } }]]
}
import path from 'path'
import fs from 'fs'
import https from 'https'
import defu from 'defu'
const debug = process.env.ENV_CONFIG_DEBUG

@@ -12,9 +13,8 @@

*/
export default function loadConfiguration (config = 'production', dir = 'config') {
export default function loadConfiguration (
config = 'production',
dir = 'config'
) {
const envConfig = process.env.ENV_CONFIG || config
const envConfigPath = path.resolve(
process.cwd(),
dir,
`.env.${envConfig}`
)
const envConfigPath = path.resolve(process.cwd(), dir, `.env.${envConfig}`)

@@ -89,3 +89,3 @@ const jsonConfigPath = path.resolve(

return Object.assign(env, typo3Config)
return defu(env, typo3Config)
}

@@ -92,0 +92,0 @@

{
"name": "nuxt-typo3-config",
"version": "1.0.0",
"version": "1.1.0",
"main": "index.js",

@@ -17,2 +17,3 @@ "license": "MIT",

"babel-jest": "^27.1.1",
"defu": "^5.0.0",
"eslint": "^7.32.0",

@@ -22,4 +23,5 @@ "eslint-config-macopedia": "^0.2.0",

"jest": "^27.1.1",
"nock": "^13.1.3",
"typescript": "^4.4.2"
}
}
import loadConfiguration, { getConfiguration } from '../index'
import path from 'path'
import './fixture/apimock'

@@ -20,12 +21,27 @@ it('should get production config by default ', () => {

it('should get configuration from TYPO3 API', async () => {
const env = await getConfiguration(undefined, path.resolve(__dirname, 'fixture'))
const env = await getConfiguration(
undefined,
path.resolve(__dirname, 'fixture')
)
expect(env.typo3.domains).toHaveLength(1)
})
it('should get configuration from TYPO3 API and merge with local json file', async () => {
const env = await getConfiguration(
'stage',
path.resolve(__dirname, 'fixture')
)
expect(env.typo3.domains).toHaveLength(2)
})
it('should throw error when config doesnt exist', async () => {
try {
loadConfiguration('notexistconfiguration', path.resolve(__dirname, 'fixture'))
loadConfiguration(
'notexistconfiguration',
path.resolve(__dirname, 'fixture')
)
} catch (error) {
expect(error).toBeInstanceOf(Error);
}
})
expect(error).toBeInstanceOf(Error)
}
})

Sorry, the diff of this file is not supported yet

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