Skip to content

Commit

Permalink
simplify name
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Jun 11, 2024
1 parent 36dfa5d commit 9114c3f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ bun install -D magicast
Import util from `c12/update`

```js
const { configFile, created } = await updateConfigFile({
const { configFile, created } = await updateConfig({
cwd: ".",
configFile: "foo.config",
onCreate: ({ configFile }) => {
Expand Down
2 changes: 1 addition & 1 deletion src/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const UPDATABLE_EXTS = [".js", ".ts", ".mjs", ".cjs", ".mts", ".cts"] as const;
/**
* @experimental Update a config file or create a new one.
*/
export async function updateConfigFile(
export async function updateConfig(
opts: UpdateConfigOptions,
): Promise<UpdateConfigResult> {
const { parseModule } = await import("magicast");
Expand Down
4 changes: 2 additions & 2 deletions test/update.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { fileURLToPath } from "node:url";
import { expect, it, describe, beforeAll } from "vitest";
import { normalize } from "pathe";
import { updateConfigFile } from "../src/update";
import { updateConfig } from "../src/update";
import { readFile, rm } from "node:fs/promises";
import { existsSync } from "node:fs";

Expand All @@ -15,7 +15,7 @@ describe("update config file", () => {
});
it("create new config", async () => {
let onCreateFile;
const res = await updateConfigFile({
const res = await updateConfig({
cwd: tmpDir,
configFile: "foo.config",
onCreate: ({ configFile }) => {
Expand Down

0 comments on commit 9114c3f

Please sign in to comment.