Skip to content

Commit

Permalink
chore@small
Browse files Browse the repository at this point in the history
  • Loading branch information
Deyan Totev committed Nov 29, 2023
1 parent cc1446e commit c2bc505
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 89 deletions.
32 changes: 3 additions & 29 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ One of the main issues with `Ramda` is the slow process of releasing new version

<details>
<summary>
Click to see the full list of 0 Ramda methods not implemented in Rambda and their status.
Click to see the full list of 57 Ramda methods not implemented in Rambda and their status.
</summary>

- gt
Expand Down Expand Up @@ -1191,8 +1191,7 @@ export function append(x, input){
<summary><strong>Tests</strong></summary>
```javascript
// import { append } from './append.js'
import { append } from 'ramda'
import { append } from './append.js'

test('happy', () => {
expect(append('tests', [ 'write', 'more' ])).toEqual([
Expand Down Expand Up @@ -5726,35 +5725,10 @@ forEach<T, U>(fn: ObjectIterator<T, void>): (list: Dictionary<T>) => Dictionary<
```javascript
import { isArray } from './_internals/isArray.js'
import { keys } from './_internals/keys.js'

export function forEachObjIndexedFn(fn, obj){
let index = 0
const listKeys = keys(obj)
const len = listKeys.length

while (index < len){
const key = listKeys[ index ]
fn(
obj[ key ], key, obj
)
index++
}

return obj
}

export function forEachObjIndexed(fn, list){
if (arguments.length === 1) return _list => forEachObjIndexed(fn, _list)

if (list === undefined) return

return forEachObjIndexedFn(fn, list)
}
import { forEachObjIndexedFn } from './forEachObjIndexed.js'

export function forEach(fn, iterable){
if (arguments.length === 1) return _list => forEach(fn, _list)

if (iterable === undefined) return

if (isArray(iterable)){
Expand Down
32 changes: 3 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ One of the main issues with `Ramda` is the slow process of releasing new version

<details>
<summary>
Click to see the full list of 0 Ramda methods not implemented in Rambda and their status.
Click to see the full list of 57 Ramda methods not implemented in Rambda and their status.
</summary>

- gt
Expand Down Expand Up @@ -1130,8 +1130,7 @@ export function append(x, input){
<summary><strong>Tests</strong></summary>

```javascript
// import { append } from './append.js'
import { append } from 'ramda'
import { append } from './append.js'

test('happy', () => {
expect(append('tests', [ 'write', 'more' ])).toEqual([
Expand Down Expand Up @@ -5427,35 +5426,10 @@ forEach<T, U>(fn: ObjectIterator<T, void>): (list: Dictionary<T>) => Dictionary<

```javascript
import { isArray } from './_internals/isArray.js'
import { keys } from './_internals/keys.js'

export function forEachObjIndexedFn(fn, obj){
let index = 0
const listKeys = keys(obj)
const len = listKeys.length

while (index < len){
const key = listKeys[ index ]
fn(
obj[ key ], key, obj
)
index++
}

return obj
}

export function forEachObjIndexed(fn, list){
if (arguments.length === 1) return _list => forEachObjIndexed(fn, _list)

if (list === undefined) return

return forEachObjIndexedFn(fn, list)
}
import { forEachObjIndexedFn } from './forEachObjIndexed.js'

export function forEach(fn, iterable){
if (arguments.length === 1) return _list => forEach(fn, _list)

if (iterable === undefined) return

if (isArray(iterable)){
Expand Down
1 change: 1 addition & 0 deletions dist/rambda.js
Original file line number Diff line number Diff line change
Expand Up @@ -1295,6 +1295,7 @@ function forEachObjIndexed(fn, list) {
if (list === undefined) return;
return forEachObjIndexedFn(fn, list);
}

function forEach(fn, iterable) {
if (arguments.length === 1) return _list => forEach(fn, _list);
if (iterable === undefined) return;
Expand Down
2 changes: 1 addition & 1 deletion immutable.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ export function compose<TArgs extends readonly any[], R1, R2, R3, R4, R5, R6, R7
f2: (a: R1) => R2,
f1: (...args: TArgs) => R1
]
): (...args: TArgs) => TResult;
): (...args: TArgs) => TResult;
export function compose<TArgs extends readonly any[], R1, R2, R3, R4, R5, R6, R7, TResult>(
f7: (a: R6) => R7,
f6: (a: R5) => R6,
Expand Down
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ export function compose<TArgs extends any[], R1, R2, R3, R4, R5, R6, R7, TResult
f2: (a: R1) => R2,
f1: (...args: TArgs) => R1
]
): (...args: TArgs) => TResult; // fallback overload if number of composed functions greater than 7
): (...args: TArgs) => TResult;
export function compose<TArgs extends any[], R1, R2, R3, R4, R5, R6, R7, TResult>(
f7: (a: R6) => R7,
f6: (a: R5) => R6,
Expand Down
7 changes: 4 additions & 3 deletions rambda.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/// <reference types="./index.d.ts" />
export * from './src/F.js'
export * from './src/T.js'
export * from './src/add.js'
export * from './src/addIndex.js'
export * from './src/addIndexRight.js'
Expand Down Expand Up @@ -59,7 +61,6 @@ export * from './src/eqBy.js'
export * from './src/eqProps.js'
export * from './src/equals.js'
export * from './src/evolve.js'
export * from './src/F.js'
export * from './src/filter.js'
export * from './src/find.js'
export * from './src/findIndex.js'
Expand All @@ -68,6 +69,7 @@ export * from './src/findLastIndex.js'
export * from './src/flatten.js'
export * from './src/flip.js'
export * from './src/forEach.js'
export * from './src/forEachObjIndexed.js'
export * from './src/fromPairs.js'
export * from './src/groupBy.js'
export * from './src/groupWith.js'
Expand Down Expand Up @@ -145,8 +147,8 @@ export * from './src/prop.js'
export * from './src/propEq.js'
export * from './src/propIs.js'
export * from './src/propOr.js'
export * from './src/props.js'
export * from './src/propSatisfies.js'
export * from './src/props.js'
export * from './src/range.js'
export * from './src/reduce.js'
export * from './src/reject.js'
Expand All @@ -166,7 +168,6 @@ export * from './src/startsWith.js'
export * from './src/subtract.js'
export * from './src/sum.js'
export * from './src/symmetricDifference.js'
export * from './src/T.js'
export * from './src/tail.js'
export * from './src/take.js'
export * from './src/takeLast.js'
Expand Down
27 changes: 1 addition & 26 deletions src/forEach.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,8 @@
import { isArray } from './_internals/isArray.js'
import { keys } from './_internals/keys.js'

export function forEachObjIndexedFn(fn, obj){
let index = 0
const listKeys = keys(obj)
const len = listKeys.length

while (index < len){
const key = listKeys[ index ]
fn(
obj[ key ], key, obj
)
index++
}

return obj
}

export function forEachObjIndexed(fn, list){
if (arguments.length === 1) return _list => forEachObjIndexed(fn, _list)

if (list === undefined) return

return forEachObjIndexedFn(fn, list)
}
import { forEachObjIndexedFn } from './forEachObjIndexed.js'

export function forEach(fn, iterable){
if (arguments.length === 1) return _list => forEach(fn, _list)

if (iterable === undefined) return

if (isArray(iterable)){
Expand Down
25 changes: 25 additions & 0 deletions src/forEachObjIndexed.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { keys } from './_internals/keys.js'

export function forEachObjIndexedFn(fn, obj){
let index = 0
const listKeys = keys(obj)
const len = listKeys.length

while (index < len){
const key = listKeys[ index ]
fn(
obj[ key ], key, obj
)
index++
}

return obj
}

export function forEachObjIndexed(fn, list){
if (arguments.length === 1) return _list => forEachObjIndexed(fn, _list)

if (list === undefined) return

return forEachObjIndexedFn(fn, list)
}

0 comments on commit c2bc505

Please sign in to comment.