Skip to content

Commit

Permalink
update devDependencies
Browse files Browse the repository at this point in the history
* update rollup-config-module to adapt to .mjs-based ecosystem
* update @shinnn/eslint-config and follow its coding rules, for example tab indent
* switch from istanbul to nyc
  • Loading branch information
shinnn committed Apr 19, 2018
1 parent 1032e75 commit e1602a7
Show file tree
Hide file tree
Showing 9 changed files with 4,327 additions and 148 deletions.
7 changes: 5 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ root = true
[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
indent_style = tab
tab_width = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.{md,yml}]
indent_style = space

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.nyc_output
coverage
node_modules
7 changes: 1 addition & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
dist: trusty
git:
depth: 1
branches:
except: /^v\d/
language: node_js
node_js: node
after_script:
- npm install istanbul-coveralls
- node node_modules/.bin/istanbul-coveralls
after_script: node_modules/.bin/nyc report --reporter=text-lcov | npx coveralls
48 changes: 24 additions & 24 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,30 @@
var arrIndexesOf = require('arr-indexes-of');

function repetitionRanges(arr, value) {
var indexes = arrIndexesOf(arr, value);

var results = [];
var i = 0;
var start = null;

while (i < indexes.length) {
if (indexes[i] === indexes[i + 1] - 1) {
if (start === null) {
start = indexes[i];
}
} else if (start !== null) {
results.push({
start: start,
end: indexes[i]
});

start = null;
}

i += 1;
}

return results;
var indexes = arrIndexesOf(arr, value);

var results = [];
var i = 0;
var start = null;

while (i < indexes.length) {
if (indexes[i] === indexes[i + 1] - 1) {
if (start === null) {
start = indexes[i];
}
} else if (start !== null) {
results.push({
start: start,
end: indexes[i]
});

start = null;
}

i += 1;
}

return results;
}

module.exports = repetitionRanges;
28 changes: 28 additions & 0 deletions index.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import arrIndexesOf from 'arr-indexes-of';

export default function repetitionRanges(arr, value) {
var indexes = arrIndexesOf(arr, value);

var results = [];
var i = 0;
var start = null;

while (i < indexes.length) {
if (indexes[i] === indexes[i + 1] - 1) {
if (start === null) {
start = indexes[i];
}
} else if (start !== null) {
results.push({
start: start,
end: indexes[i]
});

start = null;
}

i += 1;
}

return results;
}
28 changes: 0 additions & 28 deletions module.js

This file was deleted.

Loading

0 comments on commit e1602a7

Please sign in to comment.