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

@travetto/yaml

Package Overview
Dependencies
Maintainers
1
Versions
160
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@travetto/yaml - npm Package Compare versions

Comparing version 1.0.0-rc.1 to 1.0.0-rc.2

5

package.json

@@ -29,4 +29,3 @@ {

},
"version": "1.0.0-rc.1",
"gitHead": "1aab475eaec81e90cc3a19fc7b68edb6510f8d23"
}
"version": "1.0.0-rc.2"
}

20

src/internal/serializer.ts

@@ -13,8 +13,11 @@ import { Util } from '@travetto/base';

static clean(key: string) {
if (/['"@ -:]/.test(key)) {
if (/[#'"@ \-:]/.test(key)) {
return key.includes('"') ?
`'${key.replace(/[']/g, '\\\'')}'` :
`"${key.replace(/["]/g, '\\"')}"`;
} else if (!key) {
return `''`;
} else {
return key;
}
return key;
}

@@ -78,5 +81,9 @@

} else if (Array.isArray(o)) {
out = o.map(el => `${prefix}-${this.serialize(el, indent, wordwrap, indentLevel + indent)}`).join('\n');
if (indentLevel > 0) {
out = `\n${out}`;
if (o.length) {
out = o.map(el => `${prefix}-${this.serialize(el, indent, wordwrap, indentLevel + indent)}`).join('\n');
if (indentLevel > 0) {
out = `\n${out}`;
}
} else {
out = ` []`;
}

@@ -91,3 +98,3 @@ } else if (typeof o === 'number' || typeof o === 'boolean' || o === null) {

} else {
out = ` ${lines[0]}`;
out = ` ${this.clean(lines[0])}`;
}

@@ -97,2 +104,3 @@ } else if (o !== undefined) {

out = (Object.keys(fin) as (keyof typeof fin)[])
.filter(x => fin[x] !== undefined)
.map(x => `${prefix}${this.clean(x)}:${this.serialize(fin[x], indent, wordwrap, indentLevel + indent)}`)

@@ -99,0 +107,0 @@ .join('\n');

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