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

@platformatic/metaconfig

Package Overview
Dependencies
Maintainers
6
Versions
128
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@platformatic/metaconfig - npm Package Compare versions

Comparing version 0.45.1 to 0.46.0

errors.js

14

metaconfig.js

@@ -10,2 +10,3 @@ 'use strict'

const FromZeroEighteenToWillSee = require('./versions/from-zero-eighteen-to-will-see.js')
const errors = require('./errors.js')

@@ -27,7 +28,7 @@ const ranges = [{

} else {
throw new Error('missing file or config to analyze')
throw new errors.MissingFileOrConfigError()
}
if (!data.$schema) {
throw new Error('missing $schema, unable to determine the version')
throw new errors.MissingSchemaError()
}

@@ -47,3 +48,3 @@

if (!res) {
throw new Error('unable to determine the version')
throw new errors.UnableToDetermineVersionError()
}

@@ -83,3 +84,3 @@

if (!Handler) {
throw new Error('unable to determine the version')
throw new errors.UnableToDetermineVersionError()
}

@@ -106,3 +107,3 @@ }

default:
throw new Error('Invalid config file extension. Only yml, yaml, json, json5, toml, tml are supported.')
throw new errors.InvalidConfigFileExtensionError()
}

@@ -126,3 +127,3 @@ }

default:
throw new Error('Invalid config file extension. Only yml, yaml, json, json5, toml, tml are supported.')
throw new errors.InvalidConfigFileExtensionError()
}

@@ -149,1 +150,2 @@ }

module.exports.upgrade = upgrade
module.exports.errors = errors
{
"name": "@platformatic/metaconfig",
"version": "0.45.1",
"version": "0.46.0",
"main": "metaconfig.js",

@@ -22,2 +22,3 @@ "description": "Manage mulitple configuration versions at the same time",

"dependencies": {
"@fastify/error": "^3.2.1",
"@iarna/toml": "^2.2.5",

@@ -24,0 +25,0 @@ "json5": "^2.2.3",

@@ -14,2 +14,3 @@ 'use strict'

const semver = require('semver')
const createError = require('@fastify/error')

@@ -63,7 +64,9 @@ test('throws if no config or file is provided', async (t) => {

test('throws if the stringifier is unknown', async (t) => {
t.throws(() => { getStringifier('file.foo') }, new Error('Invalid config file extension. Only yml, yaml, json, json5, toml, tml are supported.'))
const expectedError = new (createError('PLT_SQL_METACONFIG_INVALID_CONFIG_FILE_EXTENSION', 'Invalid config file extension. Only yml, yaml, json, json5, toml, tml are supported.'))()
t.throws(() => { getStringifier('file.foo') }, expectedError)
})
test('throws if the parser is unknown', async (t) => {
t.throws(() => { getParser('file.foo') }, new Error('Invalid config file extension. Only yml, yaml, json, json5, toml, tml are supported.'))
const expectedError = new (createError('PLT_SQL_METACONFIG_INVALID_CONFIG_FILE_EXTENSION', 'Invalid config file extension. Only yml, yaml, json, json5, toml, tml are supported.'))()
t.throws(() => { getParser('file.foo') }, expectedError)
})

@@ -70,0 +73,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