Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

breaking change: normalize fields and flatten output #670

Merged
merged 2 commits into from
Jan 21, 2018

Conversation

hacdias
Copy link
Contributor

@hacdias hacdias commented Jan 18, 2018

This normalizes the object fields names by lower casing them. It also flattens the output of files.ls.

files.ls now returns an array of objects like:

{
	name: 'something',
    type: 0,
    size: 0,
    hash: 'something'
}

files.stat now returns an object like:

{
    type: 'file',
    size: 0,
    hash: 'something',
	blocks: 152,
	cumulativeSize: 0
}

@hacdias hacdias requested a review from daviddias January 18, 2018 13:41
@ghost ghost assigned hacdias Jan 18, 2018
@ghost ghost added the in progress label Jan 18, 2018
@hacdias hacdias changed the title files: normalize names refactor: normalize fields and flatten output Jan 18, 2018
@hacdias
Copy link
Contributor Author

hacdias commented Jan 18, 2018

@diasdavid mind taking a look at this?

@daviddias
Copy link
Contributor

@hacdias a "refactor" that changes the output is not a refactor, it is a breaking change. It is justified? Do we need it?

@hacdias
Copy link
Contributor Author

hacdias commented Jan 19, 2018

@diasdavid it is not strictly necessary, but it has a good justification: consistency. I'm trying to make js-ipfs-api consistent all over (just like what I did on #669).

I can also specify this on interface-ipfs-core because this functions are not there yet.

@hacdias hacdias changed the title refactor: normalize fields and flatten output breaking change: normalize fields and flatten output Jan 19, 2018
@hacdias
Copy link
Contributor Author

hacdias commented Jan 20, 2018

Ping @diasdavid

@daviddias
Copy link
Contributor

sounds good @hacdias

@daviddias daviddias merged commit 98000af into master Jan 21, 2018
@daviddias daviddias deleted the refactor/files branch January 21, 2018 00:14
@ghost ghost removed the in progress label Jan 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants