Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
patroza opened this issue Jun 25, 2017 · 0 comments
Open

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

patroza opened this issue Jun 25, 2017 · 0 comments
Assignees

Comments

@patroza
Copy link

patroza commented Jun 25, 2017

// 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.

@knazeri knazeri self-assigned this Jul 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants