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

dot-properties

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dot-properties - npm Package Compare versions

Comparing version 1.0.2 to 1.1.0

1

lib/index.d.ts

@@ -81,2 +81,3 @@ export class Node {

pathSep?: '.' | string // if non-default, use the same in parse()
foldChars?: '\f\t .' | string
}

@@ -83,0 +84,0 @@

37

lib/stringify.js

@@ -22,3 +22,3 @@ const { Pair, Comment, EmptyLine } = require('./ast')

function fold({ indent, latin1, lineWidth, newline }, key, value) {
function fold({ indent, latin1, lineWidth, newline, foldChars }, key, value) {
const printKey = escapeNonPrintable(key, latin1)

@@ -56,14 +56,16 @@ const printValue = escapeNonPrintable(value, latin1)

case ' ':
case '=':
case ':':
if (foldChars.includes(line[i])) split = i + 1
break
case 'f':
if (foldChars.includes('\f')) split = i + 1
break
case 't':
split = i + 1
if (foldChars.includes('\t')) split = i + 1
break
}
break
case '\f':
case '\t':
case ' ':
case '.':
split = i + 1
break
default:
if (foldChars.includes(ch)) split = i + 1
}

@@ -119,3 +121,4 @@ }

newline = '\n',
pathSep = '.'
pathSep = '.',
foldChars = '\f\t .'
} = {}

@@ -125,4 +128,16 @@ ) {

if (!Array.isArray(input)) input = toLines(input, pathSep, defaultKey)
const lineOpt = { indent, latin1, lineWidth, newline: '\\' + newline }
const commentOpt = { indent: commentPrefix, latin1, lineWidth, newline }
const lineOpt = {
indent,
latin1,
lineWidth,
newline: '\\' + newline,
foldChars
}
const commentOpt = {
indent: commentPrefix,
latin1,
lineWidth,
newline,
foldChars
}
return input

@@ -129,0 +144,0 @@ .map(line => {

{
"name": "dot-properties",
"version": "1.0.2",
"version": "1.1.0",
"license": "MIT",

@@ -5,0 +5,0 @@ "author": "Eemeli Aro <eemeli@gmail.com>",

@@ -49,3 +49,4 @@ # dot-properties

newline: '\n', // Windows uses \r\n
pathSep: '.' // if non-default, use the same in parse()
pathSep: '.', // if non-default, use the same in parse()
foldChars: '\f\t .' // preferred characters for line folding
}

@@ -52,0 +53,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