Skip to content

Commit

Permalink
Merge pull request #60 from UCNot/multi-map
Browse files Browse the repository at this point in the history
Multi-map
  • Loading branch information
surol authored Jul 16, 2023
2 parents a5587a5 + 239c52a commit d91beb3
Show file tree
Hide file tree
Showing 8 changed files with 413 additions and 109 deletions.
5 changes: 4 additions & 1 deletion src/compiler/common/ucc-list-options.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import { UcList } from '../../schema/list/uc-list.js';
import { UcMultiValue } from '../../schema/list/uc-multi-value.js';

export interface UccListOptions {
readonly single: 'accept' | 'as-is' | 'prefer' | 'reject';
readonly single: Exclude<(UcList.Variant | UcMultiValue.Variant)['single'], undefined>;
}
6 changes: 5 additions & 1 deletion src/compiler/deserialization/list.ucrx.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ export class ListUcrxClass<

super({
schema,
typeName: 'List' + ucSchemaVariant(schema) + 'Of' + itemClass.typeName,
typeName:
(single === 'reject' || single === 'accept' ? 'List' : 'MultiValue')
+ ucSchemaVariant(schema)
+ 'Of'
+ itemClass.typeName,
baseClass: isMatrix ? lib.baseUcrx : itemClass,
classConstructor: {
args: UcrxSignature,
Expand Down
Loading

0 comments on commit d91beb3

Please sign in to comment.