<commit_before>const {either, checkReturnType} = require('./type-checking');

var api = {};

const UPDATE = 'update';
const COMMAND = 'command';
const QUERY = 'query';

function declareApiCall (name, options, f) {
  const wrappedFunction = Object.assign(checkReturnType(name, options, f), options);

  api[name] = wrappedFunction;
}

function createApi (implementation) {
  declareApiCall('update', {
    type: UPDATE,<commit_msg>Add some thoughts about genericizing API<commit_after>const {either, checkReturnType} = require('./type-checking');

var api = {};

const UPDATE = 'update';
const COMMAND = 'command';
const QUERY = 'query';

function declareApiCall (name, options, f) {
  const wrappedFunction = Object.assign(checkReturnType(name, options, f), options);

  api[name] = wrappedFunction;
}

// Define a standard for takes and returns
// must respect positional arguments and contain enough information that arguments can be generated
// specify verify/generate functions?
// or provide tools like range and select

function createApi (implementation) {
  declareApiCall('update', {
    type: UPDATE,
{'fraction_non_alphanumeric': 0.1188118811881188, 'fraction_numerical': 0.0, 'mean_word_length': 5.247191011235955, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6142727', 'n_tokens_mistral': 320, 'n_tokens_neox': 296, 'n_words': 102}