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

pino

Package Overview
Dependencies
Maintainers
2
Versions
311
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pino - npm Package Compare versions

Comparing version 2.12.4 to 2.13.0

test/escaping.test.js

2

package.json
{
"name": "pino",
"version": "2.12.4",
"version": "2.13.0",
"description": "fast and simple logger",

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

@@ -204,3 +204,8 @@ 'use strict'

function fastRep (s) {
// magically escape strings for json
// relying on their charCodeAt
// everything below 32 needs JSON.stringify()
// 34 and 92 happens all the time, so we
// have a fast case for them
function escape (s) {
var str = s.toString()

@@ -210,5 +215,7 @@ var result = ''

var l = str.length
for (var i = 0; i < l; i++) {
if (str[i] === '"') {
result += str.slice(last, i) + '\\"'
var point = 255
for (var i = 0; i < l && point >= 32; i++) {
point = str.charCodeAt(i)
if (point === 34 || point === 92) {
result += str.slice(last, i) + '\\' + str[i]
last = i + 1

@@ -222,3 +229,3 @@ }

}
return result
return point < 32 ? JSON.stringify(str) : '"' + result + '"'
}

@@ -234,3 +241,3 @@

if (msg != undefined) {
data += ',"msg":"' + fastRep(msg) + '"'
data += ',"msg":' + escape(msg)
}

@@ -237,0 +244,0 @@ var value

![banner](pino-banner.png)
# pino&nbsp;&nbsp;[![Build Status](https://travis-ci.org/mcollina/pino.svg)](https://travis-ci.org/mcollina/pino)&nbsp;[![Coverage Status](https://coveralls.io/repos/github/mcollina/pino/badge.svg?branch=master)](https://coveralls.io/github/mcollina/pino?branch=master) [![TypeScript definitions on DefinitelyTyped](http://definitelytyped.org/badges/standard.svg)](http://definitelytyped.org)
# pino&nbsp;&nbsp;[![Build Status](https://travis-ci.org/mcollina/pino.svg?branch=master)](https://travis-ci.org/mcollina/pino)&nbsp;[![Coverage Status](https://coveralls.io/repos/github/mcollina/pino/badge.svg?branch=master)](https://coveralls.io/github/mcollina/pino?branch=master) [![TypeScript definitions on DefinitelyTyped](http://definitelytyped.org/badges/standard.svg)](http://definitelytyped.org)

@@ -411,3 +411,2 @@ [Extremely fast](#benchmarks) node.js logger, inspired by Bunyan.

<a name="flush"></a>

@@ -414,0 +413,0 @@ ### logger.flush()

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