@getodk/xpath 0.1.0 → 0.1.1
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/dist/.vite/manifest.json +7 -4
- package/dist/context/Context.d.ts +6 -5
- package/dist/context/EvaluationContext.d.ts +7 -6
- package/dist/evaluations/BooleanEvaluation.d.ts +2 -1
- package/dist/evaluations/DateTimeLikeEvaluation.d.ts +2 -1
- package/dist/evaluations/Evaluation.d.ts +3 -2
- package/dist/evaluations/LocationPathEvaluation.d.ts +14 -13
- package/dist/evaluations/NodeEvaluation.d.ts +2 -1
- package/dist/evaluations/NumberEvaluation.d.ts +2 -1
- package/dist/evaluations/StringEvaluation.d.ts +2 -1
- package/dist/evaluations/ValueEvaluation.d.ts +3 -2
- package/dist/evaluator/Evaluator.d.ts +6 -5
- package/dist/evaluator/NamespaceResolver.d.ts +3 -2
- package/dist/evaluator/expression/AbsoluteLocationPathExpressionEvaluator.d.ts +3 -2
- package/dist/evaluator/expression/BinaryExpressionEvaluator.d.ts +5 -4
- package/dist/evaluator/expression/BooleanBinaryExpressionEvaluator.d.ts +4 -3
- package/dist/evaluator/expression/ExpressionEvaluator.d.ts +4 -3
- package/dist/evaluator/expression/FilterPathExpressionEvaluator.d.ts +5 -4
- package/dist/evaluator/expression/FunctionCallExpressionEvaluator.d.ts +5 -4
- package/dist/evaluator/expression/LocationPathEvaluator.d.ts +5 -4
- package/dist/evaluator/expression/LocationPathExpressionEvaluator.d.ts +4 -3
- package/dist/evaluator/expression/NumberExpressionEvaluator.d.ts +3 -2
- package/dist/evaluator/expression/NumberLiteralExpressionEvaluator.d.ts +3 -2
- package/dist/evaluator/expression/NumericBinaryExpressionEvaluator.d.ts +3 -2
- package/dist/evaluator/expression/RelativeLocationPathExpressionEvaluator.d.ts +3 -2
- package/dist/evaluator/expression/StringExpressionEvaluator.d.ts +3 -2
- package/dist/evaluator/expression/StringLiteralExpressionEvaluator.d.ts +3 -2
- package/dist/evaluator/expression/UnaryExpressionEvaluator.d.ts +4 -3
- package/dist/evaluator/expression/UnionExpressionEvaluator.d.ts +4 -3
- package/dist/evaluator/expression/factory.d.ts +3 -2
- package/dist/evaluator/functions/BooleanFunction.d.ts +3 -3
- package/dist/evaluator/functions/FunctionAlias.d.ts +1 -0
- package/dist/evaluator/functions/FunctionImplementation.d.ts +5 -4
- package/dist/evaluator/functions/FunctionLibrary.d.ts +3 -2
- package/dist/evaluator/functions/FunctionLibraryCollection.d.ts +4 -3
- package/dist/evaluator/functions/NodeSetFunction.d.ts +2 -2
- package/dist/evaluator/functions/NumberFunction.d.ts +3 -3
- package/dist/evaluator/functions/StringFunction.d.ts +3 -3
- package/dist/evaluator/functions/TypedFunctionImplementation.d.ts +3 -3
- package/dist/evaluator/result/BooleanResult.d.ts +3 -2
- package/dist/evaluator/result/NodeSetResult.d.ts +3 -3
- package/dist/evaluator/result/NumberResult.d.ts +3 -2
- package/dist/evaluator/result/PrimitiveResult.d.ts +3 -3
- package/dist/evaluator/result/StringResult.d.ts +3 -2
- package/dist/evaluator/result/index.d.ts +3 -2
- package/dist/evaluator/step/Step.d.ts +2 -1
- package/dist/expressionParser-BbqMYp75.js +2116 -0
- package/dist/expressionParser-BbqMYp75.js.map +1 -0
- package/dist/expressionParser.d.ts +1 -0
- package/dist/expressionParser.js +1 -1
- package/dist/functions/_shared/number.d.ts +3 -2
- package/dist/functions/_shared/string.d.ts +3 -2
- package/dist/functions/enketo/index.d.ts +1 -0
- package/dist/functions/fn/boolean.d.ts +1 -0
- package/dist/functions/fn/index.d.ts +1 -0
- package/dist/functions/fn/node-set.d.ts +1 -0
- package/dist/functions/fn/number.d.ts +1 -0
- package/dist/functions/fn/string.d.ts +1 -0
- package/dist/functions/javarosa/index.d.ts +1 -0
- package/dist/functions/javarosa/string.d.ts +1 -0
- package/dist/functions/xforms/boolean.d.ts +1 -0
- package/dist/functions/xforms/datetime.d.ts +1 -0
- package/dist/functions/xforms/geo.d.ts +1 -0
- package/dist/functions/xforms/index.d.ts +1 -0
- package/dist/functions/xforms/node-set.d.ts +1 -0
- package/dist/functions/xforms/number.d.ts +1 -0
- package/dist/functions/xforms/select.d.ts +1 -0
- package/dist/functions/xforms/string.d.ts +1 -0
- package/dist/index.js +213 -105
- package/dist/index.js.map +1 -1
- package/dist/lib/datetime/coercion.d.ts +1 -0
- package/dist/lib/datetime/functions.d.ts +1 -0
- package/dist/lib/dom/assertions.d.ts +2 -1
- package/dist/lib/dom/predicates.d.ts +2 -1
- package/dist/lib/dom/traversal.d.ts +2 -1
- package/dist/lib/iterators/common.d.ts +1 -1
- package/dist/static/grammar/ExpressionParser.d.ts +5 -4
- package/dist/static/grammar/SyntaxLanguage.d.ts +2 -1
- package/dist/static/grammar/SyntaxNode.d.ts +2 -1
- package/dist/static/grammar/SyntaxTree.d.ts +3 -2
- package/dist/static/grammar/TreeSitterXPathParser.d.ts +2 -1
- package/dist/static/grammar/type-names.d.ts +2 -1
- package/dist/xforms/XFormsItextTranslations.d.ts +3 -2
- package/dist/xforms/XFormsXPathEvaluator.d.ts +3 -3
- package/package.json +14 -15
- package/dist/expressionParser-1Kzq3bIy.js +0 -2356
- package/dist/expressionParser-1Kzq3bIy.js.map +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Temporal } from '@js-temporal/polyfill';
|
|
2
|
+
|
|
2
3
|
export declare const tryParseDateString: (value: string) => Date | null;
|
|
3
4
|
export declare const dateTimeFromString: (timeZone: Temporal.TimeZone, value: string) => Temporal.ZonedDateTime | null;
|
|
4
5
|
export declare const dateTimeFromNumber: (timeZone: Temporal.TimeZone, milliseconds: number) => Temporal.ZonedDateTime | null;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Temporal } from '@js-temporal/polyfill';
|
|
2
|
+
|
|
2
3
|
export declare const currentLocalDateTimeString: (timeZone: Temporal.TimeZone) => string;
|
|
3
4
|
export declare const localDateTimeString: (dateTime: Temporal.ZonedDateTime) => string;
|
|
4
5
|
export declare const localDateTimeOrDateString: (dateTime: Temporal.ZonedDateTime) => string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { NamespaceAttribute } from './types';
|
|
2
|
+
|
|
2
3
|
export declare const isAttributeNode: (node: Node) => node is Attr;
|
|
3
4
|
export declare const isNamespaceAttribute: (attr: Attr) => attr is NamespaceAttribute;
|
|
4
5
|
export declare const isNamespaceNode: (node: Node) => node is NamespaceAttribute;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ContextDocument, ContextNode, ContextParentNode } from './types.ts';
|
|
2
|
+
|
|
2
3
|
export declare const getDocument: (node: Node) => Document;
|
|
3
4
|
export declare const getRootNode: (node: ContextNode) => ContextParentNode;
|
|
4
5
|
export declare const TreeWalkerFilter: {
|
|
@@ -13,5 +13,5 @@ type FilterIterable<Guard extends GuardIterated<any, any>> = MapIterable<Unguard
|
|
|
13
13
|
export declare const filter: <Guard extends GuardIterated<any, any>>(guard: Guard) => FilterIterable<Guard>;
|
|
14
14
|
export declare const distinct: <T>(iterable: Iterable<T>) => Generator<T, void, unknown>;
|
|
15
15
|
type TeeResult<T> = [IterableIterator<T>, IterableIterator<T>];
|
|
16
|
-
export declare const tee: <T>(input: Iterable<T> | Iterator<T
|
|
16
|
+
export declare const tee: <T>(input: Iterable<T> | Iterator<T>) => TeeResult<T>;
|
|
17
17
|
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { UpsertableMap } from '../../../../common/src/lib/collections/UpsertableMap.ts';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { TreeSitterXPathParser,
|
|
2
|
+
import { SyntaxLanguageTypeName, SyntaxLanguage as TreeSitterLanguage } from './SyntaxLanguage.ts';
|
|
3
|
+
import { XPathNode } from './SyntaxNode.ts';
|
|
4
|
+
import { SyntaxTree as TreeSitterTree } from './SyntaxTree.ts';
|
|
5
|
+
import { TreeSitterXPathParser, WebAssemblyResourceSpecifiers } from './TreeSitterXPathParser.ts';
|
|
6
|
+
|
|
6
7
|
declare class SyntaxLanguage implements TreeSitterLanguage {
|
|
7
8
|
readonly types: readonly SyntaxLanguageTypeName[];
|
|
8
9
|
constructor(tsLanguage: TreeSitterLanguage);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { AbbreviatedAbsoluteLocationPathType, AbbreviatedAxisTestType, AbbreviatedStepType, AbsoluteLocationPathType, AbsoluteRootLocationPathType, AdditionExprType, AndExprType, AnyBinaryExprType, AnySyntaxType, AnyUnaryExprType, ArgumentType, AxisNameType, AxisTestType, DivisionExprType, EqExprType, ExprType, FilterExprType, FilterPathExprType, FunctionCallType, FunctionNameType, GteExprType, GtExprType, LiteralType, LocalPartType, LteExprType, LtExprType, ModuloExprType, MultiplicationExprType, NeExprType, NodeTestType, NodeTypeTestType, NumberType, OrExprType, ParentType, PredicateType, PrefixedNameType, PrefixedWildcardNameTestType, PrefixType, ProcessingInstructionNameTestType, RelativeLocationPathType, RelativeStepSyntaxLiteral, SelfType, StepType, SubtractionExprType, UnionExprType, UnprefixedNameType, UnprefixedWildcardNameTestType, VariableReferenceType, XPathType } from './type-names.ts';
|
|
2
|
+
|
|
2
3
|
export interface SyntaxNode<Type extends AnySyntaxType, Children extends readonly UnknownSyntaxNode[], Text extends string = string> {
|
|
3
4
|
readonly type: Type;
|
|
4
5
|
readonly childCount: Children['length'];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { SyntaxLanguage } from './SyntaxLanguage.ts';
|
|
2
|
+
import { XPathNode } from './SyntaxNode.ts';
|
|
3
|
+
|
|
3
4
|
export interface SyntaxTree {
|
|
4
5
|
readonly language: SyntaxLanguage;
|
|
5
6
|
readonly rootNode: XPathNode;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { KnownAttributeLocalNamedElement, LocalNamedElement } from '../../../common/types/dom.ts';
|
|
2
|
+
import { ModelElement, XFormsXPathEvaluator } from './XFormsXPathEvaluator.ts';
|
|
3
|
+
|
|
3
4
|
export interface ItextRootElement extends LocalNamedElement<'itext'> {
|
|
4
5
|
}
|
|
5
6
|
export declare const getItextRoot: (modelElement: ModelElement) => ItextRootElement | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import type { AnyParentNode } from '../lib/dom/types.ts';
|
|
1
|
+
import { EvaluatorOptions, Evaluator } from '../evaluator/Evaluator.ts';
|
|
2
|
+
import { AnyParentNode } from '../lib/dom/types.ts';
|
|
4
3
|
import { XFormsItextTranslations } from './XFormsItextTranslations.ts';
|
|
4
|
+
|
|
5
5
|
export interface ModelElement extends Element {
|
|
6
6
|
readonly localName: 'model';
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getodk/xpath",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "XPath implementation for ODK Web Forms",
|
|
6
6
|
"type": "module",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"README.md"
|
|
32
32
|
],
|
|
33
33
|
"engines": {
|
|
34
|
-
"node": "^18.
|
|
34
|
+
"node": "^18.20.3 || ^20.13.1 || ^22.2.0",
|
|
35
35
|
"yarn": "1.22.19"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
@@ -53,24 +53,23 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@js-temporal/polyfill": "^0.4.4",
|
|
56
|
-
"@getodk/common": "0.1.
|
|
57
|
-
"crypto-js": "^4.
|
|
56
|
+
"@getodk/common": "0.1.1",
|
|
57
|
+
"crypto-js": "^4.2.0",
|
|
58
58
|
"itertools-ts": "^1.23.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@babel/core": "^7.24.
|
|
62
|
-
"@getodk/tree-sitter-xpath": "0.1.
|
|
63
|
-
"@playwright/test": "^1.
|
|
64
|
-
"@types/crypto-js": "^4.
|
|
65
|
-
"@vitest/browser": "^1.
|
|
61
|
+
"@babel/core": "^7.24.6",
|
|
62
|
+
"@getodk/tree-sitter-xpath": "0.1.1",
|
|
63
|
+
"@playwright/test": "^1.44.1",
|
|
64
|
+
"@types/crypto-js": "^4.2.2",
|
|
65
|
+
"@vitest/browser": "^1.6.0",
|
|
66
66
|
"babel-plugin-transform-jsbi-to-bigint": "^1.4.0",
|
|
67
67
|
"jsdom": "^24.0.0",
|
|
68
|
-
"vite": "^5.
|
|
68
|
+
"vite": "^5.2.11",
|
|
69
69
|
"vite-plugin-babel": "^1.2.0",
|
|
70
|
-
"vite-plugin-dts": "^3.
|
|
71
|
-
"vite-plugin-no-bundle": "^
|
|
72
|
-
"vitest": "^1.
|
|
73
|
-
"
|
|
74
|
-
"web-tree-sitter": "0.21.0"
|
|
70
|
+
"vite-plugin-dts": "^3.9.1",
|
|
71
|
+
"vite-plugin-no-bundle": "^4.0.0",
|
|
72
|
+
"vitest": "^1.6.0",
|
|
73
|
+
"web-tree-sitter": "0.22.6"
|
|
75
74
|
}
|
|
76
75
|
}
|