Skip to content

Commit

Permalink
run update
Browse files Browse the repository at this point in the history
  • Loading branch information
jonschlinkert committed Mar 10, 2016
1 parent 8a90e3c commit f75ddb2
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 61 deletions.
22 changes: 13 additions & 9 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
; EditorConfig is awesome: http://EditorConfig.org

; top-most EditorConfig file
# http://editorconfig.org
root = true

; base rules
[*]
indent_style = space
indent_size = 2
charset = utf-8
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true

; Dont remove trailing whitespace from markdown
; files since it messes up newlines
[*.md]
trim_trailing_whitespace = false
insert_final_newline = false

[test/**]
trim_trailing_whitespace = false
insert_final_newline = false

[templates/**]
trim_trailing_whitespace = false
insert_final_newline = false
7 changes: 2 additions & 5 deletions .eslintrc → .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"handle-callback-err": [2, "^(err|error)$" ],
"indent": [2, 2, { "SwitchCase": 1 }],
"key-spacing": [2, { "beforeColon": false, "afterColon": true }],
"keyword-spacing": [2, { "before": true, "after": true }],
"new-cap": [2, { "newIsCap": true, "capIsNew": false }],
"new-parens": 2,
"no-array-constructor": 2,
Expand All @@ -49,7 +50,6 @@
"no-dupe-keys": 2,
"no-duplicate-case": 2,
"no-empty-character-class": 2,
"no-empty-label": 2,
"no-eval": 2,
"no-ex-assign": 2,
"no-extend-native": 2,
Expand All @@ -71,7 +71,7 @@
"no-multi-spaces": 2,
"no-multi-str": 2,
"no-multiple-empty-lines": [2, { "max": 1 }],
"no-native-reassign": 2,
"no-native-reassign": 0,
"no-negated-in-lhs": 2,
"no-new": 2,
"no-new-func": 2,
Expand Down Expand Up @@ -108,13 +108,10 @@
"radix": 2,
"semi": [2, "always"],
"semi-spacing": [2, { "before": false, "after": true }],
"space-after-keywords": [2, "always"],
"space-before-blocks": [2, "always"],
"space-before-function-paren": [2, "never"],
"space-before-keywords": [2, "always"],
"space-in-parens": [2, "never"],
"space-infix-ops": 2,
"space-return-throw-case": 2,
"space-unary-ops": [2, { "words": true, "nonwords": false }],
"spaced-comment": [0, "always", { "markers": ["global", "globals", "eslint", "eslint-disable", "*package", "!", ","] }],
"use-isnan": 2,
Expand Down
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
sudo: false
language: node_js
node_js:
- "stable"
- "5"
- "4"
- "0.12"
- "0.10"
matrix:
Expand Down
27 changes: 0 additions & 27 deletions .verb.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# {%= name %} {%= badge("fury") %}

> {%= description %}
## Install
{%= include("install") %}

## Usage

```js
Expand All @@ -19,23 +12,3 @@ last(['a', 'b', 'c', 'd', 'e', 'f'], 1);
last(['a', 'b', 'c', 'd', 'e', 'f'], 3);
//=> ['d', 'e', 'f']
```

## Related projects
{%= related(verb.related.list) %}

## Running tests
{%= include("tests") %}

## Contributing
{%= include("contributing") %}

## Author
{%= include("author") %}

## License
{%= copyright() %}
{%= license() %}

***

{%= include("footer") %}
40 changes: 28 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# array-last [![NPM version](https://badge.fury.io/js/array-last.svg)](http://badge.fury.io/js/array-last)
# array-last [![NPM version](https://img.shields.io/npm/v/array-last.svg)](https://www.npmjs.com/package/array-last) [![Build Status](https://img.shields.io/travis/jonschlinkert/array-last.svg)](https://travis-ci.org/jonschlinkert/array-last)

> Get the last or last n elements in an array.
## Install

Install with [npm](https://www.npmjs.com/):

```sh
$ npm i array-last --save-dev
$ npm install array-last --save
```

## Usage
Expand All @@ -29,30 +31,44 @@ last(['a', 'b', 'c', 'd', 'e', 'f'], 3);
* [array-unique](https://www.npmjs.com/package/array-unique): Return an array free of duplicate values. Fastest ES5 implementation. | [homepage](https://github.com/jonschlinkert/array-unique)
* [array-xor](https://www.npmjs.com/package/array-xor): Returns the symmetric difference (exclusive-or) of an array of elements (elements that are present in… [more](https://www.npmjs.com/package/array-xor) | [homepage](https://github.com/jonschlinkert/array-xor)

## Running tests
## Contributing

Install dev dependencies:
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/array-last/issues/new).

## Building docs

Generate readme and API documentation with [verb](https://github.com/verbose/verb):

```sh
$ npm i -d && npm test
$ npm install verb && npm run docs
```

## Contributing
Or, if [verb](https://github.com/verbose/verb) is installed globally:

```sh
$ verb
```

## Running tests

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](/new).
Install dev dependencies:

```sh
$ npm install -d && npm test
```

## Author

**Jon Schlinkert**

+ [github/jonschlinkert](https://github.com/jonschlinkert)
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)

## License

Copyright © 2015 Jon Schlinkert
Released under the MIT license.
Copyright © 2016 [Jon Schlinkert](https://github.com/jonschlinkert)
Released under the [MIT license](https://github.com/jonschlinkert/array-last/blob/master/LICENSE).

***

_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on November 02, 2015._
_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on March 09, 2016._
23 changes: 20 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"homepage": "https://github.com/jonschlinkert/array-last",
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
"repository": "jonschlinkert/array-last",
"bugs": "https://github.com/jonschlinkert/array-last/issues",
"bugs": {
"url": "https://github.com/jonschlinkert/array-last/issues"
},
"license": "MIT",
"files": [
"index.js"
Expand All @@ -24,6 +26,7 @@
"ansi-bold": "^0.1.1",
"array-slice": "^0.2.3",
"benchmarked": "^0.1.4",
"gulp-format-md": "^0.1.7",
"matched": "^0.3.2",
"mocha": "*"
},
Expand All @@ -41,13 +44,27 @@
"utils"
],
"verb": {
"run": true,
"toc": false,
"layout": "default",
"tasks": [
"readme"
],
"plugins": [
"gulp-format-md"
],
"related": {
"list": [
"arr-union",
"array-unique",
"array-xor"
],
"description": ""
]
},
"reflinks": [
"verb"
],
"lint": {
"reflinks": true
}
}
}
10 changes: 5 additions & 5 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,25 @@ require('mocha');
var assert = require('assert');
var last = require('./');

describe('last', function () {
it('should throw an error if invalid args are passed:', function (cb) {
describe('last', function() {
it('should throw an error if invalid args are passed:', function(cb) {
try {
last();
cb(new Error('expected an error'));
} catch(err) {
} catch (err) {
assert(err);
assert(err.message);
assert(err.message === 'expected the first argument to be an array');
cb();
}
});

it('should return the last element in the array:', function () {
it('should return the last element in the array:', function() {
assert.strictEqual(last(['a', 'b', 'c', 'd', 'e', 'f']), 'f');
assert.strictEqual(last(['a', 'b', 'c', 'd', 'e', 'f'], 1), 'f');
});

it('should the last n elements of the array:', function () {
it('should the last n elements of the array:', function() {
assert.deepEqual(last(['a', 'b', 'c', 'd', 'e', 'f'], 3), ['d', 'e', 'f']);
});
});
Expand Down

0 comments on commit f75ddb2

Please sign in to comment.