From 1a17f8b70d3d813c4c5a8f2307dfa3ef757c1705 Mon Sep 17 00:00:00 2001 From: Dejan Toteff Date: Thu, 24 Oct 2024 07:32:43 +0300 Subject: [PATCH] chore@small --- .github/README.md | 39 +++++++++++++++++++++++---------- CHANGELOG.md | 4 ++++ README.md | 31 +++++++++++++++++++------- dist/rambda.umd.js | 2 +- files/NEXT_VERSION_CHECKLIST.md | 1 + immutable.d.ts | 6 ++--- index.d.ts | 6 ++--- 7 files changed, 60 insertions(+), 29 deletions(-) diff --git a/.github/README.md b/.github/README.md index d58f79d1..c346cc75 100644 --- a/.github/README.md +++ b/.github/README.md @@ -1857,7 +1857,7 @@ describe('applySpec', () => { ### ascend -Try this R.ascend example in Rambda REPL +Try this R.ascend example in Rambda REPL [![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#ascend) @@ -1967,7 +1967,7 @@ export const assocPath = curry(assocPathFn) ```javascript import { assocPathFn } from './assocPath.js' -test.only('happy', () => { +test('happy', () => { const path = 'a.c.1' const input = { a : { @@ -2008,7 +2008,7 @@ test('string can be used as path input', () => { test('difference with ramda - doesn\'t overwrite primitive values with keys in the path', () => { const obj = { a : 'str' } - const result = assocPath( + const result = assocPathFn( [ 'a', 'b' ], 42, obj ) @@ -2022,7 +2022,18 @@ test('difference with ramda - doesn\'t overwrite primitive values with keys in t }) }) -test('bug', () => { +test('bug 748', () => { + /* + https://github.com/selfrefactor/rambda/issues/748 + */ + const obj = {}; + let result = assocPathFn(['a', '2'], 3, obj) + let result1 = assocPath(['a', '2'], 3, obj) + console.log({result}) + console.log(result1) +}) + +test('bug 524', () => { /* https://github.com/selfrefactor/rambda/issues/524 */ @@ -3038,7 +3049,7 @@ describe('R.defaultTo with Ramda spec', () => { ### descend -Try this R.descend example in Rambda REPL +Try this R.descend example in Rambda REPL [![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#descend) @@ -5951,7 +5962,7 @@ It splits `list` according to a provided `groupFn` function and returns an objec It returns separated version of list or string `input`, where separation is done with equality `compareFn` function. -Try this R.groupWith example in Rambda REPL +Try this R.groupWith example in Rambda REPL [![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#groupWith) @@ -8090,13 +8101,13 @@ const iterable = [1, 2] const obj = {a: 1, b: 2} const result = [ - R.map(fn, list), - R.map(fnWhenObject, Record) + R.map(fn, iterable), + R.map(fnWhenObject, obj) ] -// => [ [1, 4], {a: 'a-1', b: 'b-2'}] +// => [ [2, 4], {a: 'a-1', b: 'b-2'}] ``` -Try this R.map example in Rambda REPL +Try this R.map example in Rambda REPL
@@ -8345,11 +8356,11 @@ const fn = (val, prop) => { const obj = {a: 1, b: 2} -const result = R.map(mapObjIndexed, Record) +const result = R.mapObjIndexed(fn, obj) // => {a: 'a-1', b: 'b-2'} ``` -Try this R.mapObjIndexed example in Rambda REPL +Try this R.mapObjIndexed example in Rambda REPL
@@ -18572,6 +18583,10 @@ describe('R.zipWith', () => { ## ❯ CHANGELOG +9.4.0 + +- Fix `deno` release + 9.3.0 - Breaking change in relation to TS typings of `R.assoc`, `R.dissoc` and `R.modify` - https://github.com/ramda/types/pull/37 diff --git a/CHANGELOG.md b/CHANGELOG.md index 95440e53..3a45b461 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +9.4.0 + +- Fix `deno` release + 9.3.0 - Breaking change in relation to TS typings of `R.assoc`, `R.dissoc` and `R.modify` - https://github.com/ramda/types/pull/37 diff --git a/README.md b/README.md index 8ec6c205..e274bd75 100644 --- a/README.md +++ b/README.md @@ -1768,7 +1768,7 @@ describe('applySpec', () => { ### ascend -Try this R.ascend example in Rambda REPL +Try this R.ascend example in Rambda REPL [![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#ascend) @@ -1865,7 +1865,7 @@ export const assocPath = curry(assocPathFn) ```javascript import { assocPathFn } from './assocPath.js' -test.only('happy', () => { +test('happy', () => { const path = 'a.c.1' const input = { a : { @@ -1906,7 +1906,7 @@ test('string can be used as path input', () => { test('difference with ramda - doesn\'t overwrite primitive values with keys in the path', () => { const obj = { a : 'str' } - const result = assocPath( + const result = assocPathFn( [ 'a', 'b' ], 42, obj ) @@ -1920,7 +1920,18 @@ test('difference with ramda - doesn\'t overwrite primitive values with keys in t }) }) -test('bug', () => { +test('bug 748', () => { + /* + https://github.com/selfrefactor/rambda/issues/748 + */ + const obj = {}; + let result = assocPathFn(['a', '2'], 3, obj) + let result1 = assocPath(['a', '2'], 3, obj) + console.log({result}) + console.log(result1) +}) + +test('bug 524', () => { /* https://github.com/selfrefactor/rambda/issues/524 */ @@ -2884,7 +2895,7 @@ describe('R.defaultTo with Ramda spec', () => { ### descend -Try this R.descend example in Rambda REPL +Try this R.descend example in Rambda REPL [![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#descend) @@ -5631,7 +5642,7 @@ It splits `list` according to a provided `groupFn` function and returns an objec It returns separated version of list or string `input`, where separation is done with equality `compareFn` function. -Try this R.groupWith example in Rambda REPL +Try this R.groupWith example in Rambda REPL [![---------------](https://raw.githubusercontent.com/selfrefactor/rambda/master/files/separator.png)](#groupWith) @@ -7601,7 +7612,7 @@ It returns the result of looping through `iterable` with `fn`. It works with both array and object. -Try this R.map example in Rambda REPL +Try this R.map example in Rambda REPL
@@ -7843,7 +7854,7 @@ mapObjIndexed(fn: ObjectIterator, iterable: Dictionary): Dictionary< It works the same way as `R.map` does for objects. It is added as Ramda also has this method. -Try this R.mapObjIndexed example in Rambda REPL +Try this R.mapObjIndexed example in Rambda REPL
@@ -17262,6 +17273,10 @@ describe('R.zipWith', () => { ## ❯ CHANGELOG +9.4.0 + +- Fix `deno` release + 9.3.0 - Breaking change in relation to TS typings of `R.assoc`, `R.dissoc` and `R.modify` - https://github.com/ramda/types/pull/37 diff --git a/dist/rambda.umd.js b/dist/rambda.umd.js index 4ccf5423..95d8ee80 100644 --- a/dist/rambda.umd.js +++ b/dist/rambda.umd.js @@ -1 +1 @@ -!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((n="undefined"!=typeof globalThis?globalThis:n||self).R={})}(this,function(n){"use strict";function a(n,l){switch(n){case 0:return function(){return l.apply(this,arguments)};case 1:return function(n){return l.apply(this,arguments)};case 2:return function(n,r){return l.apply(this,arguments)};case 3:return function(n,r,t){return l.apply(this,arguments)};case 4:return function(n,r,t,e){return l.apply(this,arguments)};case 5:return function(n,r,t,e,u){return l.apply(this,arguments)};case 6:return function(n,r,t,e,u,i){return l.apply(this,arguments)};case 7:return function(n,r,t,e,u,i,o){return l.apply(this,arguments)};case 8:return function(n,r,t,e,u,i,o,c){return l.apply(this,arguments)};case 9:return function(n,r,t,e,u,i,o,c,f){return l.apply(this,arguments)};default:return function(n,r,t,e,u,i,o,c,f,a){return l.apply(this,arguments)}}}function t(r,n){if(1===arguments.length)return function(n){return t(r,n)};if(10>>0,r>>>=0,Array(u));++en(r)?t:r}var Gn=p($n);function Kn(n){return n.reduce(function(n,r){return n+r},0)}function Qn(n){return Kn(n)/n.length}function W(r,n){return 1===arguments.length?function(n){return W(r,n)}:Object.assign({},r||{},n||{})}function B(r,t){var e;return 1===arguments.length?function(n){return B(r,n)}:(e=b(r),Object.keys(t).forEach(function(n){"Object"===x(t[n])&&"Object"===x(r[n])?e[n]=B(r[n],t[n]):e[n]=t[n]}),e)}function Vn(r,n,t){var e=null!=n?n:{},u=null!=t?t:{},i={};return Object.keys(e).forEach(function(n){i[n]=void 0===u[n]?e[n]:r(e[n],u[n])}),Object.keys(u).forEach(function(n){void 0===i[n]&&(i[n]=void 0===e[n]?u[n]:r(e[n],u[n]))}),i}var Xn=p(Vn);function Yn(n,r,t){return n(t) 4")};var e},n.forEach=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if(void 0!==n){if(!g(n))return Tn(t,n);for(var e=0,u=n.length;e>>0,r>>>=0,Array(u));++en(r)?t:r}var Gn=p($n);function Kn(n){return n.reduce(function(n,r){return n+r},0)}function Qn(n){return Kn(n)/n.length}function W(r,n){return 1===arguments.length?function(n){return W(r,n)}:Object.assign({},r||{},n||{})}function B(r,t){var e;return 1===arguments.length?function(n){return B(r,n)}:(e=b(r),Object.keys(t).forEach(function(n){"Object"===x(t[n])&&"Object"===x(r[n])?e[n]=B(r[n],t[n]):e[n]=t[n]}),e)}function Vn(r,n,t){var e=null!=n?n:{},u=null!=t?t:{},i={};return Object.keys(e).forEach(function(n){i[n]=void 0===u[n]?e[n]:r(e[n],u[n])}),Object.keys(u).forEach(function(n){void 0===i[n]&&(i[n]=void 0===e[n]?u[n]:r(e[n],u[n]))}),i}var Xn=p(Vn);function Yn(n,r,t){return n(t) 4")};var e},n.forEach=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if(void 0!==n){if(!g(n))return Tn(t,n);for(var e=0,u=n.length;e(listOfPairs: readonly ((readonly [string, V]))[]): /** * It splits `list` according to a provided `groupFn` function and returns an object. */ -export function groupBy(groupFn: (x: T) => string, list: readonly T[]): { readonly [index: string]: readonly T[] }; -export function groupBy(groupFn: (x: T) => string): (list: readonly T[]) => { readonly [index: string]: readonly T[] }; -export function groupBy(groupFn: (x: T) => string, list: readonly T[]): U; -export function groupBy(groupFn: (x: T) => string): (list: readonly T[]) => U; +export function groupBy(fn: (a: T) => K): (list: readonly T[]) => Partial>; +export function groupBy(fn: (a: T) => K, list: readonly T[]): Partial>; /** * It returns separated version of list or string `input`, where separation is done with equality `compareFn` function. diff --git a/index.d.ts b/index.d.ts index 4ee5d681..56d7986e 100644 --- a/index.d.ts +++ b/index.d.ts @@ -687,10 +687,8 @@ export function fromPairs(listOfPairs: ([string, V])[]): { [index: string]: V /** * It splits `list` according to a provided `groupFn` function and returns an object. */ -export function groupBy(groupFn: (x: T) => string, list: T[]): { [index: string]: T[] }; -export function groupBy(groupFn: (x: T) => string): (list: T[]) => { [index: string]: T[] }; -export function groupBy(groupFn: (x: T) => string, list: T[]): U; -export function groupBy(groupFn: (x: T) => string): (list: T[]) => U; +export function groupBy(fn: (a: T) => K): (list: T[]) => Partial>; +export function groupBy(fn: (a: T) => K, list: T[]): Partial>; /** * It returns separated version of list or string `input`, where separation is done with equality `compareFn` function.