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

@platformatic/config

Package Overview
Dependencies
Maintainers
6
Versions
293
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@platformatic/config - npm Package Compare versions

Comparing version 1.5.2 to 1.6.0

31

lib/manager.js
'use strict'
const { basename, join, resolve, dirname, parse } = require('path')
const { readFile, access } = require('fs/promises')
const EventEmitter = require('events')
const { basename, join, resolve, dirname, parse } = require('node:path')
const { readFile, access } = require('node:fs/promises')
const EventEmitter = require('node:events')
const { createRequire } = require('node:module')
const Ajv = require('ajv')

@@ -150,2 +151,3 @@ const fastifyPlugin = require('./plugin')

}
/* c8 ignore next 3 */
} catch {

@@ -196,2 +198,23 @@ // Ignore error.

})
ajv.addKeyword({
keyword: 'resolveModule',
type: 'string',
schemaType: 'boolean',
// TODO: figure out how to implement this via the new `code`
// option in Ajv
validate: (schema, path, parentSchema, data) => {
if (typeof path !== 'string' || path.trim() === '') {
return false
}
const toRequire = this.fullPath || join(this.dirname, 'foo')
const _require = createRequire(toRequire)
try {
const resolved = _require.resolve(path)
data.parentData[data.parentDataProperty] = resolved
return true
} catch {
return false
}
}
})
const ajvValidate = ajv.compile(this.schema)

@@ -213,3 +236,3 @@

/* istanbul ignore next */
/* c8 ignore next 8 */
async parseAndValidate () {

@@ -216,0 +239,0 @@ const validationResult = await this.parse()

8

package.json
{
"name": "@platformatic/config",
"version": "1.5.2",
"version": "1.6.0",
"description": "Platformatic DB Config Manager",

@@ -35,9 +35,9 @@ "main": "index.js",

"undici": "^5.25.4",
"@platformatic/metaconfig": "1.5.2",
"@platformatic/utils": "1.5.2"
"@platformatic/metaconfig": "1.6.0",
"@platformatic/utils": "1.6.0"
},
"scripts": {
"test": "standard | snazzy && c8 node ./test/runner.js",
"test": "standard | snazzy && c8 --100 node ./test/runner.js",
"lint": "standard | snazzy"
}
}
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