Skip to content

Commit

Permalink
mark duplicate method as private
Browse files Browse the repository at this point in the history
  • Loading branch information
souporserious committed Dec 9, 2024
1 parent 5c973bd commit 80ae7f2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .changeset/long-walls-kneel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'renoun': minor
---

Marks the `<Directory>.duplicate` method as private since this was previously only exposed for `EntryGroup` which no longer requires a new instance to be created.
9 changes: 0 additions & 9 deletions packages/renoun/src/file-system/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,15 +332,6 @@ describe('file system', () => {
expect(nestedDirectory).toBeInstanceOf(Directory)
})

test('duplicate directory', async () => {
const fixtures = new Directory<{ ts: { title: string } }>('fixtures')
const duplicate = fixtures.duplicate()

expect(duplicate).toBeInstanceOf(Directory)
expect(duplicate).not.toBe(fixtures)
expect(duplicate.getRelativePath()).toBe(fixtures.getRelativePath())
})

test('file', async () => {
const rootDirectory = new Directory()
const file = await rootDirectory.getFile('tsconfig', 'json')
Expand Down
4 changes: 2 additions & 2 deletions packages/renoun/src/file-system/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ export class Directory<
}

/** Duplicate the directory with the same initial options. */
duplicate<
#duplicate<
Entry extends FileSystemEntry<Types, HasModule> = FileSystemEntry<
Types,
HasModule
Expand Down Expand Up @@ -1264,7 +1264,7 @@ export class Directory<
}

if (entry.isDirectory) {
const directory = this.duplicate({
const directory = this.#duplicate({
fileSystem,
path: entry.path,
})
Expand Down

0 comments on commit 80ae7f2

Please sign in to comment.