Skip to main content
Glama

mcp-appstore

by appreply-co
splitWhen.js1.05 kB
var _curry2 = require('./internal/_curry2'); var _slice = require('./internal/_slice'); /** * Takes a list and a predicate and returns a pair of lists with the following properties: * * - the result of concatenating the two output lists is equivalent to the input list; * - none of the elements of the first output list satisfies the predicate; and * - if the second output list is non-empty, its first element satisfies the predicate. * * @func * @memberOf R * @since v0.19.0 * @category List * @sig (a -> Boolean) -> [a] -> [[a], [a]] * @param {Function} pred The predicate that determines where the array is split. * @param {Array} list The array to be split. * @return {Array} * @example * * R.splitWhen(R.equals(2), [1, 2, 3, 1, 2, 3]); //=> [[1], [2, 3, 1, 2, 3]] */ module.exports = _curry2(function splitWhen(pred, list) { var idx = 0; var len = list.length; var prefix = []; while (idx < len && !pred(list[idx])) { prefix.push(list[idx]); idx += 1; } return [prefix, _slice(list, idx)]; });

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