Skip to main content
Glama

mcp-appstore

by appreply-co
invert.js1.03 kB
var _curry1 = require('./internal/_curry1'); var _has = require('./internal/_has'); var keys = require('./keys'); /** * Same as R.invertObj, however this accounts for objects with duplicate values * by putting the values into an array. * * @func * @memberOf R * @since v0.9.0 * @category Object * @sig {s: x} -> {x: [ s, ... ]} * @param {Object} obj The object or array to invert * @return {Object} out A new object with keys * in an array. * @example * * var raceResultsByFirstName = { * first: 'alice', * second: 'jake', * third: 'alice', * }; * R.invert(raceResultsByFirstName); * //=> { 'alice': ['first', 'third'], 'jake':['second'] } */ module.exports = _curry1(function invert(obj) { var props = keys(obj); var len = props.length; var idx = 0; var out = {}; while (idx < len) { var key = props[idx]; var val = obj[key]; var list = _has(val, out) ? out[val] : (out[val] = []); list[list.length] = key; idx += 1; } return out; });

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/appreply-co/mcp-appstore'

If you have feedback or need assistance with the MCP directory API, please join our Discord server