Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
[either(isNil, isEmpty), always([])],
[
T,
compose(
// sort by position in tx, then remove it
map(
evolve({
data: compose(
map(omit(['positionInTx'])),
sortBy(prop('positionInTx'))
),
})
),
map(reduce(appendRowToTx, { data: [] })),
values,
groupBy(prop('id'))
),
],
]);
module.exports = dataEntriesToTxs;
return item
})
)
const getMessageKey = R.prop("msgid")
const getTranslations = R.prop("msgstr")
const getExtractedComments = R.prop("extractedComments")
const getTranslatorComments = R.prop("comments")
const getOrigins = R.prop("references")
const getFlags = R.compose(
R.map(R.trim),
R.keys,
R.dissoc("obsolete"), // backward-compatibility, remove in 3.x
R.prop("flags")
)
const isObsolete = R.either(R.path(["flags", "obsolete"]), R.prop("obsolete"))
const deserialize = R.map(
R.applySpec({
translation: R.compose(
R.head,
R.defaultTo([]),
getTranslations
),
description: R.compose(
R.head,
R.defaultTo([]),
getExtractedComments
),
comments: item =>
R.concat(getTranslatorComments(item), R.tail(getExtractedComments(item))),
obsolete: isObsolete,
export default async (edition: string) => {
const previousConf = conf.getAll()
const previousAccount = previousConf.account
const sponsorClient = new Sponsor(getIOContext(), IOClientOptions)
const data = await sponsorClient.getSponsorAccount()
const sponsorAccount = R.prop('sponsorAccount', data)
if (!sponsorAccount) {
await promptSwitchToAccount('vtex', true)
} else if (previousAccount !== sponsorAccount) {
await promptSwitchToAccount(sponsorAccount, false)
}
const sponsorClientForSponsorAccount = new Sponsor(getIOContext(), IOClientOptions)
await sponsorClientForSponsorAccount.setEdition(previousAccount, edition)
log.info(`Successfully set new edition in account ${chalk.blue(previousAccount)}.`)
await switchToPreviousAccount(previousConf)
}
'/hello': Hello,
'*': NotFound
});
const page$ = match$.map(({path, value}) => value(merge(sources, {
path: router.path(path)
})));
const makeLink = (path, label) => a({props: {href: path}, style: {padding: '1em'}}, label);
const nav$ = xs.of(nav({style: {marginBottom: '1em'}}, [
makeLink('/bmi', 'BMI'),
makeLink('/hello', 'Hello')
]));
const view$ = page$.map(prop('DOM')).flatten();
const vdom$ = xs.combine(nav$, view$)
.map(([navDom, viewDom]) => div([navDom, viewDom]));
return {
DOM: vdom$
}
}
export async function handler({ clog, cerr, argv }: Args): Promise {
const projectName = R.prop('project', argv) || R.prop('project', config);
if (projectName == null) {
return printProjectConfigurationError(cerr);
}
return listEnvironments({ projectName, clog, cerr });
}
const balanceUpdate = action$ =>
receiveFromSocket(socket)('balanceUpdate')
.takeUntil(action$.ofType(ERROR))
.map(prop('balance'))
.map(updateConfirmedTxs);
let attrSort = (attr) => R.sortBy(R.compose(R.toLower, R.prop(attr)))
let nameSort = attrSort('name')
import { pipe, prop, append, map } from "ramda";
import { UNKNOWN_RULE } from "./unknown";
const transformKeyToRegExp = ({ key, ...rest }) => ({
key: new RegExp(key, "g"),
...rest
});
export const rules = pipe(
prop("rules"),
append(UNKNOWN_RULE),
map(transformKeyToRegExp)
);