All collections inherit from XIterable. It returns an iterator and offers the classic Array methods of iteration, also filter, map/reduce, etc. with the same signature.
In addition some methods are added (some of them inspired from groovy) to make chaining more easier (such as
Last but not least the collections have full
Promises support, and allow processing of their content using the
API. For example, assuming that our collection contains promises, we can:
// make them promises;
Furthermore since the collections are written in TypeScript, the module embeds the .d.ts file, so you get full autocomplete and documentation support from the IDE (pictured Visual Studio Code)
formatis a very simple string formatting method that uses positional parameters in the spirit of .NET:
var format = format;var text = ;console; // will output 'Hello World!'
reflect, as its name implies, offers some utility methods that allow reflection operations on objects and functions.
Here is a sample of reflect displaying its own API:
var reflect =format = format;// reflect displaying its own APIreflect;
This will output:
function functionName(f);function functions(obj);function argumentNames(f);function create(clazz, args);function invoke(f, args);
- v1.1.1 2015-09-15 Collections have the types correctly exported, and the Promise is the ES6 implementation.
- v1.1.0 2015-09-10 Exported the reflect methods, and string format.
- v1.0.1 2015-09-05 Added a bunch of mocha tests. (unit test)
- v1.0.0 2015-08-31 Initial release.