Skip to content

Commit

Permalink
Map cds.Vector to string (cap-js#189)
Browse files Browse the repository at this point in the history
* Map Vector to string

* Add changelog entry
  • Loading branch information
daogrady authored Mar 28, 2024
1 parent 19d1c66 commit 0c21ab4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
The format is based on [Keep a Changelog](http://keepachangelog.com/).

## Version 0.19.0 - TBD
### Added
- Support for `cds.Vector`, which will be represented as `string`

## Version 0.18.2 - 2024-03-21
### Fix
Expand Down
1 change: 1 addition & 0 deletions lib/components/resolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const Builtins = {
Binary: 'string',
LargeString: 'string',
LargeBinary: 'Buffer | string | {value: import("stream").Readable, $mediaContentType: string, $mediaContentDispositionFilename?: string, $mediaContentDispositionType?: string}',
Vector: 'string',
Integer: 'number',
UInt8: 'number',
Int16: 'number',
Expand Down
1 change: 1 addition & 0 deletions test/unit/files/builtins/model.cds
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ entity E {
uuid: UUID;
str: String;
bin: Binary;
// vec: Vector(123);
lstr: LargeString;
lbin: LargeBinary;
integ: Integer;
Expand Down
1 change: 1 addition & 0 deletions test/unit/output.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ describe('Compilation', () => {
expect(astw.exists('_EAspect', 'uuid', m => check.isNullable(m.type, [check.isString]))).toBeTruthy()
expect(astw.exists('_EAspect', 'str', m => check.isNullable(m.type, [check.isString]))).toBeTruthy()
expect(astw.exists('_EAspect', 'bin', m => check.isNullable(m.type, [check.isString]))).toBeTruthy()
// expect(astw.exists('_EAspect', 'vec', m => check.isNullable(m.type, [check.isString]))).toBeTruthy()
expect(astw.exists('_EAspect', 'lstr', m => check.isNullable(m.type, [check.isString]))).toBeTruthy()
expect(astw.exists('_EAspect', 'lbin', m => check.isUnionType(m.type, [
st => st.full === 'Buffer',
Expand Down

0 comments on commit 0c21ab4

Please sign in to comment.