Socket
Socket
Sign inDemoInstall

protodef-yaml

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

protodef-yaml - npm Package Compare versions

Comparing version 1.5.1 to 1.5.2

12

generators/protodef.js

@@ -76,3 +76,7 @@ const fs = globalThis.window ? null : require('fs')

key = key.trim(); val = val ? val.trim() : ''
if (key == '_') key = '__' + i
if (key === '_') {
const nkey = '__' + i
lines[i] = lines[i].replace(key, nkey)
key = nkey
}
if (!key) continue

@@ -102,2 +106,6 @@ if (key.startsWith('!')) {

lines[i] = lines[i].replace(key, nkey)
// Enforce parsing as string if we have a float like 1.20
if (!isNaN(val) && (val.includes('.') && val.endsWith('0'))) {
lines[i] = lines[i].replace(': ', ': !!str ')
}
continue

@@ -261,3 +269,3 @@ }

if (Array.isArray(val) && !key.startsWith('%')) { // pass thru protodef json
if (key === '_') ctxPush({ anon: true, type: val })
if (key.startsWith('__')) ctxPush({ anon: true, type: val })
else ctxPush({ name: key, type: val })

@@ -264,0 +272,0 @@ } else if (typeof val === 'object') {

@@ -0,1 +1,5 @@

## 1.5.2
* [Parse !special fields as string if we have a float-string parsing disreprency](https://github.com/extremeheat/protodef-yaml/commit/aecec767963b4248b41de01c652f34776ae21382) (thanks @extremeheat)
* [Fix anonymous key handling in yaml compiler](https://github.com/extremeheat/protodef-yaml/commit/39be9cf183115336fe578aa525ec424ae5b88a61) (thanks @extremeheat)
## 1.5.1

@@ -2,0 +6,0 @@ * [Fix %switch->%array handling for inline ProtoDef JSON](https://github.com/extremeheat/protodef-yaml/commit/eaabc2b3b3471da2f488f36eae183c28ed6b4d11) (thanks @extremeheat)

2

package.json
{
"name": "protodef-yaml",
"version": "1.5.1",
"version": "1.5.2",
"description": "Transforms YAML-like syntax to ProtoDef JSON schema",

@@ -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