{"size": 1043, "ext": "js", "max_stars_repo_path": "src/mapResult.js", "max_stars_repo_name": "trieloff/helix-index-file", "max_stars_repo_stars_event_min_datetime": "2020-05-24T21:21:39.000Z", "max_stars_repo_stars_event_max_datetime": "2020-08-01T11:33:04.000Z", "max_issues_repo_path": "src/mapResult.js", "max_issues_repo_name": "adobe/helix-index-files", "max_issues_repo_issues_event_min_datetime": "2019-11-12T23:44:03.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-17T21:29:43.000Z", "max_forks_repo_path": "src/mapResult.js", "max_forks_repo_name": "trieloff/helix-index-file", "max_forks_repo_forks_event_min_datetime": "2019-11-06T13:22:09.000Z", "max_forks_repo_forks_event_max_datetime": "2019-11-06T13:22:09.000Z"}
{"max_stars_count": 2, "max_issues_count": 422, "max_forks_count": 1, "avg_line_length": 28.9722222222, "max_line_length": 89, "alphanum_fraction": 0.6883988495}
/*
 * Copyright 2020 Adobe. All rights reserved.
 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License. You may obtain a copy
 * of the License at http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under
 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
 * OF ANY KIND, either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */

/* eslint-disable no-param-reassign */

'use strict';

const mapResult = {
  accepted: (attributes, update) => ({
    status: 202,
    update,
    ...attributes,
  }),
  notFound: (attributes) => ({
    status: 404,
    path: attributes.path,
    message: `Item not found with path: ${attributes.path}`,
  }),
  error: (status, path, message) => ({
    status,
    path,
    message,
  }),
};

module.exports = mapResult;
