🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@amritk/yaml

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@amritk/yaml - npm Package Compare versions

Comparing version
0.3.0
to
0.3.1
+7
-1
dist/parse-document.js

@@ -420,3 +420,9 @@ import { resolveDoubleQuoted, resolvePlainValue, resolveSingleQuoted } from './resolve-scalar.js';

const source = src.slice(start, valueEnd);
return { kind: 'scalar', value: folded, source, style: 'plain', start, end: valueEnd };
// Resolve the folded text through the core schema, just like the single-line
// path above. Staging a following blank line forces this branch even for a
// one-line scalar (e.g. `a: 1` before a blank line), so skipping resolution
// here turned `1`/`true` into the strings `"1"`/`"true"`. A genuinely
// multi-line plain scalar folds to spaced text that no int/bool/float pattern
// matches, so it correctly stays a string.
return { kind: 'scalar', value: resolvePlainValue(folded), source, style: 'plain', start, end: valueEnd };
};

@@ -423,0 +429,0 @@ /** Folds plain-scalar continuation lines: single break → space, blank line → newline. */

+1
-1
{
"name": "@amritk/yaml",
"version": "0.3.0",
"version": "0.3.1",
"description": "A fast, featherweight, zero-dependency YAML parser for OpenAPI tooling — with exact source positions (line:column) on every node.",

@@ -5,0 +5,0 @@ "module": "./dist/index.js",

@@ -137,5 +137,5 @@ <div align="center">

| --- | --- | --- | --- |
| small (155 B) | 416k ops/s | 16.8k ops/s | **24.8×** |
| medium (2 KB) | 35.9k ops/s | 1.3k ops/s | **27.4×** |
| large (100 KB) | 747 ops/s | 24.0 ops/s | **31.2×** |
| small (155 B) | 297k ops/s | 11.4k ops/s | **25.9×** |
| medium (2 KB) | 27.7k ops/s | 918 ops/s | **30.2×** |
| large (100 KB) | 529 ops/s | 21.1 ops/s | **25.1×** |

@@ -146,5 +146,5 @@ **Parse to plain data** — all three can do this.

| --- | --- | --- | --- | --- | --- |
| small | 262k | 14.3k | 147k | 18.3× | 1.78× |
| medium | 24.7k | 1.1k | 12.9k | 23.3× | 1.92× |
| large | 538 | 26.7 | 275 | 20.1× | 1.96× |
| small | 238k | 12.0k | 115k | 19.8× | 2.08× |
| medium | 20.0k | 918 | 10.1k | 21.8× | 1.99× |
| large | 315 | 18.5 | 218 | 17.0× | 1.44× |

@@ -155,5 +155,5 @@ **Bundle size** (minified + gzipped):

| --- | --- | --- |
| **@amritk/yaml** | **6.0 KB** | — |
| yaml | 35.6 KB | 5.9× larger |
| js-yaml | 13.5 KB | 2.3× larger |
| **@amritk/yaml** | **6.6 KB** | — |
| yaml | 35.6 KB | 5.4× larger |
| js-yaml | 13.5 KB | 2.0× larger |

@@ -160,0 +160,0 @@ Correctness is pinned to `yaml` by a differential test suite (`src/differential.test.ts`) that parses a battery of documents — including full OpenAPI specs — and asserts byte-identical data output. Where `js-yaml` diverges (its `!!timestamp` type turns ISO strings into `Date`s, which is wrong for a JSON superset), we instead agree with `yaml`.