Skip to content

NonEmpty<Type> exported in cedar-wasm should describe non-empty arrays #2155

@victornicolet

Description

@victornicolet

Describe the improvement you'd like to request

The type nonempty::NonEmpty used for non-empty vecs in the Rust implementation is exported in cedar-wasm by a script build-wasm.sh#L93:

    echo "export type NonEmpty<Type> = Array<Type>;" >> "$types_file"

@Swolebrain suggested this could be improved to actually represent non-empty arrays:

export type NonEmpty<Type> = [Type, ...Array<Type>];

However, this would be a backwards incompatible change.

Describe alternatives you've considered

No response

Additional context

No response

Is this something that you'd be interested in working on?

  • 👋 I may be able to implement this internal improvement
  • ⚠️ This feature might incur a breaking change

Metadata

Metadata

Assignees

No one assigned

    Labels

    breaking-changeThis is (likely) a breaking changefeature-requestThis issue requets a substantial new featureinternal-improvementRefactoring, minor performance improvement, or other changes that Cedar users may never notice

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions