@steedos/odata-v4-parser 2.5.3-beta.2 → 2.5.3-beta.21

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/src/odataUri.ts CHANGED
@@ -1,37 +1,37 @@
1
- /*
2
- * @Author: baozhoutao@steedos.com
3
- * @Date: 2022-07-10 15:44:34
4
- * @LastEditors: baozhoutao@steedos.com
5
- * @LastEditTime: 2022-07-10 17:03:14
6
- * @Description:
7
- */
8
- import Utils from "./utils";
9
- import Lexer from "./lexer";
10
- import Query from "./query";
11
- import ResourcePath from "./resourcePath";
12
-
13
- export namespace ODataUri {
14
- export function odataUri(value: Utils.SourceArray, index: number, metadataContext?: any): Lexer.Token {
15
- let resource = ResourcePath.resourcePath(value, index, metadataContext);
16
- while (!resource && index < value.length) {
17
- while (value[++index] !== 0x2f && index < value.length);
18
- resource = ResourcePath.resourcePath(value, index, metadataContext);
19
- }
20
- if (!resource) return;
21
- let start = index;
22
- index = resource.next;
23
- metadataContext = resource.metadata;
24
-
25
- let query;
26
- if (value[index] === 0x3f) {
27
- query = Query.queryOptions(value, index + 1, metadataContext);
28
- if (!query) return;
29
- index = query.next;
30
- delete resource.metadata;
31
- }
32
-
33
- return Lexer.tokenize(value, start, index, { resource, query }, Lexer.TokenType.ODataUri, <any>{ metadata: metadataContext });
34
- }
35
- }
36
-
37
- export default ODataUri;
1
+ /*
2
+ * @Author: baozhoutao@steedos.com
3
+ * @Date: 2022-07-10 15:44:34
4
+ * @LastEditors: baozhoutao@steedos.com
5
+ * @LastEditTime: 2022-07-10 17:03:14
6
+ * @Description:
7
+ */
8
+ import Utils from "./utils";
9
+ import Lexer from "./lexer";
10
+ import Query from "./query";
11
+ import ResourcePath from "./resourcePath";
12
+
13
+ export namespace ODataUri {
14
+ export function odataUri(value: Utils.SourceArray, index: number, metadataContext?: any): Lexer.Token {
15
+ let resource = ResourcePath.resourcePath(value, index, metadataContext);
16
+ while (!resource && index < value.length) {
17
+ while (value[++index] !== 0x2f && index < value.length);
18
+ resource = ResourcePath.resourcePath(value, index, metadataContext);
19
+ }
20
+ if (!resource) return;
21
+ let start = index;
22
+ index = resource.next;
23
+ metadataContext = resource.metadata;
24
+
25
+ let query;
26
+ if (value[index] === 0x3f) {
27
+ query = Query.queryOptions(value, index + 1, metadataContext);
28
+ if (!query) return;
29
+ index = query.next;
30
+ delete resource.metadata;
31
+ }
32
+
33
+ return Lexer.tokenize(value, start, index, { resource, query }, Lexer.TokenType.ODataUri, <any>{ metadata: metadataContext });
34
+ }
35
+ }
36
+
37
+ export default ODataUri;