<commit_before>/**
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @emails oncall+relay
 * @flow strict-local
 * @format
 */

'use strict';

const {getModuleComponentKey, getModuleOperationKey} = require('relay-runtime');

import type {NormalizationSplitOperation} from 'relay-runtime';

export opaque type Local3DPayload<+DocumentName: string, +Response: {}> = empty;

interface Resource<T> {
  +getModuleIfRequired: () => ?T;
  +getModuleId: () => string;
  +load: () => Promise<T>;
}

function createPayloadFor3DField<+DocumentName: string, +Response>(
  name: DocumentName,
  operation: Resource<NormalizationSplitOperation>,
  component: Resource<mixed>,
  response: Response,
): Local3DPayload<DocumentName, Response> {
  const data = {
    ...response,
  };
  data[getModuleComponentKey(name)] = component;
  data[getModuleOperationKey(name)] = operation;
  return data;
}

module.exports = createPayloadFor3DField;<commit_msg>Suppress errors in relay synced file<commit_after>/**
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @emails oncall+relay
 * @flow strict-local
 * @format
 */

'use strict';

const {getModuleComponentKey, getModuleOperationKey} = require('relay-runtime');

import type {NormalizationSplitOperation} from 'relay-runtime';

export opaque type Local3DPayload<+DocumentName: string, +Response: {}> = empty;

interface Resource<T> {
  +getModuleIfRequired: () => ?T;
  +getModuleId: () => string;
  +load: () => Promise<T>;
}

function createPayloadFor3DField<+DocumentName: string, +Response>(
  name: DocumentName,
  operation: Resource<NormalizationSplitOperation>,
  component: Resource<mixed>,
  response: Response,
  /* $FlowFixMe(>=0.111.0) This comment suppresses an error found when Flow
   * v0.111.0 was deployed. To see the error, delete this comment and run Flow.
   */
): Local3DPayload<DocumentName, Response> {
  const data = {
    ...response,
  };
  data[getModuleComponentKey(name)] = component;
  data[getModuleOperationKey(name)] = operation;
  /* $FlowFixMe(>=0.111.0) This comment suppresses an error found when Flow
   * v0.111.0 was deployed. To see the error, delete this comment and run Flow.
   */
  return data;
}

module.exports = createPayloadFor3DField;
{'fraction_non_alphanumeric': 0.1219414360208584, 'fraction_numerical': 0.011231448054552748, 'mean_word_length': 4.827102803738318, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6267664', 'n_tokens_mistral': 755, 'n_tokens_neox': 744, 'n_words': 220}