Browse Source

refactor: simplify object assignment & use startsWith (#3891)

Noritaka Kobayashi 7 months ago
parent
commit
472943281f
2 changed files with 2 additions and 2 deletions
  1. 1 1
      src/api/transform/vscode-lm-format.ts
  2. 1 1
      src/services/ripgrep/index.ts

+ 1 - 1
src/api/transform/vscode-lm-format.ts

@@ -18,7 +18,7 @@ function asObjectSafe(value: any): object {
 
 		// Handle pre-existing objects
 		if (typeof value === "object") {
-			return Object.assign({}, value)
+			return { ...value }
 		}
 
 		return {}

+ 1 - 1
src/services/ripgrep/index.ts

@@ -48,7 +48,7 @@ rel/path/to/helper.ts
 │----
 */
 
-const isWindows = /^win/.test(process.platform)
+const isWindows = process.platform.startsWith("win")
 const binName = isWindows ? "rg.exe" : "rg"
 
 interface SearchFileResult {