rambda icon indicating copy to clipboard operation
rambda copied to clipboard

Upcoming tasks

Open selfrefactor opened this issue 2 years ago • 31 comments

This is public TODO list for Rambda and Rambdax which is updated once a task is done:

selfrefactor avatar Jun 16 '22 13:06 selfrefactor

Publish some methods as standalone separate libraries, i.e. rambda-compose.

Important is the output to be e single file in modern Javascript so users can simply copy and paste the code, instead of actual import of library. - won't do mostly because it is troublesome to upgrade the packages; the tooling will be too complex to build to be justified.

selfrefactor avatar Jul 29 '22 11:07 selfrefactor

R.equalsProps

R.equalsProps(a,b,properties)

selfrefactor avatar Aug 07 '22 12:08 selfrefactor

R.sum - as python

is removed

selfrefactor avatar Aug 07 '22 12:08 selfrefactor

https://github.com/smartprocure/futil-js#compactobject

https://github.com/smartprocure/futil-js#unflattenobject

https://github.com/smartprocure/futil-js#commonkeys

selfrefactor avatar Aug 07 '22 12:08 selfrefactor

R.contains

R.contains({a:1}, {a:1, b:2}) => true

selfrefactor avatar Aug 07 '22 12:08 selfrefactor

wrong export

Revert export field changes in package.json due to https://github.com/ramda/ramda/issues/3236

selfrefactor avatar Aug 07 '22 12:08 selfrefactor

Data first Rambda

Rameda alike

As it is hard to create so many files, just exporting _ which will contain one file, much like the initial version of Rambda

selfrefactor avatar Aug 07 '22 12:08 selfrefactor

allow benchmark without part of pipeline

Test internal curry

check foo against foo with internal curry

selfrefactor avatar Aug 07 '22 12:08 selfrefactor

Dictionary - type vs interface

https://github.com/selfrefactor/rambda/issues/459#issuecomment-771519978

selfrefactor avatar Aug 07 '22 12:08 selfrefactor

R.resolve

https://github.com/verydanny/vcslack/blob/master/src/api.ts

selfrefactor avatar Aug 07 '22 12:08 selfrefactor

isValid with functions

only arrow function works

ok(repos)(fn)
  // ok(repos)(x => {
  //     console.log({x})
  //   })

also not possible is array of function schema

ok(repos)([x => {
      console.log({x})
    }])

selfrefactor avatar Aug 07 '22 12:08 selfrefactor

Update https://github.com/selfrefactor/rambda-tree-shaking

selfrefactor avatar Aug 07 '22 12:08 selfrefactor

Methods to add:

  • whereAny
  • uniqBy
  • propSatisfies
  • pickBy
  • pathSatisfies
  • gte
  • mapObjIndexed(types from @types/ramda | added but types are not from there)

https://github.com/smartprocure/futil-js#differentlast https://github.com/smartprocure/futil-js#whentruthy findApply compactMap compactJoin flattenObject simpleDiff highlight on off includeLens?

selfrefactor avatar Aug 07 '22 12:08 selfrefactor

Alternative pipeAsync Typings

selfrefactor avatar Aug 07 '22 12:08 selfrefactor

deprecate R.renameProps in favour of https://jmlweb.github.io/ramdu/global.html#evolveKeys

selfrefactor avatar Aug 07 '22 12:08 selfrefactor

Maybe https://github.com/13d-io/maybe-just-maybe

selfrefactor avatar Aug 07 '22 12:08 selfrefactor

Faster isObject?

https://github.com/neotan/simda/blob/master/src/internal/_isObject.js

selfrefactor avatar Aug 07 '22 12:08 selfrefactor

https://github.com/MartinPavlik/ramda-async/blob/master/index.ts

selfrefactor avatar Aug 07 '22 12:08 selfrefactor

  • R.mapKeys (name inspiration from https://github.com/AlexGalays/spacelift#objectmapvalues)

selfrefactor avatar Aug 07 '22 12:08 selfrefactor

add avatars to contributors section

selfrefactor avatar Aug 07 '22 12:08 selfrefactor

Add explanation to missing Ramda methods

selfrefactor avatar Aug 07 '22 12:08 selfrefactor

Add R.mapToList which takes object and returns a list

selfrefactor avatar Aug 07 '22 12:08 selfrefactor

R.renamePropsWith

selfrefactor avatar Aug 07 '22 12:08 selfrefactor

include eslint-plugin-mocha as notable users

selfrefactor avatar Aug 07 '22 12:08 selfrefactor

SKIPPED

Duplication of test, readme example and typings test. As it depends on REPL, documentation site needs to be build first.

The idea is to move build information from files/index.d.ts to the source files. Maybe run Jest test in browser instead of having REPL app.

selfrefactor avatar Aug 16 '22 09:08 selfrefactor

tree shaking repo is inside rambda-scripts

selfrefactor avatar Aug 19 '22 05:08 selfrefactor

use proper naming such as functor https://github.com/hemanth/functional-programming-jargon?utm_source=hackernewsletter&utm_medium=email&utm_term=code#functor

selfrefactor avatar Aug 19 '22 10:08 selfrefactor

apply for inclusion in https://github.com/hemanth/functional-programming-jargon once more FP functions are added

selfrefactor avatar Aug 20 '22 04:08 selfrefactor

try transducers from Ramda to be included

selfrefactor avatar Aug 22 '22 12:08 selfrefactor

https://starchart.cc/selfrefactor/rambda

selfrefactor avatar Aug 22 '22 12:08 selfrefactor

HitCount

selfrefactor avatar Aug 22 '22 15:08 selfrefactor

Rambdax has issues with _consumetypings tests

selfrefactor avatar Nov 19 '22 07:11 selfrefactor

  • Add R.mapAllSettled

Explanation: It asynchronously iterates over a list using Promise.allSettled.

import { delay } from './delay.js' import { join } from './join.js' import { map } from './map.js' import { mapAllSettled } from './mapAllSettled.js' import { pipeAsync } from './pipeAsync.js'

const fn = async (x, i) => { await delay(100) if (i % 2) throw new Error(foo-${ i })

return x + 1 }

test('happy', async () => { await expect(mapAllSettled(fn, [ 1, 2, 3, 4 ])).resolves .toMatchInlineSnapshot([ { "status": "fulfilled", "value": 2, }, { "reason": [Error: foo-1], "status": "rejected", }, { "status": "fulfilled", "value": 4, }, { "reason": [Error: foo-3], "status": "rejected", }, ]) })

test('inside pipe', async () => { const result = await pipeAsync( mapAllSettled(fn), map(({ status }) => status), join('-') )([ 1, 2, 3 ]) expect(result).toBe('fulfilled-rejected-fulfilled') })

===

export async function mapAllSettledFn(fn, arr){ const promised = arr.map((a, i) => fn(a, i))

return Promise.allSettled(promised) }

export function mapAllSettled(fn, arr){ if (arguments.length === 1){ return async holder => mapAllSettledFn(fn, holder) }

return new Promise((resolve, reject) => { mapAllSettledFn(fn, arr).then(resolve) .catch(reject) }) }

selfrefactor avatar Nov 19 '22 07:11 selfrefactor

restore

import isCI from 'is-ci'
import { resolve } from 'path'
import { execCommand } from '../files/execCommand.js'

jest.setTimeout(3 * 60 * 1000)

/**
 * "consume-typings:clone": "cd .. && git clone --depth 1 https://github.com/selfrefactor/rambda-scripts.git rambda-scripts-clone",
		"consume-typings:execute": "cd ../rambda-scripts-clone/scripts/consume-typings && yarn start",
		"consume-typings": "yarn consume-typings:clone && yarn consume-typings:execute",
 */
const DIR = resolve(__dirname, '../../')

test('typings can be imported', async () => {
  if (!isCI) return
  await execCommand('rm -rf rambda-scripts-clone', DIR)
  await execCommand('yarn build:main')
  expect(await execCommand('yarn consume-typings')).toBeTrue()
})

selfrefactor avatar May 31 '23 16:05 selfrefactor

import { pathFn } from './path.js'

export const removePath = (object, path) => {
  const pathResult = pathFn(path, object)
  if (pathResult === undefined) return object
  if (!path.length) return object

  const [ head, ...tail ] = path
  if (tail.length === 0){
    const { [ head ]: _, ...rest } = object

    return rest
  }

  if (!object[ head ]) return object

  return {
    ...object,
    [ head ] : removePath(object[ head ], tail),
  }
}

export function omitPaths(paths, obj){
  if (arguments.length === 1){
    return _obj => omitPaths(paths, _obj)
  }

  return paths.reduce((result, path) => {
    const pathParts = path.split('.')

    return removePath(result, pathParts)
  }, obj)
}

---
import { omitPaths } from './omitPaths.js'

const object = {
  a : {
    b : {
      c : 1,
      d : 2,
    },
  },
  foo : {
    bar : 3,
    baz : 4,
  },
}

test('happy', () => {
  const result = omitPaths([ 'a.b.c', 'foo.bar' ], object)
  const curried = omitPaths([ 'a.b.c', 'foo.bar' ])
  const expected = {
    a   : { b : { d : 2 } },
    foo : { baz : 4 },
  }
  expect(result).toEqual(expected)
  expect(curried(object)).toEqual(expected)
})

test('with no matching path', () => {
  expect(omitPaths([ 'a.b.c.d.e.f', 'foo.bar.123' ], object)).toEqual(object)
})

selfrefactor avatar May 31 '23 22:05 selfrefactor

https://github.com/char0n/ramda-adjunct/issues/496

selfrefactor avatar Jun 01 '23 06:06 selfrefactor

https://github.com/Maggi64/moderndash/blob/main/package/src/object/flatKeys.ts

selfrefactor avatar Jun 01 '23 06:06 selfrefactor