Closed agilgur5 closed 2 years ago
Really it's more like a key, with additional requirement of being filesystem safe, but this works too
Really it's more like a key
Hashes are keys, so I think that terminology works 👍
with additional requirement of being filesystem safe
Ah, that's a good point that I didn't think about, but I guess a sha1
hash is FS-safe, so it works so long as the implementation isn't changed.
Might be good to add a typedoc @returns
comment mentioning that for future readers or anyone who may think of changing the hash algorithm (I don't have any plans to do that, but I can imagine someone looking at sha1
, saying "let's update that", and not be aware that FS-safe is a required property)
Summary
Rename
makeName
->createHash
andname
->hash
intscache.ts
code for clarityDetails
I've actually been confused multiple times as to what
makeName
does when I read through the cachecreateHash
would make things a lot clearerName
->Hash
make
->create
because that's the more common terminology in programmingalso rename variables that reference
makeName
's return fromname
tohash
name
can be confusing since we also haveid
, which is a path that is very similar to a name toofileName
s tooMisc Notes
Been digging into cache bugs more now that I've fixed a ton of the non-cache ones, so doing a bit of refactoring here as I'm going through it more frequently and in more depth.