How to use the prop function from ramda
Find comprehensive JavaScript ramda.prop code examples handpicked from public code repositorys.
GitHub: calmm-js/partial.lenses
100 101 102 103 104 105 106 107 108 109
const L_get_1 = L.get(1) const R_nth_1 = R.nth(1) const U_get_1 = U && U.get(1) const L_get_y = L.get('y') const R_prop_y = R.prop('y') const U_get_y = U && U.get('y') const Sum = {empty: () => 0, concat: add} const List = {empty: always([]), concat: (x, y) => x.concat(y)}
41
901
29
+ 3 other calls in file
GitHub: uselagoon/lagoon
96 97 98 99 100 101 102 103 104 105
debug: getConfigFromEnv('NODE_ENV') === 'development', introspection: true, uploads: false, // Disable built in support for file uploads and configure it manually subscriptions: { onConnect: async (connectionParams, webSocket) => { const token = R.prop('authToken', connectionParams); if (!token) { throw new AuthenticationError('Auth token missing.'); }
142
475
0
+ 19 other calls in file
6 7 8 9 10 11 12 13 14 15 16 17
(expiry) => expiry - Math.floor(Date.now() / 1000) ); const extractTimeToLive = R.cond([ [R.propIs(Number, 'expiry'), ({ expiry }) => ttlFromExpiry(expiry)], [R.propIs(Number, 'timeToLive'), R.prop('timeToLive')], [R.T, R.always(DEFAULT_TTL)], ]); const pathIsString = R.pathSatisfies(R.is(String));
117
518
0
GitHub: 18xx-maker/18xx-maker
42 43 44 45 46 47 48 49 50 51
"other", "none", ]; const colorSort = R.compose( tileColors.indexOf.bind(tileColors), R.prop("color"), R.defaultTo({ color: "other" }) ); const sortTiles = R.sortWith([R.ascend(colorSort)]);
52
51
0
15 16 17 18 19 20 21 22 23
if (!osmId) { throw Boom.badRequest('osmId is required parameter') } const values = await profile.getProfile('user', osmId) const tags = prop('tags', values) if (!values || !tags) { throw Boom.notFound() }
4
23
24
+ 5 other calls in file
GitHub: DFEAGILEDEVOPS/MTC
179 180 181 182 183 184 185 186 187 188
// logger.debug(`sql.service: generateParams: options set for [${column}]`, options) params.push({ name: column, value, type: R.prop(findDataType(cacheData.dataType), sqlService.TYPES), options }) } return params
14
12
11
+ 3 other calls in file
GitHub: infinityworks/MTC
136 137 138 139 140 141 142 143 144 145
} logger.debug(`sql.service: generateParams: options set for [${column}]`, options) params.push({ name: column, value, type: R.prop(findTediousDataType(cacheData.dataType), TYPES), options }) } return params
14
0
2
+ 9 other calls in file
465 466 467 468 469 470 471 472 473 474
const printHtmlIssuesToConsole = (htmlIssues) => { R.pipe( // restructure the output of the HTMLHint R.map( R.applySpec({ url: R.prop("url"), errors: R.pipe( R.identity, R.pipe( R.prop("errors"),
2
5
0
+ 2 other calls in file
85 86 87 88 89 90 91 92 93 94 95 96
}); exports.getFlightPorts = getFlightPorts; var getFlightPort = function getFlightPort() { return (0, _reselect.createSelector)(getFlightPorts, getIATA, function (ports, iata) { return R.prop(iata, ports); }); }; exports.getFlightPort = getFlightPort;
0
3
0
+ 5 other calls in file
67 68 69 70 71 72 73 74 75 76 77 78
var EMPTY_OBJ = {}; var EMPTY_ARRAY = []; var getOffersListFromSearchMemory = function getOffersListFromSearchMemory(queryID) { return R.prop(queryID, _resultsMemory.memoryInstances) ? R.call(R.pipe(function (memory) { return memory.getValues(); }, R.prop('offersHub'), R.toPairs, R.map(function (_ref2) { var _ref3 = _slicedToArray(_ref2, 2), offer = _ref3[1];
0
3
0
+ 503 other calls in file
GitHub: spynejs/spyne
76 77 78 79 80 81 82 83 84 85
const revisedConfig = SpyneUtilsChannelRoute.conformRouteObject(preProcessedRouteData); expect(revisedConfig).to.deep.equal(postProcessedRouteData); }) it('should create route datasets ',()=>{ const channelsRouteObj = R.prop('routes', postProcessedRouteData); channelsRouteObj.routePath['bio-.*'] = { 'routePath' : { '404' : '.+',
1
1
0
199 200 201 202 203 204 205 206 207
throw new ValidationError('profileType should be one of "user", "team" or "org"') } const conn = await db() const currentProfile = await getProfile(profileType, id) let tags = prop('tags', currentProfile) // Pick tags that are still in the database const tagsInDB = await conn('profile_keys').select('id').whereIn('id', keys(tags))
0
1
0
42 43 44 45 46 47 48 49 50 51
const dependencies = R.pipe( R.map( R.pipe( createRelativePackagePath(relativePath, "package.json"), unsafeReadFileJson, R.prop("dependencies") ) ), mergeObjects, // This makes it a dict and deduplicates it Object.entries
0
1
0
67 68 69 70 71 72 73 74 75 76 77
configDict: {key: string, val: string} ((key) => configDict, () => string) => ( (key) => string ) */ const load_optional_str_config = load_config( R.__, R.prop('val'), R.__ ) /*
1
0
13
+ 542 other calls in file
9 10 11 12 13 14 15 16 17 18 19 20
'test2': '{"a": 1, "b": 2}', 'test3': ', "b": 2}' } const get_config = (key) => { return {'key': key, 'val': R.prop(key, configs)} } const load_mandatory_str_config = config_utils.load_mandatory_str_config(get_config) const load_optional_str_config = config_utils.load_optional_str_config(get_config, () => "fallback")
1
0
13
+ 166 other calls in file
13 14 15 16 17 18 19 20 21 22
//where the magic happens. kml to geojson here and we only care about the features property R.map( R.pipe( f => tj.kml(new DOMParser().parseFromString(fs.readFileSync(f, 'utf8'))), R.prop('features'), ) ), // TODO: if kml feature type is `LineString` change it to `Polygon` and
1
0
0
98 99 100 101 102 103 104 105 106 107
return R.pipe( R.pathOr([], ["response", "data", "errors"]), R.unless( Array.isArray, R.pipe( R.prop("error"), R.unless(Array.isArray, R.of) ), ) )(error);
1
0
0
GitHub: pounce-lang/js-core
2713 2714 2715 2716 2717 2718 2719 2720 2721 2722
return null; }; // const toWordDictionaryOrNull = (u: any): WordDictionary | null => // r.is(Object, u) ? u : null; // const fetchProp = (wd: { [index: string]: Word }) => (w: Word, s: string | null) => { // const res = r.prop(s, wd); // if (!res) { // return res; // } // return w;
0
5
0
+ 4 other calls in file
23 24 25 26 27 28 29 30 31 32 33 34
var domain = function domain(_) { return _.services; }; var getCommonLabesl = (0, _reselect.createSelector)(domain, R.prop('labels')); var getLabels = (0, _reselect.createSelector)(getCommonLabesl, _selectors.getLang, function (labels, lang) { return R.mergeAll([labels, _constants.STATIC_LABELS_BY_LANG[lang] || _constants.STATIC_LABELS_BY_LANG.rus]); }); exports.getLabels = getLabels;
0
3
0
GitHub: muqsitnawaz/deepcoin
225 226 227 228 229 230 231 232 233 234
// Verify if all input transactions are unspent in the blockchain let isInputTransactionsUnspent = R.all(R.equals(false), R.flatten(R.map((txInput) => { return R.map( R.pipe( R.prop('transactions'), R.map(R.pipe( R.path(['data', 'inputs']), R.contains({ transaction: txInput.transaction, index: txInput.index }) ))
0
1
0
ramda.clone is the most popular function in ramda (30311 examples)