1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

fix: 修复 README 及代码中的拼写错误

This commit is contained in:
2025-12-05 09:48:05 +08:00
parent 0849fa40f5
commit 05a55c1bdb
9 changed files with 22 additions and 22 deletions

View File

@@ -12,20 +12,20 @@ const DOUBLE_RIGHT_SLASH = '\\\\';
export function pathConversion(targetPathType: SupportPathFormat, input: string, eol: EOL, cutText: Array<TransformTextResult> | undefined = undefined): string {
let resultPath;
let isSeperator = false;
let isSeparator = false;
switch (targetPathType) {
case SupportPathFormat.Windows:
// 将其中的 / 替换为 \
resultPath = Array.from(input).map((char: string) => {
if (char !== LEFT_SLASH) {
// 当前字符不是 /
isSeperator = false;
isSeparator = false;
return char;
} else {
// 当前字符是 /
if (!isSeperator) {
if (!isSeparator) {
// 上一字符不是 /
isSeperator = true;
isSeparator = true;
return RIGHT_SLASH; // 替换成 \
}
// 上一字符是 /
@@ -38,13 +38,13 @@ export function pathConversion(targetPathType: SupportPathFormat, input: string,
resultPath = Array.from(input).map((char: string) => {
if (char !== RIGHT_SLASH) {
// 当前字符不是 \
isSeperator = false;
isSeparator = false;
return char;
} else {
// 当前字符是 \
if (!isSeperator) {
if (!isSeparator) {
// 上一字符不是 \
isSeperator = true;
isSeparator = true;
return LEFT_SLASH; // 替换成 /
}
// 上一字符是 \

View File

@@ -1,7 +1,7 @@
import { EOL } from '../../types/EOLType';
import { SupportVariableCase } from './types/SupportVariableCaseType';
import { TransformTextResult } from '../../types/TransformTextResultType';
import { transformMutliLineText, transformText } from '../../utils/transform';
import { transformMultiLineText } from '../../utils/transform';
/**
* 统一文本转换函数
@@ -52,7 +52,7 @@ export function caseConversion(targetCase: SupportVariableCase, str: string, eol
}
// Cut text 切割文本
const results: Array<TransformTextResult> = cutText === undefined ? transformMutliLineText(str) : cutText;
const results: Array<TransformTextResult> = cutText === undefined ? transformMultiLineText(str) : cutText;
// console.log('results', results);
const transformedLines: Array<string> = [];