Skip to content

Conversation

achingbrain
Copy link
Member

Only expose documented bits to calling code but respect them when turning the entry into a protobuf.

Implements ipfs/specs#231

Only expose documented bits to calling code but respect them when
turning the entry into a protobuf.
@achingbrain
Copy link
Member Author

cc @ribasushi

this.blockSizes = blockSizes || []
this.mtime = mtime || new Date(0)
this.mode = mode
this.mode = mode || mode === 0 ? (mode & 0xFFF) : undefined

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@achingbrain just want to doublecheck I am reading the precedence right. Are you saying:

assign mode & 0xFFF IF mode is non-zero numeric ( truthy) OR literal 0 OTHERWISE undefined

The rest looks great

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's correct, truthy or literal 0

@achingbrain achingbrain merged commit 09fd4ed into master Dec 23, 2019
@achingbrain achingbrain deleted the mask-file-mode branch December 23, 2019 07:21
achingbrain added a commit that referenced this pull request Feb 19, 2020
* feat: support storing metadata in unixfs nodes

Adds `mtime` and `mode` properties to `{path, content}` import entries

* chore: remove gh url

* chore: upgrade node

* chore: update deps

* fix: add metadata to directories too

* fix: add metadata to imported directories
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants