Skip to content

Commit

Permalink
refactor: rename generic func
Browse files Browse the repository at this point in the history
  • Loading branch information
nadilas committed Apr 4, 2024
1 parent 7a45731 commit 5f575db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/ogre/src/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
createHeadRefValue,
getLastRefPathElement,
headValueRefPrefix,
immutableRefCopy,
immutableMapCopy,
localHeadPathPrefix,
mapPath,
mutableMapCopy,
Expand Down Expand Up @@ -109,7 +109,7 @@ export class Repository<T extends { [k: PropertyKey]: any }>
constructor(obj: Partial<T>, options: RepositoryOptions<T>) {
// FIXME: move this to refs/remote as git would do?

this.remoteRefs = immutableRefCopy(options.history?.refs);
this.remoteRefs = immutableMapCopy(options.history?.refs);
this.original = deepClone(obj);
// store js ref, so obj can still be modified without going through repo.data
this.data = obj as T;
Expand Down
2 changes: 1 addition & 1 deletion packages/ogre/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export const printChange = (chg: Operation) => {
export const getLastRefPathElement = (thePath: string) =>
thePath.substring(thePath.lastIndexOf("/") + 1);

export const immutableRefCopy = <T extends object>(
export const immutableMapCopy = <T extends object>(
map: Map<string, T> | undefined,
) => {
if (!map) {
Expand Down

0 comments on commit 5f575db

Please sign in to comment.