Skip to content
This repository was archived by the owner on Mar 19, 2026. It is now read-only.
This repository was archived by the owner on Mar 19, 2026. It is now read-only.

Add asEnumerable() extension to Array and String prototype #32

Description

@patroza
// TODO: Set with Object define property, and set 'enumerable: false'
String.prototype.asEnumerable = function () {
  return mx(this);
};

Array.prototype.asEnumerable = function () {
  return mx(this);
};

Typescript definition:

interface String {
	asEnumerable(): mx.Enumerable<String>;
}

interface Array<T> {
	asEnumerable(): mx.Enumerable<T>;
}

The definition can only extend the built-in types if the definition is global, not a module. But in the current situation, that is the case.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions