Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

scores

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scores - npm Package Compare versions

Comparing version 3.2.0 to 3.3.0

12

lib/parse.js

@@ -55,5 +55,11 @@ 'use strict'

const parseSeries = (s) => {
if (!s) return {}
const playedCompetitions = _.sumBy(s.summary.match(/\d+/g), (n) => +n)
return Object.assign(_.pick(s, 'totalCompetitions', 'completed'), { playedCompetitions })
const playedCompetitions = _.sumBy(_.get(s, 'summary', '1-0').match(/\d+/g), (n) => +n)
const totalCompetitions = _.get(s, 'totalCompetitions', playedCompetitions)
const completed = _.get(s, 'completed', playedCompetitions === totalCompetitions)
return {
completed,
totalCompetitions,
playedCompetitions
}
}

@@ -60,0 +66,0 @@

{
"name": "scores",
"description": "Track the completion of sports games from a URL.",
"version": "3.2.0",
"version": "3.3.0",
"author": "Luke Karrys <luke@lukekarrys.com>",

@@ -6,0 +6,0 @@ "bugs": {

@@ -24,3 +24,3 @@ 'use strict'

t.deepEqual(events[0].series, {})
t.deepEqual(events[0].series, { completed: true, playedCompetitions: 1, totalCompetitions: 1 })
t.equal(events[0].seriesCompleted, true)

@@ -27,0 +27,0 @@

@@ -24,3 +24,3 @@ 'use strict'

t.deepEqual(events[0].series, {})
t.deepEqual(events[0].series, { completed: true, playedCompetitions: 1, totalCompetitions: 1 })
t.equal(events[0].seriesCompleted, true)

@@ -62,3 +62,3 @@

t.deepEqual(events[1].series, {})
t.deepEqual(events[1].series, { completed: true, playedCompetitions: 1, totalCompetitions: 1 })
t.equal(events[1].seriesCompleted, true)

@@ -65,0 +65,0 @@

@@ -23,3 +23,3 @@ 'use strict'

t.deepEqual(events[0].series, {})
t.deepEqual(events[0].series, { completed: true, playedCompetitions: 1, totalCompetitions: 1 })
t.equal(events[0].seriesCompleted, true)

@@ -26,0 +26,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc