fairDataSociety / fdp-storage

Serverless Web3 filesystem for organizing users' personal data implemented in Typescript.

Home Page:https://www.npmjs.com/package/@fairdatasociety/fdp-storage

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Personal storage API changes

tomicvladan opened this issue · comments

With the current library API, there are some functions that don't return plain JS objects, but instead they return class instances that have their own methods. This approach is problematic in situations when data needs to be serialized and transferred to a different environment (thread). An example of such situation is theDirectory.read method that returns an instance of the DirectoryItem class that contains getFiles and getDirectories methods.

All fdp-storage API methods should return plain objects. And all additional logic that process data should be separated into utility functions available to end users.