Skip to content

Commit

Permalink
- updated README, tasks, travis.yml, doc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ascartabelli committed Feb 12, 2019
1 parent 3fb8538 commit 07e2fdb
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 26 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ script:
- gulp travis
node_js:
- "stable"
- "10"
- "9"
- "8"
- "7"
Expand Down
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,17 @@ Require it in node.js:
var _ = require("lamb");
```

It's useful to alias it to have a shorter symbol, like `_`, as I did above and throughout the documentation: it's cleaner and the
`lamb` object itself can be used as a placeholder argument in [partial application](https://ascartabelli.github.io/lamb/module-lamb.html#partial).
Since version 0.57.0, Lamb is splitted in ES modules and can take advantage of tree-shaking capabilities of module bundlers:

```javascript
import * as _ from "lamb";
```

You can also import only the functions you want to use:

```javascript
import { compose, map } from "lamb";
```

In a browser, simply include the version you want from the `dist` folder:

Expand Down
8 changes: 3 additions & 5 deletions dist/lamb.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @overview lamb - A lightweight, and docile, JavaScript library to help embracing functional programming.
* @author Andrea Scartabelli <andrea.scartabelli@gmail.com>
* @version 0.57.0-rc.1
* @version 0.57.0-rc.2
* @module lamb
* @license MIT
* @preserve
Expand All @@ -13,7 +13,7 @@
}(this, function (exports) { 'use strict';

/**
* The placeholder object.
* The placeholder object used in partial application.
* @memberof module:lamb
* @alias module:lamb.__
* @category Special properties
Expand Down Expand Up @@ -143,7 +143,7 @@

/**
* Builds a partially applied function.<br/>
* The @link module:lamb.__|__} object can be used as a placeholder for arguments.<br/>
* The {@link module:lamb.__|__} object can be used as a placeholder for arguments.<br/>
* @example
* var __ = _.__;
* var users = [
Expand Down Expand Up @@ -6719,8 +6719,6 @@
};
}

// CORE

exports.__ = __;
exports.always = always;
exports.areSVZ = areSVZ;
Expand Down
2 changes: 1 addition & 1 deletion dist/lamb.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/lamb.min.js.map

Large diffs are not rendered by default.

17 changes: 14 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ var intro = [
"*/"
].join("\n");

/* env */

gulp.task("set-test-env", cb => {
process.env.NODE_ENV = "test";

return cb();
});

/* build */

gulp.task("build", function () {
Expand Down Expand Up @@ -77,9 +85,12 @@ gulp.task("lint", gulp.series("lint:code", "lint:tests"));
/* test */

function testWith (extraSettings) {
return function () {
return gulp.src("./src").pipe(jest(Object.assign({}, jestBaseConfig, extraSettings)));
};
return gulp.series(
"set-test-env",
function () {
return gulp.src("./src").pipe(jest(Object.assign({}, jestBaseConfig, extraSettings)));
}
);
}

gulp.task("test", testWith({}));
Expand Down
22 changes: 12 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"name": "Andrea Scartabelli"
},
"description": "A lightweight, and docile, JavaScript library to help embracing functional programming.",
"engines": {
"node": ">=4.0.0"
},
"files": [
"dist/lamb.js",
"dist/lamb.min.js",
Expand All @@ -24,26 +27,25 @@
"javascript"
],
"license": "MIT",
"main": "./dist/lamb.js",
"module": "./src/index.js",
"main": "dist/lamb.js",
"module": "src/index.js",
"name": "lamb",
"repository": {
"type": "git",
"url": "https://github.com/ascartabelli/lamb.git"
},
"babel": {
"presets": [["@babel/preset-env", { "targets": { "node": "current" } }]]
},
"engines": {
"node": ">=4.0.0"
},
"sideEffects": false,
"scripts": {
"test": "gulp test",
"coveralls": "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage"
},
"babel": {
"env": { "test": { "presets": [["@babel/preset-env", { "targets": { "node": "current" } }]] } }
},
"jsdelivr": "dist/lamb.min.js",
"unpkg": "dist/lamb.min.js",
"sideEffects": false,
"tonicExample": "var _ = require('lamb');",
"version": "0.57.0-rc.1",
"version": "0.57.0-rc.2",
"devDependencies": {
"@babel/preset-env": "^7.3.1",
"coveralls": "^3.0.2",
Expand Down
2 changes: 1 addition & 1 deletion src/core/__.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* The placeholder object.
* The placeholder object used in partial application.
* @memberof module:lamb
* @alias module:lamb.__
* @category Special properties
Expand Down
2 changes: 1 addition & 1 deletion src/core/partial.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import __ from "./__";

/**
* Builds a partially applied function.<br/>
* The @link module:lamb.__|__} object can be used as a placeholder for arguments.<br/>
* The {@link module:lamb.__|__} object can be used as a placeholder for arguments.<br/>
* @example
* var __ = _.__;
* var users = [
Expand Down
2 changes: 0 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// CORE

export { default as __ } from "./core/__";
export { default as always } from "./core/always";
export { default as areSVZ } from "./core/areSVZ";
Expand Down

0 comments on commit 07e2fdb

Please sign in to comment.