@sap/cds 7.8.1 → 7.8.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 +7 -0
- package/lib/linked/classes.js +2 -2
- package/libx/common/assert/index.js +1 -0
- package/package.json +1 -1
- package/server.js +1 -1
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
|
+
## Version 7.8.2 - 2024-04-22
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- `.find` and `.filter` in `linked.entities()` now returns values instead of names
|
|
12
|
+
- `cds.app.serve.from(pkg,folder)` did not consider `pkg` for serving static resources
|
|
13
|
+
|
|
7
14
|
## Version 7.8.1 - 2024-04-11
|
|
8
15
|
|
|
9
16
|
### Fixed
|
package/lib/linked/classes.js
CHANGED
|
@@ -166,10 +166,10 @@ class event extends aspect {}
|
|
|
166
166
|
class LinkedDefinitions {
|
|
167
167
|
*[Symbol.iterator](){ for (let e in this) yield this[e] }
|
|
168
168
|
forEach(f){ let i=0; for (let k in this) f(this[k],i++,this) }
|
|
169
|
-
filter(f){ let i=0, r=[]; for (let k in this) f(this[k],i++,this) && r.push(k); return r }
|
|
169
|
+
filter(f){ let i=0, r=[]; for (let k in this) f(this[k],i++,this) && r.push(this[k]); return r }
|
|
170
170
|
map(f){ let i=0, r=[]; for (let k in this) r.push(f(this[k],i++,this)); return r }
|
|
171
171
|
some(f){ for (let k in this) if (f(this[k])) return true }
|
|
172
|
-
find(f){ for (let k in this) if (f(this[k])) return k }
|
|
172
|
+
find(f){ for (let k in this) if (f(this[k])) return this[k] }
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
|
|
@@ -57,6 +57,7 @@ function _process(obj, def, errs, opts) {
|
|
|
57
57
|
|
|
58
58
|
for (let [k, v] of Object.entries(obj)) {
|
|
59
59
|
let ele = def.elements?.[k] || def.params?.[k] || def.items
|
|
60
|
+
if (typeof ele !== 'object') ele = undefined //> ignore non-object elements, e.g., functions of prototypes
|
|
60
61
|
|
|
61
62
|
/*
|
|
62
63
|
* TODO: should we support this? with or without transformation?
|
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -89,7 +89,7 @@ const defaults = {
|
|
|
89
89
|
* @example app.serve('/bookshop').from('@capire/bookshop','app/vue')
|
|
90
90
|
*/
|
|
91
91
|
express.application.serve = function (endpoint) { return { from: (pkg,folder) => {
|
|
92
|
-
folder = !folder ? pkg : cds.utils.path.resolve (require.resolve(pkg+'/package.json',{paths:[cds.root]}),'
|
|
92
|
+
folder = !folder ? pkg : cds.utils.path.resolve (require.resolve(pkg+'/package.json',{paths:[cds.root]}),'../'+folder)
|
|
93
93
|
this.use (endpoint, express.static(folder))
|
|
94
94
|
if (!endpoint.endsWith('/webapp')) (this._app_links ??= []) .push (endpoint)
|
|
95
95
|
}}}
|