Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('does not allow a mismatched element type to the $ReadOnlyArray', () => {
const xs: $ReadOnlyArray = ['bar']
// It is not understood why this fails to be flagged as an error when
// the 0.26.x libdef passes with the same declaration. The curried form
// works reliably though.
//
// $ShouldExpectErrorButInsteadWorksPleaseFix
const result: boolean = contains(1, xs)
})
function esDepsDeep(files, options = {}) {
var cache = []; // eslint-disable-line
const excludeFn = options.excludeFn || R.F;
// isInCache :: Object -> true
const isInCache = R.pipe(_resolved, R.contains(R.__, cache));
// impure void addToCache :: Object
const addToCache = _ => { cache.push(_.resolved); };
// walk :: Object -> Array[Object]
const walk = item => R.ifElse(isInCache, R.always([]), R.pipeP(toPromise,
R.tap(addToCache),
deps,
mapWalk,
R.unnest,
R.reject(excludeFn),
R.prepend(item)
))(item);
// mapWalk :: Array[Object] -> Array[Object]
const mapWalk = R.pipeP(toPromise,
layoutRequest,
layout,
config,
} = this.props;
const {errorLoading} = this.state;
if (
layoutRequest.status &&
!contains(layoutRequest.status, [STATUS.OK, 'loading'])
) {
return <div>Error loading layout</div>;
} else if (
errorLoading ||
(dependenciesRequest.status &&
!contains(dependenciesRequest.status, [STATUS.OK, 'loading']))
) {
return (
<div>Error loading dependencies</div>
);
} else if (
appLifecycle === getAppState('HYDRATED') &&
config.ui === true
) {
return (
);
value,
setProps,
dataframe,
is_focused,
columns,
selected_cell,
active_cell,
} = this.props;
const {notEditable} = this.state;
const isActive = active_cell[0] === idx && active_cell[1] === i;
let innerCell;
if (
!R.has('type', columns[i]) ||
R.contains(columns[i].type, ['numeric', 'text'])
) {
innerCell = (
<input value="{value}" type="text" id="{`${c.id}-${idx}`}"> (this.textInput = el)}
onChange={e => {
if (notEditable) {
return;
}
if (isSelected) {
const newDataframe = R.set(
R.lensPath([idx, c.id]),
'use strict';
const R = require('ramda'),
__ = require('./_private.js');
module.exports = {
isArray : R.is(Array),
isArrayOfLength : __.ofLength(Array, 'identical'),
isArrayOfLengthAtLeast : __.ofLength(Array, 'gte'),
isArrayOfLengthAtMost : __.ofLength(Array, 'lte'),
isArrayLongerThan : __.ofLength(Array, 'gt'),
isArrayShorterThan : __.ofLength(Array, 'lt'),
isArrayContaining : R.contains(R.__),
isEmptyArray : R.allPass([R.is(Array), R.isEmpty])
};
return (
<div>
{title}
<span data-hint="{tooltip}">
<i>
</i></span><i>
</i></div><i>
);
}
let viewJsonButton = null;
if (
R.contains(valueType, [VALUE_TYPES.MAPBOX_ATLAS, VALUE_TYPES.JSON]) &&
value
) {
let buttonText;
if (valueType === VALUE_TYPES.MAPBOX_ATLAS) {
buttonText = "View Mapbox Style JSON";
} else {
buttonText = "Rich JSON Editor";
}
viewJsonButton = menuItem(
<div>
{buttonText}
</div>
);
}
</i>
const SourceOptions = ({ active, sourceOnSelect }) => {
if (!active) active = ''
const otherOption =
!R.contains(
trimLower(active),
R.map(trimLower, R.pluck('title', recommands))
) && !R.isEmpty(active)
return (
{recommands.map(s => (
isPointer(type: IType): boolean {
return R.contains(Type.which(type), Type._pointerTypes);
},
isCommandHidden(commandType) {
return contains(commandType, this.commandsHiddenInTimeline)
}
module.exports = ({ type }) =>
contains(type, DEPENDENT_ON_REQUIRED_TYPES)
? [[isString, "DependentOn should be a string"], [notEmpty, EMPTY_MESSAGE]]
: [[isNil, NOT_NIL_MESSAGE]];