Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(yaml): camelcase iskey #5365

Merged
merged 1 commit into from
Jul 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions yaml/_dumper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ function writeScalar(
state: DumperState,
string: string,
level: number,
iskey: boolean,
isKey: boolean,
) {
state.dump = ((): string => {
if (string.length === 0) {
Expand Down Expand Up @@ -560,7 +560,7 @@ function writeScalar(

// Without knowing if keys are implicit/explicit,
// assume implicit for safety.
const singleLineOnly = iskey ||
const singleLineOnly = isKey ||
// No block styles in flow mode.
(state.flowLevel > -1 && level >= state.flowLevel);
function testAmbiguity(str: string): boolean {
Expand Down Expand Up @@ -807,7 +807,7 @@ function writeNode(
object: Any,
block: boolean,
compact: boolean,
iskey = false,
isKey = false,
): boolean {
state.tag = null;
state.dump = object;
Expand Down Expand Up @@ -871,7 +871,7 @@ function writeNode(
}
} else if (typeof state.dump === "string") {
if (state.tag !== "?") {
writeScalar(state, state.dump, level, iskey);
writeScalar(state, state.dump, level, isKey);
}
} else {
if (state.skipInvalid) return false;
Expand Down