ufsc

1.0.0 • Public • Published

UFSC.js

DLang's Uniform Function Call Syntax (UFSC) port to JavaScript

It's mutates the Object.prototype, be careful when you are using it.

Install

npm install ufsc

Overview

UFSC is an useful syntax in functional approach.

Easy to use

Just give the function as parameter and it will handle rest.

var uniform = require('ufsc');
 
uniform(add);
function add(x, y) {
  return x + y;
}
 
var result = add(2, 3); //=> 5
var result = (2).add(3); //=> 5

Chaining

Since it mutates Object.prototype you can use it with every type. So, you can chain the function.

var result = add(2, 3).add(4).add(5); //=> 2 + 3 + 4 + 5 = 14

License

MIT.

Package Sidebar

Install

npm i ufsc

Weekly Downloads

5

Version

1.0.0

License

MIT

Last publish

Collaborators

  • fkadev