@cap-js/db-service 1.17.1 → 1.17.2

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/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@
4
4
  - The format is based on [Keep a Changelog](http://keepachangelog.com/).
5
5
  - This project adheres to [Semantic Versioning](http://semver.org/).
6
6
 
7
+ ## [1.17.2](https://github.com/cap-js/cds-dbs/compare/db-service-v1.17.1...db-service-v1.17.2) (2025-02-09)
8
+
9
+
10
+ ### Fixed
11
+
12
+ * replace polynomial regex with simple string op ([#1015](https://github.com/cap-js/cds-dbs/issues/1015)) ([3fe6e6b](https://github.com/cap-js/cds-dbs/commit/3fe6e6b7f7aaf5aafb811acf2838cd1da30052a8))
13
+
7
14
  ## [1.17.1](https://github.com/cap-js/cds-dbs/compare/db-service-v1.17.0...db-service-v1.17.1) (2025-02-04)
8
15
 
9
16
 
@@ -116,9 +116,11 @@ function infer(originalQuery, model) {
116
116
 
117
117
  inferArg(from, null, null, { inFrom: true })
118
118
  const alias =
119
- from.uniqueSubqueryAlias ||
120
- from.as ||
121
- (ref.length === 1 ? first.match(/[^.]+$/)[0] : ref[ref.length - 1].id || ref[ref.length - 1])
119
+ from.uniqueSubqueryAlias ||
120
+ from.as ||
121
+ (ref.length === 1
122
+ ? first.substring(first.lastIndexOf('.') + 1)
123
+ : (ref.at(-1).id || ref.at(-1)));
122
124
  if (alias in querySources) throw new Error(`Duplicate alias "${alias}"`)
123
125
  querySources[alias] = { definition: target, args }
124
126
  const last = from.$refLinks.at(-1)
@@ -134,7 +136,7 @@ function infer(originalQuery, model) {
134
136
  } else if (typeof from === 'string') {
135
137
  // TODO: Create unique alias, what about duplicates?
136
138
  const definition = getDefinition(from) || cds.error`"${from}" not found in the definitions of your model`
137
- querySources[/([^.]*)$/.exec(from)[0]] = { definition }
139
+ querySources[from.substring(from.lastIndexOf('.') + 1)] = { definition }
138
140
  } else if (from.SET) {
139
141
  infer(from, model)
140
142
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cap-js/db-service",
3
- "version": "1.17.1",
3
+ "version": "1.17.2",
4
4
  "description": "CDS base database service",
5
5
  "homepage": "https://github.com/cap-js/cds-dbs/tree/main/db-service#cds-base-database-service",
6
6
  "repository": {