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

@platformatic/utils

Package Overview
Dependencies
Maintainers
7
Versions
290
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@platformatic/utils - npm Package Compare versions

Comparing version 2.0.0-alpha.15 to 2.0.0-alpha.16

lib/schema.js

3

index.js

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

const match = require('./lib/match')
const schemaComponents = require('./lib/fastify-schema')
const schemaComponents = require('./lib/schema')
const { createDirectory, safeRemove } = require('./lib/directory')

@@ -36,2 +36,3 @@ const { withResolvers } = require('./lib/promises')

module.exports.errors = errors
module.exports.ensureLoggableError = errors.ensureLoggableError
module.exports.match = match

@@ -38,0 +39,0 @@ module.exports.schemaComponents = schemaComponents

@@ -8,12 +8,27 @@ 'use strict'

#write
#ignoreEmpty
#hadOutput
constructor (options) {
const { pino, level, ...opts } = options
const { pino, level, ignoreEmpty, ...opts } = options
super({ ...opts, decodeStrings: false })
this.#write = pino[level].bind(pino)
this.#ignoreEmpty = ignoreEmpty
this.#hadOutput = false
}
_write (chunk, encoding, callback) {
this.#write({ raw: encoding === 'buffer' ? inspect(chunk) : chunk.toString(encoding ?? 'utf-8') })
const raw = encoding === 'buffer' ? inspect(chunk) : chunk.toString(encoding ?? 'utf-8')
if (raw.trim().length === 0) {
if (this.#ignoreEmpty && !this.#hadOutput) {
callback()
return
}
} else {
this.#hadOutput = true
}
this.#write({ raw })
callback()

@@ -25,4 +40,4 @@ }

function createPinoWritable (pino, level) {
const writable = new PinoWritable({ pino, level })
function createPinoWritable (pino, level, ignoreEmpty) {
const writable = new PinoWritable({ pino, level, ignoreEmpty })
writable.write = writable.write.bind(writable)

@@ -29,0 +44,0 @@ return writable

{
"name": "@platformatic/utils",
"version": "2.0.0-alpha.15",
"version": "2.0.0-alpha.16",
"description": "Platformatic Utils",

@@ -5,0 +5,0 @@ "main": "index.js",

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