ochre-sdk 0.22.18 → 0.22.19
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/index.d.mts +1 -0
- package/dist/index.mjs +13 -24
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1292,7 +1292,7 @@ function parseObservation(observation) {
|
|
|
1292
1292
|
* @returns Array of parsed Observation objects
|
|
1293
1293
|
*/
|
|
1294
1294
|
function parseObservations(observations) {
|
|
1295
|
-
return observations.map((
|
|
1295
|
+
return observations.map((observation) => parseObservation(observation));
|
|
1296
1296
|
}
|
|
1297
1297
|
/**
|
|
1298
1298
|
* Parses an array of raw events into standardized Event objects
|
|
@@ -1435,12 +1435,13 @@ function parseProperties(properties, language = "eng") {
|
|
|
1435
1435
|
* @returns Array of parsed Interpretation objects
|
|
1436
1436
|
*/
|
|
1437
1437
|
function parseInterpretations(interpretations) {
|
|
1438
|
-
return interpretations.map((
|
|
1439
|
-
date:
|
|
1440
|
-
number:
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1438
|
+
return interpretations.map((interpretation) => ({
|
|
1439
|
+
date: interpretation.date ?? null,
|
|
1440
|
+
number: interpretation.interpretationNo,
|
|
1441
|
+
notes: interpretation.notes ? parseNotes(ensureArray(interpretation.notes.note)) : [],
|
|
1442
|
+
links: interpretation.links ? parseLinks(ensureArray(interpretation.links)) : [],
|
|
1443
|
+
properties: interpretation.properties ? parseProperties(ensureArray(interpretation.properties.property)) : [],
|
|
1444
|
+
bibliographies: interpretation.bibliographies ? parseBibliographies(ensureArray(interpretation.bibliographies.bibliography)) : []
|
|
1444
1445
|
}));
|
|
1445
1446
|
}
|
|
1446
1447
|
/**
|
|
@@ -2275,13 +2276,8 @@ function buildRichTextPhraseQueryExpression(params) {
|
|
|
2275
2276
|
const { value, isCaseSensitive } = params;
|
|
2276
2277
|
return `cts:word-query(${stringLiteral(value)}, ${buildRichTextPhraseOptionsExpression({ isCaseSensitive })})`;
|
|
2277
2278
|
}
|
|
2278
|
-
function buildCtsNearQueryExpression(params) {
|
|
2279
|
-
const { queryExpressions, distance, isOrdered = false } = params;
|
|
2280
|
-
const options = isOrdered ? `, (${stringLiteral("ordered")})` : "";
|
|
2281
|
-
return `cts:near-query((${queryExpressions.join(", ")}), ${distance}${options})`;
|
|
2282
|
-
}
|
|
2283
2279
|
function buildRichTextExactQueryExpression(params) {
|
|
2284
|
-
const { value, isCaseSensitive
|
|
2280
|
+
const { value, isCaseSensitive } = params;
|
|
2285
2281
|
const phraseQuery = buildRichTextPhraseQueryExpression({
|
|
2286
2282
|
value,
|
|
2287
2283
|
isCaseSensitive
|
|
@@ -2291,17 +2287,10 @@ function buildRichTextExactQueryExpression(params) {
|
|
|
2291
2287
|
isCaseSensitive
|
|
2292
2288
|
});
|
|
2293
2289
|
if (terms.length <= 1) return phraseQuery;
|
|
2294
|
-
return buildOrCtsQueryExpressionInternal([phraseQuery,
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
isCaseSensitive,
|
|
2299
|
-
queryFamily: "text",
|
|
2300
|
-
language
|
|
2301
|
-
})),
|
|
2302
|
-
distance: 2,
|
|
2303
|
-
isOrdered: true
|
|
2304
|
-
})]);
|
|
2290
|
+
return buildOrCtsQueryExpressionInternal([phraseQuery, buildAndCtsQueryExpressionInternal(terms.map((term) => buildRichTextPhraseQueryExpression({
|
|
2291
|
+
value: term,
|
|
2292
|
+
isCaseSensitive
|
|
2293
|
+
})))]);
|
|
2305
2294
|
}
|
|
2306
2295
|
function buildCtsElementWordQueryExpression(params) {
|
|
2307
2296
|
const { elementName, value, matchMode, isCaseSensitive, queryFamily, language } = params;
|