selfrefactor / rambda

Faster and smaller alternative to Ramda
https://selfrefactor.github.io/rambda
MIT License
1.65k stars 89 forks source link

Feat@method apply unapply bind #600

Closed synthet1c closed 3 years ago

synthet1c commented 3 years ago

Hey Dejan,

New methods apply, unapply & bind. also a minor bugfix in the converge typescript test as it was referencing ramda not rambda.

Typescript defs are done, methods, tests. I had some trouble coming up with typescript tests for bind, I couldn't get the return type to be what the context is, but this kind of does the same thing proving the context.

No benchmarks as it's not listed in the CONTRIBUTING docs. There is also an error when running yarn out. I have installed the rambda-scripts repo in the correct place and can run yarn new method.

*(feat@method-apply-unapply-bind)[~/projects/rambda] λ yarn out
yarn run v1.22.11
$ yarn populatedocs && yarn populatereadme && yarn immutable && yarn build
$ cd ../rambda-scripts && yarn populate:docs
$ RAMBDA_SCRIPTS_MODE=populate:docs jest src/apply-rambda-scripts.spec.ts
 FAIL  src/apply-rambda-scripts.spec.ts
  ✕ happy (238 ms)

  ● happy

    ENOENT: no such file or directory, scandir '/Users/andrewfo/projects/rambda-scripts/scripts/run-benchmarks/benchmarks/benchmark_results'

      36 |     lodash: 0,
      37 |   }
    > 38 |   const allResults = readdirSync(resultsDir)
         |                      ^
      39 |
      40 |   const tableRows = allResults.map(file => {
      41 |     const {results, name} = readResults(file)

      at Object.<anonymous> (src/read-benchmarks/benchmark-summary.ts:38:22)
      at step (src/read-benchmarks/benchmark-summary.ts:33:23)
      at Object.next (src/read-benchmarks/benchmark-summary.ts:14:53)
      at src/read-benchmarks/benchmark-summary.ts:8:71
      at Object.<anonymous>.__awaiter (src/read-benchmarks/benchmark-summary.ts:4:12)
      at Object.benchmarkSummary (src/read-benchmarks/benchmark-summary.ts:57:12)
      at Object.<anonymous> (src/populate-docs-data/extracts/benchmark-info.ts:49:9)
      at step (src/populate-docs-data/extracts/benchmark-info.ts:33:23)

  console.log
    benchmarkInfo

      at Object.<anonymous> (src/populate-docs-data/extracts/benchmark-info.ts:48:11)

Test Suites: 1 failed, 1 total
Tests:       1 failed, 1 total
Snapshots:   0 total
Time:        4.966 s
Ran all test suites matching /src\/apply-rambda-scripts.spec.ts/i.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
*(feat@method-apply-unapply-bind)[~/projects/rambda] λ 

Cheers,

Andrew

selfrefactor commented 3 years ago

Thank you Andrew. I will approve the MR, but it will have to wait for the release as I have few more things to do in 6.10.0 branch. As for the error during build - I will try to fix that as well.