@swagger-api/apidom-core
Advanced tools
Comparing version 0.69.2 to 0.69.3
@@ -6,2 +6,6 @@ # Change Log | ||
## [0.69.3](https://github.com/swagger-api/apidom/compare/v0.69.2...v0.69.3) (2023-04-27) | ||
**Note:** Version bump only for package @swagger-api/apidom-core | ||
## [0.69.2](https://github.com/swagger-api/apidom/compare/v0.69.1...v0.69.2) (2023-04-03) | ||
@@ -8,0 +12,0 @@ |
@@ -1,14 +0,10 @@ | ||
import { curry } from 'ramda'; | ||
import { ArraySlice } from 'minim'; | ||
import { PredicateVisitor, visit } from "./visitor.js"; // finds all elements matching the predicate | ||
// filter :: Pred -> Element -> ArraySlice | ||
const filter = curry((predicate, element) => { | ||
const filter = (predicate, element) => { | ||
const visitor = PredicateVisitor({ | ||
predicate | ||
}); | ||
// @ts-ignore | ||
visit(element, visitor); | ||
return new ArraySlice(visitor.result); | ||
}); | ||
}; | ||
export default filter; |
@@ -1,5 +0,4 @@ | ||
import { curry, pathOr } from 'ramda'; | ||
import { pathOr } from 'ramda'; | ||
import { PredicateVisitor, BREAK, visit } from "./visitor.js"; // find first element that satisfies the provided predicate | ||
// find :: Pred -> Element -> Element | Undefined | ||
const find = curry((predicate, element) => { | ||
const find = (predicate, element) => { | ||
const visitor = PredicateVisitor({ | ||
@@ -9,7 +8,5 @@ predicate, | ||
}); | ||
// @ts-ignore | ||
visit(element, visitor); | ||
return pathOr(undefined, [0], visitor.result); | ||
}); | ||
}; | ||
export default find; |
import stampit from 'stampit'; | ||
import { curry, last, pathOr } from 'ramda'; | ||
import { last, pathOr } from 'ramda'; | ||
import { isNumber } from 'ramda-adjunct'; | ||
@@ -44,3 +44,3 @@ import { hasElementSourceMap } from "../predicates/index.js"; | ||
// findAtOffset :: Number -> Element -> Element | Undefined | ||
const findAtOffset = curry((options, element) => { | ||
const findAtOffset = (options, element) => { | ||
let offset; | ||
@@ -59,9 +59,5 @@ let includeRightBound; | ||
}); | ||
// @ts-ignore | ||
visit(element, visitor); | ||
// @ts-ignore | ||
return last(visitor.result); | ||
}); | ||
}; | ||
export default findAtOffset; |
@@ -34,3 +34,2 @@ import stampit from 'stampit'; | ||
// computes upwards edges from every child to its parent | ||
// find :: Element -> WeakMap<Element, Element> | ||
const parents = element => { | ||
@@ -37,0 +36,0 @@ const visitor = Visitor(); |
@@ -1,7 +0,6 @@ | ||
import { complement, curry } from 'ramda'; | ||
import { complement } from 'ramda'; | ||
import filter from "./filter.js"; // complement of filter | ||
// reject :: Pred -> Element -> ArraySlice | ||
const reject = curry((predicate, element) => { | ||
return filter(complement(predicate))(element); | ||
}); | ||
const reject = (predicate, element) => { | ||
return filter(complement(predicate), element); | ||
}; | ||
export default reject; |
@@ -1,8 +0,6 @@ | ||
import { curry } from 'ramda'; | ||
import { isNotUndefined } from 'ramda-adjunct'; | ||
import find from "./find.js"; // tests whether at least one element passes the predicate | ||
// some :: Pred -> Element -> Boolean | ||
const some = curry((predicate, element) => { | ||
return isNotUndefined(find(predicate)(element)); | ||
}); | ||
const some = (predicate, element) => { | ||
return isNotUndefined(find(predicate, element)); | ||
}; | ||
export default some; |
import stampit from 'stampit'; | ||
import { curry, pathOr } from 'ramda'; | ||
import { pathOr } from 'ramda'; | ||
import { isFunction, noop } from 'ramda-adjunct'; | ||
@@ -28,4 +28,3 @@ import { visit, PredicateVisitor } from "./visitor.js"; | ||
// executes the callback on this element and all descendants | ||
// traverse :: Callback | { predicate: Pred, callback: Callback } -> Element -> Undefined | ||
const traverse = curry((options, element) => { | ||
const traverse = (options, element) => { | ||
let callback; | ||
@@ -47,3 +46,3 @@ let predicate; | ||
visit(element, visitor); | ||
}); | ||
}; | ||
export default traverse; |
@@ -8,3 +8,3 @@ import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty"; | ||
import stampit from 'stampit'; | ||
import { curryN, F as stubFalse, pipe } from 'ramda'; | ||
import { F as stubFalse, pipe } from 'ramda'; | ||
import { isString } from 'ramda-adjunct'; | ||
@@ -30,3 +30,3 @@ import { visit as astVisit, BREAK, mergeAllVisitors } from '@swagger-api/apidom-ast'; | ||
// isNode :: Node -> Boolean | ||
export const isNode = curryN(1, pipe(getNodeType, isString)); | ||
export const isNode = pipe(getNodeType, isString); | ||
export const keyMapDefault = { | ||
@@ -33,0 +33,0 @@ ObjectElement: ['content'], |
{ | ||
"name": "@swagger-api/apidom-core", | ||
"version": "0.69.2", | ||
"version": "0.69.3", | ||
"description": "Tools for manipulating ApiDOM structures.", | ||
@@ -45,7 +45,7 @@ "publishConfig": { | ||
"@babel/runtime-corejs3": "^7.20.7", | ||
"@swagger-api/apidom-ast": "^0.69.0", | ||
"@types/ramda": "=0.28.23", | ||
"@swagger-api/apidom-ast": "^0.69.3", | ||
"@types/ramda": "=0.29.0", | ||
"minim": "=0.23.8", | ||
"ramda": "=0.28.0", | ||
"ramda-adjunct": "=3.4.0", | ||
"ramda": "=0.29.0", | ||
"ramda-adjunct": "=4.0.0", | ||
"short-unique-id": "=4.4.4", | ||
@@ -65,3 +65,3 @@ "stampit": "=4.3.2" | ||
], | ||
"gitHead": "fcd0f16e6cddd1593e3d74c79be4f27fa49d4f1b" | ||
"gitHead": "282b7885b28b7595534ce65b2c72f752c27cdf88" | ||
} |
/// <reference path="./minim.d.ts" /> | ||
/// <reference types="ts-toolbelt" /> | ||
import { Element, Namespace as Namespace$1, NamespacePlugin, StringElement, Meta, Attributes, ArrayElement, ArraySlice, ObjectElement } from 'minim'; | ||
export { ArrayElement, ArraySlice, Attributes, BooleanElement, Element, KeyValuePair, LinkElement, MemberElement, Meta, NamespacePluginOptions, NullElement, NumberElement, ObjectElement, ObjectSlice, RefElement, StringElement, refract } from 'minim'; | ||
import * as Function_Curry from 'Function/Curry'; | ||
import { Pred } from 'ramda'; | ||
@@ -127,5 +125,5 @@ import stampit from 'stampit'; | ||
declare const filter: Function_Curry.Curry<(<T extends Element>(predicate: Pred, element: T) => ArraySlice)>; | ||
declare const filter: <T extends Element>(predicate: Pred, element: T) => ArraySlice; | ||
declare const find: Function_Curry.Curry<(<T extends Element>(predicate: Pred, element: T) => T | undefined)>; | ||
declare const find: <T extends Element>(predicate: Pred, element: T) => T | undefined; | ||
@@ -136,7 +134,7 @@ interface FindAtOffsetOptions { | ||
} | ||
declare const findAtOffset: Function_Curry.Curry<(<T extends Element>(options: number | FindAtOffsetOptions, element: T) => T | undefined)>; | ||
declare const findAtOffset: <T extends Element>(options: number | FindAtOffsetOptions, element: T) => T | undefined; | ||
declare const reject: Function_Curry.Curry<(<T extends Element>(predicate: Pred, element: T) => ArraySlice)>; | ||
declare const reject: <T extends Element>(predicate: Pred, element: T) => ArraySlice; | ||
declare const some: Function_Curry.Curry<(<T extends Element>(predicate: Pred, element: T) => boolean)>; | ||
declare const some: <T extends Element>(predicate: Pred, element: T) => boolean; | ||
@@ -148,3 +146,3 @@ type Callback = <T extends Element>(element: T) => void; | ||
} | ||
declare const traverse: Function_Curry.Curry<(<T extends Element>(options: Callback | TraverseOptions, element: T) => void)>; | ||
declare const traverse: <T extends Element>(options: Callback | TraverseOptions, element: T) => void; | ||
@@ -151,0 +149,0 @@ declare const parents: <T extends Element>(element: T) => WeakMap<Element, Element>; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1331423
28904
Updated@types/ramda@=0.29.0
Updatedramda@=0.29.0
Updatedramda-adjunct@=4.0.0