8000 Support Typed Arrays · Issue #76 · google/intermock · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Support Typed Arrays #76
Open
Open
@abarke

Description

@abarke
Error: Type 'Int8Array' is not specified in the provided files but is required for property: 'arr'. Please include it.

Would be awesome if intermock would support Typed Arrays and generate values within each range e.g.

Array<T>
ReadonlyArray<T>
Int8Array
Uint8Array
Uint8ClampedArray
Int16Array
Uint16Array
Int32Array
Uint32Array
Float32Array
Float64Array (represented as string for JSON compatibility)
BigInt64Array (represented as string for JSON compatibility)
BigUint64Array (represented as string for JSON compatibility)

e.g.

interface Data {
  str: string
  arr: Int8Array;
}

const arr = [...new Int8Array([127, 0, 0, 1])]

Output

{
  "Data": {
    "str": "voluptatum minima voluptates",
    "arr": [
      127,
      0,
      0,
      1,
    ]
  }
}

Ref: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/node/globals.d.ts#L94-L106

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0