@comunica/actor-function-factory-term-lesser-than-equal 4.4.2-alpha.49.0 → 4.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/ActorFunctionFactoryTermLesserThanEqual.jsonld +0 -0
- package/components/components.jsonld +0 -0
- package/components/context.jsonld +0 -0
- package/lib/ActorFunctionFactoryTermLesserThanEqual.d.ts +0 -0
- package/lib/ActorFunctionFactoryTermLesserThanEqual.js +0 -0
- package/lib/ActorFunctionFactoryTermLesserThanEqual.js.map +0 -0
- package/lib/TermFunctionLesserThanEqual.d.ts +0 -0
- package/lib/TermFunctionLesserThanEqual.js +9 -26
- package/lib/TermFunctionLesserThanEqual.js.map +1 -1
- package/lib/index.d.ts +0 -0
- package/lib/index.js +0 -0
- package/lib/index.js.map +0 -0
- package/package.json +4 -4
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -9,32 +9,15 @@ class TermFunctionLesserThanEqual extends bus_function_factory_1.TermFunctionBas
|
|
|
9
9
|
arity: 2,
|
|
10
10
|
operator: utils_expression_evaluator_1.SparqlOperator.LTE,
|
|
11
11
|
overloads: (0, utils_expression_evaluator_1.declare)(utils_expression_evaluator_1.SparqlOperator.LTE)
|
|
12
|
-
.set(['term', 'term'], exprEval => ([first, second]) =>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
catch (error) {
|
|
23
|
-
// If an error occurs, store it for later.
|
|
24
|
-
lessThanError = error;
|
|
25
|
-
}
|
|
26
|
-
// Then check if they are equal, and return if so.
|
|
27
|
-
if (this.equalityFunction.applyOnTerms([first, second], exprEval)
|
|
28
|
-
.typedValue) {
|
|
29
|
-
return (0, utils_expression_evaluator_1.bool)(true);
|
|
30
|
-
}
|
|
31
|
-
// If less than produced an error and equals was false, throw the error.
|
|
32
|
-
if (lessThanError) {
|
|
33
|
-
throw lessThanError;
|
|
34
|
-
}
|
|
35
|
-
// In all other cases, return false
|
|
36
|
-
return (0, utils_expression_evaluator_1.bool)(false);
|
|
37
|
-
})
|
|
12
|
+
.set(['term', 'term'], exprEval => ([first, second]) =>
|
|
13
|
+
// X <= Y -> X < Y || X = Y
|
|
14
|
+
// First check if the first is lesser than the second, then check if they are equal.
|
|
15
|
+
// Doing this, the correct error will be thrown,
|
|
16
|
+
// each type that has a lesserThanEqual has a matching lesserThan.
|
|
17
|
+
(0, utils_expression_evaluator_1.bool)(this.lessThanFunction.applyOnTerms([first, second], exprEval)
|
|
18
|
+
.typedValue ||
|
|
19
|
+
this.equalityFunction.applyOnTerms([first, second], exprEval)
|
|
20
|
+
.typedValue))
|
|
38
21
|
.collect(),
|
|
39
22
|
});
|
|
40
23
|
this.equalityFunction = equalityFunction;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TermFunctionLesserThanEqual.js","sourceRoot":"","sources":["TermFunctionLesserThanEqual.ts"],"names":[],"mappings":";;;AACA,yEAAkE;AAIlE,qFAI8C;AAE9C,MAAa,2BAA4B,SAAQ,uCAAgB;IAC/D,YACmB,gBAA+B,EAC/B,gBAA+B;QAEhD,KAAK,CAAC;YACJ,KAAK,EAAE,CAAC;YACR,QAAQ,EAAE,2CAAc,CAAC,GAAG;YAC5B,SAAS,EAAE,IAAA,oCAAO,EAAC,2CAAc,CAAC,GAAG,CAAC;iBACnC,GAAG,CAAC,CAAE,MAAM,EAAE,MAAM,CAAE,EAAE,QAAQ,CAAC,EAAE,CAClC,CAAC,CAAE,KAAK,EAAE,MAAM,CAAE,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"TermFunctionLesserThanEqual.js","sourceRoot":"","sources":["TermFunctionLesserThanEqual.ts"],"names":[],"mappings":";;;AACA,yEAAkE;AAIlE,qFAI8C;AAE9C,MAAa,2BAA4B,SAAQ,uCAAgB;IAC/D,YACmB,gBAA+B,EAC/B,gBAA+B;QAEhD,KAAK,CAAC;YACJ,KAAK,EAAE,CAAC;YACR,QAAQ,EAAE,2CAAc,CAAC,GAAG;YAC5B,SAAS,EAAE,IAAA,oCAAO,EAAC,2CAAc,CAAC,GAAG,CAAC;iBACnC,GAAG,CAAC,CAAE,MAAM,EAAE,MAAM,CAAE,EAAE,QAAQ,CAAC,EAAE,CAClC,CAAC,CAAE,KAAK,EAAE,MAAM,CAAE,EAAE,EAAE;YACpB,2BAA2B;YAC3B,oFAAoF;YACpF,gDAAgD;YAChD,kEAAkE;YAClE,IAAA,iCAAI,EACgB,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAE,KAAK,EAAE,MAAM,CAAE,EAAE,QAAQ,CAAE;iBAC/E,UAAU;gBACK,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAE,KAAK,EAAE,MAAM,CAAE,EAAE,QAAQ,CAAE;qBAC/E,UAAU,CACd,CAAC;iBACL,OAAO,EAAE;SACb,CAAC,CAAC;QApBc,qBAAgB,GAAhB,gBAAgB,CAAe;QAC/B,qBAAgB,GAAhB,gBAAgB,CAAe;IAoBlD,CAAC;CACF;AAxBD,kEAwBC","sourcesContent":["import type { ITermFunction } from '@comunica/bus-function-factory';\nimport { TermFunctionBase } from '@comunica/bus-function-factory';\nimport type {\n BooleanLiteral,\n} from '@comunica/utils-expression-evaluator';\nimport {\n bool,\n declare,\n SparqlOperator,\n} from '@comunica/utils-expression-evaluator';\n\nexport class TermFunctionLesserThanEqual extends TermFunctionBase {\n public constructor(\n private readonly equalityFunction: ITermFunction,\n private readonly lessThanFunction: ITermFunction,\n ) {\n super({\n arity: 2,\n operator: SparqlOperator.LTE,\n overloads: declare(SparqlOperator.LTE)\n .set([ 'term', 'term' ], exprEval =>\n ([ first, second ]) =>\n // X <= Y -> X < Y || X = Y\n // First check if the first is lesser than the second, then check if they are equal.\n // Doing this, the correct error will be thrown,\n // each type that has a lesserThanEqual has a matching lesserThan.\n bool(\n (<BooleanLiteral> this.lessThanFunction.applyOnTerms([ first, second ], exprEval))\n .typedValue ||\n (<BooleanLiteral> this.equalityFunction.applyOnTerms([ first, second ], exprEval))\n .typedValue,\n ))\n .collect(),\n });\n }\n}\n"]}
|
package/lib/index.d.ts
CHANGED
|
File without changes
|
package/lib/index.js
CHANGED
|
File without changes
|
package/lib/index.js.map
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@comunica/actor-function-factory-term-lesser-than-equal",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.0",
|
|
4
4
|
"description": "A term-lesser-than-equal function-factory actor",
|
|
5
5
|
"lsd:module": true,
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"build:components": "componentsjs-generator"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@comunica/bus-function-factory": "4.
|
|
41
|
-
"@comunica/utils-expression-evaluator": "4.
|
|
40
|
+
"@comunica/bus-function-factory": "^4.5.0",
|
|
41
|
+
"@comunica/utils-expression-evaluator": "^4.5.0"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "2bcd98c387a021fc5c08d375793c205ca3d1bf0d"
|
|
44
44
|
}
|