Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/graphql / src / endpoints / list / transform.ts
Size: Mime:
import oneStorage from '@skava/modules/___dist/persistance';
import { getTyped } from '@skava/modules/___dist/composition/get';

export const transformList = response => {
  const { float, array, string } = getTyped(response);

  // @TODO saveforLater should not just be placed here arbitrarily...
  // const saveForLaterItems = oneStorage.getItem('save_for_later_list') || array();
  const listResponse = {
    // saveforlater: saveForLaterItems,
    type: string('type', 'getlists'),
    count: float('properties.state.count'),
    flags: array('properties.iteminfo.flags'),
    lists: array('children.lists').map(list => {
      return {
        identifier: list.identifier,
        additionalInfo: list.properties.iteminfo.additionalinfo,
      };
    }),
  };
  return listResponse;
};