Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
deleteProperty: function (target, property) {
expect(R.keys(target).length).toBe(3) // deletion hasn't performed
// console.log('Deleted %s', property)
delete target[property]
return true
},
set: function (target, property, value, receiver) {
/*
const queries = {
'@media (--breakpoint-not-small)': '@media screen and (min-width: 48em)',
'@media (--breakpoint-medium)': '@media screen and (min-width: 48em) and (max-width: 64em)',
'@media (--breakpoint-large)': '@media screen and (min-width: 64em)',
}
*/
const queries = {
'@media (--breakpoint-not-small)': '@media screen and (min-width: 30em)',
'@media (--breakpoint-medium)': '@media screen and (min-width: 30em) and (max-width: 60em)',
'@media (--breakpoint-large)': '@media screen and (min-width: 60em)'
};
const queryKeys = R.keys(queries);
// mergeMediaQueries :: a -> a
const mergeMediaQueries = styles => {
const noQueries = R.omit(queryKeys, styles);
const flipMediaQuery = key => {
const rules = styles[key];
return R.reduce((acc, selector) => {
const newBp = queries[key];
return R.assocPath([selector, newBp], rules[selector], acc);
}, {}, R.keys(rules));
}
const flippedQueries = R.reduce((acc, key) => {
return R.merge(acc, flipMediaQuery(key));
const parent = this.context.execContext;
const { container, delegate, env, childProps } = this.props;
if (delegate && !parent) {
const msg = `Attempting to delegate state property '${delegate.toString()}' with no parent container`;
console.warn(msg); // tslint:disable-line:no-console
}
this.execContext = new ExecContext({ env, parent, container, delegate });
this.unsubscribe = this.execContext.subscribe(pipe(this.mergeWithRelay.bind(this), this.setState.bind(this)));
if (this.dispatchLifecycleMessage(Activate, this.props)) {
return;
}
const state = this.execContext.state();
this.setState(this.execContext.push(merge(state, pick(keys(state), childProps))));
}
.map(tests_def => {
_.keys(tests_def).map(key => {
const script = load_script(key).getOrElse({});
tests_def[key].script = script;
});
return Right(tests_def);
});
}
public listen(): Observable {
const rtmEvents = R.pick(['MESSAGE'], RTM_EVENTS);
const events = R.map(
(key) => Observable.fromEvent(this.session, rtmEvents[key]),
R.keys(rtmEvents));
const webHookEvent = Observable.fromEvent(this.emitter, 'message')
.mergeMap(parseWebHookEvent);
events.push(webHookEvent);
return Observable.merge(...events)
.switchMap((value) => {
return Observable.of(value)
.mergeMap((event: ISlackMessage) => {
if (!R.contains(event.type, [
'message',
'event_callback',
'slash_command',
'interactive_message',
])) { return Promise.resolve(null); }
if (event.type === 'message' && R.contains(event.subtype, [
<b>
<p>
{key === 'plus_minus'
? '+/-'
: key.toUpperCase().replace('_PCT', '%')}
</p>
</b>
<p>{visitor[key]}</p>
),
R.keys(home)
)}
);
const nestedComponents = mergeAll(
await Promise.all(
map(async (componentAlias) => {
const nestedComponentRoot = await getComponentRootPath(
component.components[componentAlias].type
)
const nestedComponentInputs = component.components[componentAlias].inputs || {}
const nestedComponentId = component.components[componentAlias].id
return getComponentsFromServerlessFile(
stateFile,
nestedComponentRoot,
nestedComponentInputs,
nestedComponentId
)
}, keys(component.components) || [])
)
)
return assoc(
component.id,
{
id: component.id,
type: component.type,
inputs: component.inputs,
inputTypes: component.inputTypes,
outputs: {},
outputTypes: component.outputTypes,
rootPath: componentRoot,
state: getState(stateFile, component.id),
dependencies: getDependencies(component.inputs),
children: getChildrenIds(component) || {},
_applyState(newState) {
keys(newState).forEach(key => {
this[key] = newState[key];
});
this.order.$setDirty();
}
const isBlockRemovable = blocks => R.length(R.keys(blocks)) > 1;