Skip to content

Commit

Permalink
fix(types): fix regression in @types/ramda@0.29.6
Browse files Browse the repository at this point in the history
Refs #3279
  • Loading branch information
char0n committed Oct 17, 2023
1 parent 6e046ac commit 71d4bb2
Show file tree
Hide file tree
Showing 42 changed files with 124 additions and 92 deletions.
80 changes: 42 additions & 38 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"sinon": "=16.1.0",
"terser-webpack-plugin": "=5.3.9",
"ts-node": "=10.9.1",
"typescript": "=4.9.5",
"typescript": "=5.2.2",
"webpack": "=5.89.0",
"webpack-cli": "=5.1.4"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/apidom-ast/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"dependencies": {
"@babel/runtime-corejs3": "^7.20.7",
"@swagger-api/apidom-error": "^0.77.0",
"@types/ramda": "~0.29.3",
"@types/ramda": "~0.29.6",
"ramda": "~0.29.0",
"ramda-adjunct": "^4.1.1",
"stampit": "^4.3.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/apidom-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@babel/runtime-corejs3": "^7.20.7",
"@swagger-api/apidom-ast": "^0.77.0",
"@swagger-api/apidom-error": "^0.77.0",
"@types/ramda": "~0.29.3",
"@types/ramda": "~0.29.6",
"minim": "~0.23.8",
"ramda": "~0.29.0",
"ramda-adjunct": "^4.1.1",
Expand Down
6 changes: 4 additions & 2 deletions packages/apidom-core/src/traversal/filter.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { Pred } from 'ramda';
import { ArraySlice, Element } from 'minim';

import { PredicateVisitor, visit } from './visitor';

// finds all elements matching the predicate
const filter = <T extends Element>(predicate: Pred, element: T): ArraySlice => {
const filter = <T extends Element>(
predicate: (element: any) => boolean,
element: T,
): ArraySlice => {
const visitor = PredicateVisitor({ predicate });

visit(element, visitor);
Expand Down
7 changes: 5 additions & 2 deletions packages/apidom-core/src/traversal/find.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { pathOr, Pred } from 'ramda';
import { pathOr } from 'ramda';
import { Element } from 'minim';

import { PredicateVisitor, BREAK, visit } from './visitor';

// find first element that satisfies the provided predicate
const find = <T extends Element>(predicate: Pred, element: T): T | undefined => {
const find = <T extends Element>(
predicate: (element: any) => boolean,
element: T,
): T | undefined => {
const visitor = PredicateVisitor({ predicate, returnOnTrue: BREAK });

visit(element, visitor);
Expand Down
7 changes: 5 additions & 2 deletions packages/apidom-core/src/traversal/reject.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { complement, Pred } from 'ramda';
import { complement } from 'ramda';
import { ArraySlice, Element } from 'minim';

import filter from './filter';

// complement of filter
const reject = <T extends Element>(predicate: Pred, element: T): ArraySlice => {
const reject = <T extends Element>(
predicate: (element: any) => boolean,
element: T,
): ArraySlice => {
return filter(complement(predicate), element);
};

Expand Down
3 changes: 1 addition & 2 deletions packages/apidom-core/src/traversal/some.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Pred } from 'ramda';
import { isNotUndefined } from 'ramda-adjunct';
import { Element } from 'minim';

import find from './find';

// tests whether at least one element passes the predicate
const some = <T extends Element>(predicate: Pred, element: T): boolean => {
const some = <T extends Element>(predicate: (element: any) => boolean, element: T): boolean => {
return isNotUndefined(find(predicate, element));
};

Expand Down
Loading

0 comments on commit 71d4bb2

Please sign in to comment.