denoland / deno_std

The Deno Standard Library
https://jsr.io/@std
MIT License
2.83k stars 582 forks source link

BREAKING(yaml): rename `StringifyOptions.noCompatMode` to `StringifyOptions.compatMode` #5287

Closed iuioiua closed 3 days ago

iuioiua commented 3 days ago

What's changed

The ParseOptions.noCompatMode option has been renamed to ParseOptions.compatMode. As a result, the polarity of the option has been swapped. In other words, true behavior has been changed to false behavior, and visa-versa. This only affects users who currently use ParseOptions.noCompatMode.

Motivation

This change makes the option far easier to understand by avoiding a negative-tensed name.

Migration guide

Use ParseOptions.compatMode instead of ParseOptions.noCompatMode and swap the polarity of the option.

import { parse } from "@std/yaml/parse";

const yamlString = `fruits:
  - Apple
  - Banana
  - Cherry`;

- parse(yamlString, { noCompatMode: false });
+ parse(yamlString, { compatMode: true });

Related

Towards #5124

codecov[bot] commented 3 days ago

Codecov Report

Attention: Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 95.71%. Comparing base (f1952ec) to head (378aaa0).

Files Patch % Lines
yaml/_dumper.ts 75.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #5287 +/- ## ======================================= Coverage 95.71% 95.71% ======================================= Files 457 457 Lines 37955 37955 Branches 5560 5560 ======================================= Hits 36330 36330 Misses 1584 1584 Partials 41 41 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.