forked from canada-ca/tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindexes.js
More file actions
41 lines (41 loc) · 1.06 KB
/
Copy pathindexes.js
File metadata and controls
41 lines (41 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
"use strict";
/**
* ```ts
* import type {
* FulltextIndex,
* GeoIndex,
* HashIndex,
* PersistentIndex,
* PrimaryIndex,
* SkiplistIndex,
* TtlIndex,
* } from "arangojs/indexes";
* ```
*
* The "indexes" module provides index-related types for TypeScript.
*
* @packageDocumentation
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports._indexHandle = void 0;
/**
* @internal
* @hidden
*/
function _indexHandle(selector, collectionName) {
if (typeof selector !== "string") {
if (selector.id) {
return _indexHandle(selector.id, collectionName);
}
throw new Error("Index handle must be a string or an object with an id attribute");
}
if (selector.includes("/")) {
if (!selector.startsWith(`${collectionName}/`)) {
throw new Error(`Index ID "${selector}" does not match collection name "${collectionName}"`);
}
return selector;
}
return `${collectionName}/${selector}`;
}
exports._indexHandle = _indexHandle;
//# sourceMappingURL=indexes.js.map