Skip to content

Commit

Permalink
Remove need for array.find polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
cookpete committed Sep 26, 2017
1 parent ef50ecc commit 78a1cb8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
],
"license": "CC0-1.0",
"dependencies": {
"array.prototype.find": "^2.0.0",
"commander": "^2.9.0",
"parse-github-url": "^1.0.0",
"semver": "^5.1.0"
Expand Down
12 changes: 6 additions & 6 deletions src/commits.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
import find from 'array.prototype.find'

find.shim()

const COMMIT_SEPARATOR = '__AUTO_CHANGELOG_COMMIT_SEPARATOR__'
const MESSAGE_SEPARATOR = '__AUTO_CHANGELOG_MESSAGE_SEPARATOR__'

Expand Down Expand Up @@ -33,8 +29,12 @@ export function parseCommits (string) {
}

function tagFromRefs (refs) {
const valid = refs.split(', ').find(ref => ref.indexOf(TAG_PREFIX) === 0)
return valid ? valid.replace(TAG_PREFIX, '') : null
for (let ref of refs.split(', ')) {
if (ref.indexOf(TAG_PREFIX) === 0) {
return ref.replace(TAG_PREFIX, '')
}
}
return null
}

function parseStats (stats) {
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ array-unique@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53"

array.prototype.find@^2.0.0, array.prototype.find@^2.0.1:
array.prototype.find@^2.0.1:
version "2.0.4"
resolved "https://registry.yarnpkg.com/array.prototype.find/-/array.prototype.find-2.0.4.tgz#556a5c5362c08648323ddaeb9de9d14bc1864c90"
dependencies:
Expand Down

0 comments on commit 78a1cb8

Please sign in to comment.