Skip to content

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

@patroza

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions