Skip to content

Commit b7a9c1e

Browse files
author
release bot
committed
📦 2.2.0
1 parent a0e0872 commit b7a9c1e

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

‎action.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ author: "platane"
44

55
runs:
66
using: docker
7-
image: docker://platane/snk@sha256:89466e404c3d3ba2384e24aabad0542a643eacdc53d0c6320ce369cc1af19d56
7+
image: docker://platane/snk@sha256:dcb351bdad223f2a2161fa5d6e3c9102e6ebe9fbde99a10fa3bf443d69f61a0f
88

99
inputs:
1010
github_user_name:

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "snk",
33
"description": "Generates a snake game from a github user contributions grid",
4-
"version": "2.1.0",
4+
"version": "2.2.0",
55
"private": true,
66
"repository": "github:platane/snk",
77
"devDependencies": {

‎svg-only/dist/317.index.js‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,12 @@ const parseUserPage = (content) => {
8484
.split("</svg>")[0];
8585
let x = 0;
8686
let lastYAttribute = 0;
87-
const rects = Array.from(block.matchAll(/<rect[^>]*>/g)).map(([m]) => {
87+
const rects = Array.from(block.matchAll(/<rect[^>]*>[^<]*<\/rect>/g)).map(([m]) => {
8888
const date = m.match(/data-date="([^"]+)"/)[1];
89-
const count = +m.match(/data-count="([^"]+)"/)[1];
9089
const level = +m.match(/data-level="([^"]+)"/)[1];
9190
const yAttribute = +m.match(/y="([^"]+)"/)[1];
91+
const literalCount = m.match(/(No|\d+) contributions? on/)[1];
92+
const count = literalCount === "No" ? 0 : +literalCount;
9293
if (lastYAttribute > yAttribute)
9394
x++;
9495
lastYAttribute = yAttribute;

0 commit comments

Comments
 (0)