Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
adds comparison helpers.

closes #1
  • Loading branch information
jonschlinkert committed Nov 25, 2018
1 parent fb0fc85 commit 3157933
Show file tree
Hide file tree
Showing 30 changed files with 1,373 additions and 1,018 deletions.
16 changes: 12 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"ecmaFeatures": {
"modules": true,
"experimentalObjectRestSpread": true
},
"extends": [
"eslint:recommended"
],

"env": {
"browser": false,
Expand All @@ -11,6 +10,15 @@
"mocha": true
},

"parserOptions":{
"ecmaVersion": 9,
"sourceType": "module",
"ecmaFeatures": {
"modules": true,
"experimentalObjectRestSpread": true
}
},

"globals": {
"document": false,
"navigator": false,
Expand Down
20 changes: 10 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
sudo: false
os:
- linux
- osx
- windows
language: node_js
node_js:
- 'node'
- '11'
- '10'
- '9'
- '8'
- '7'
- '6'
- '5'
- '4'
- '0.12'
- '0.10'
matrix:
fast_finish: true
allow_failures:
- node_js: '4'
- node_js: '0.10'
- node_js: '0.12'
46 changes: 22 additions & 24 deletions .verb.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,41 @@
In addition to the [related projects](#related-projects) listed below, also take a look at the [helpers org](https://github.com/helpers), there are 60+ specialized helpers that can be used individually.

## Usage

To get all helpers:

```js
var helpers = require('{%= name %}')();
const helpers = require('{%= name %}')();
console.log(helpers);
```

**Get a specific helper category**

```js
// get only the math helpers
var helpers = require('{%= name %}')('math');
const helpers = require('{%= name %}')('math');
```

**Get multiple helper categories**

```js
// get only the math helpers
var helpers = require('{%= name %}')(['math', 'string']);
const helpers = require('{%= name %}')(['math', 'string']);
```

### Use with any template engine
### Template-engine agnostic

**Lo-Dash Example**

```js
var helpers = require('{%= name %}')('array');
const helpers = require('{%= name %}')('array');

// pass helpers on `imports`
var imports = {imports: helpers};
const imports = { imports: helpers };

// compile a template
var fn = _.template('<%= first(foo) %>', imports);
const fn = _.template('<%= first(foo) %>', imports);

// render
fn({foo: ['a', 'b', 'c']});
fn({ foo: ['a', 'b', 'c'] });
//=> 'a'
```

Expand All @@ -53,57 +51,57 @@ Handlebars and Lo-Dash both allow **dot notation** to be used for referencing he

This can be used as a way of working around potential naming conflicts.

## API
## Helpers

_(The following **API Table of Contents** is generated by [verb][]. See the [verbfile.js](verbfile.js) for more details.)_

{%= include("toc.md") %}
{%= include("docs/toc.md") %}

### array

{%= increaseHeadings(apidocs("lib/array.js")) %}
{%= increaseHeadings(apidocs("lib/helpers/array.js")) %}

### code

{%= increaseHeadings(apidocs("lib/code.js")) %}
{%= increaseHeadings(apidocs("lib/helpers/code.js")) %}

### collection

{%= increaseHeadings(apidocs("lib/collection.js")) %}
{%= increaseHeadings(apidocs("lib/helpers/collection.js")) %}

### conditional

{%= increaseHeadings(apidocs("lib/conditional.js")) %}
{%= increaseHeadings(apidocs("lib/helpers/conditional.js")) %}

### fs

{%= increaseHeadings(apidocs("lib/fs.js")) %}
{%= increaseHeadings(apidocs("lib/helpers/fs.js")) %}

### html

{%= increaseHeadings(apidocs("lib/html.js")) %}
{%= increaseHeadings(apidocs("lib/helpers/html.js")) %}

### index

{%= increaseHeadings(apidocs("lib/index.js")) %}
{%= increaseHeadings(apidocs("lib/helpers/index.js")) %}

### math

{%= increaseHeadings(apidocs("lib/math.js")) %}
{%= increaseHeadings(apidocs("lib/helpers/math.js")) %}

### object

{%= increaseHeadings(apidocs("lib/object.js")) %}
{%= increaseHeadings(apidocs("lib/helpers/object.js")) %}

### path

{%= increaseHeadings(apidocs("lib/path.js")) %}
{%= increaseHeadings(apidocs("lib/helpers/path.js")) %}

### string

{%= increaseHeadings(apidocs("lib/string.js")) %}
{%= increaseHeadings(apidocs("lib/helpers/string.js")) %}

### Code coverage
## Coverage

```
{%= coverage("coverage/summary.txt") %}
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015-2016, Jon Schlinkert.
Copyright (c) 2015-present, Jon Schlinkert.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading

0 comments on commit 3157933

Please sign in to comment.