How to use the ramda-extension.isArray function in ramda-extension

To help you get started, we’ve selected a few ramda-extension examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lundegaard / react-union / packages / react-union-scripts / scripts / startDevServer.js View on Github external
const getProxyMiddleware = ({ proxy } = {}) => {
	if (!proxy) {
		return [];
	}
	let normalizedConfig = proxy;
	if (!R_.isArray(proxy)) {
		normalizedConfig = R.pipe(
			R.mapObjIndexed((target, context) => {
				// for more info see https://github.com/webpack/webpack-dev-server/blob/master/lib/Server.js#L193
				const correctedContext = R.o(R.replace(/\/\*$/, ''), R.replace(/^\*$/, '**'))(context);
				if (R_.isString(target)) {
					return {
						context: correctedContext,
						target,
					};
				} else {
					return {
						...target,
						context: correctedContext,
					};
				}
			}),
github lundegaard / react-union / packages / react-union-scripts / scripts / lib / middleware.js View on Github external
const proxyMiddleware = ({ proxy } = {}) => {
	if (!proxy) {
		return [];
	}
	let normalizedConfig = proxy;
	if (!isArray(proxy)) {
		normalizedConfig = pipe(
			mapObjIndexed((target, context) => {
				// for more info see https://github.com/webpack/webpack-dev-server/blob/master/lib/Server.js#L193
				const correctedContext = o(replace(/\/\*$/, ''), replace(/^\*$/, '**'))(context);
				if (isString(target)) {
					return {
						context: correctedContext,
						target,
					};
				} else {
					return {
						...target,
						context: correctedContext,
					};
				}
			}),