Skip to content

Commit

Permalink
fix!: Remove getParent() from public API
Browse files Browse the repository at this point in the history
  • Loading branch information
nzakas committed Jul 2, 2024
1 parent 9beb97b commit e54788c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/object-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
//-----------------------------------------------------------------------------

let nextId = 0;
const getParent = Symbol("getParent");

/**
* Represents an entry in the object store.
Expand Down Expand Up @@ -87,7 +88,7 @@ class Entry {
* @type {Folder|undefined}
*/
get parent() {
return this.store.getParent(this.id);
return this.store[getParent](this.id);
}

/**
Expand Down Expand Up @@ -157,7 +158,7 @@ class File extends Entry {
set content(value) {
this.#content = value;
this.modifiedAt = new Date();
this.store.getParent(this.id).modifiedAt = this.modifiedAt;
this.store[getParent](this.id).modifiedAt = this.modifiedAt;
}

/**
Expand Down Expand Up @@ -325,7 +326,7 @@ export class ObjectStore {
* @param {string} id The ID of the object to get the parent of.
* @returns {Folder|undefined} The parent of the object or `undefined` if not found.
*/
getParent(id) {
[getParent](id) {
return this.#parents.get(id);
}

Expand Down

0 comments on commit e54788c

Please sign in to comment.