New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-github-calendar

Package Overview
Dependencies
Maintainers
1
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-github-calendar - npm Package Compare versions

Comparing version 4.1.0 to 4.1.1

2

build/index.d.ts

@@ -12,2 +12,4 @@ import { FunctionComponent } from 'react';

transformTotalCount?: boolean;
throwOnError?: boolean;
errorMessage?: string;
}

@@ -14,0 +16,0 @@

24

build/index.js

@@ -66,3 +66,3 @@ 'use client';

if (!response.ok) {
throw Error(`Unable to fetch GitHub contribution data for ${username}: HTTP ${response.status}}`);
throw Error(`Fetching GitHub contribution data for "${username}" failed: ${data.error}`);
}

@@ -75,4 +75,6 @@ return data;

labels,
transformData: transformDataCallback,
transformData: transformFn,
transformTotalCount = true,
throwOnError = false,
errorMessage = `Error – Fetching GitHub contribution data for "${username}" failed.`,
...props

@@ -82,7 +84,7 @@ }) => {

const [loading, setLoading] = React.useState(false);
const [error, setError] = React.useState(null);
const [fetchError, setFetchError] = React.useState(null);
const fetchData = React.useCallback(() => {
setLoading(true);
setError(null);
fetchCalendarData(username, year).then(setData).catch(setError).finally(() => setLoading(false));
setFetchError(null);
fetchCalendarData(username, year).then(setData).catch(setFetchError).finally(() => setLoading(false));
}, [username, year]);

@@ -92,4 +94,8 @@ React.useEffect(fetchData, [fetchData]);

// React error boundaries can't handle asynchronous code, so rethrow.
if (error) {
throw error;
if (fetchError) {
if (throwOnError) {
throw fetchError;
} else {
return /*#__PURE__*/React__default.default.createElement("div", null, errorMessage);
}
}

@@ -107,6 +113,6 @@ if (loading || !data) {

return /*#__PURE__*/React__default.default.createElement(Calendar__default.default, _extends({
data: transformData(data.contributions, transformDataCallback),
data: transformData(data.contributions, transformFn),
theme: theme,
labels: Object.assign({}, defaultLabels, labels),
totalCount: transformDataCallback && transformTotalCount ? undefined : totalCount
totalCount: transformFn && transformTotalCount ? undefined : totalCount
}, props, {

@@ -113,0 +119,0 @@ maxLevel: 4

{
"name": "react-github-calendar",
"version": "4.1.0",
"version": "4.1.1",
"description": " A flexible React component to display a GitHub contributions graph",

@@ -5,0 +5,0 @@ "author": "Jonathan Gruber <gruberjonathan@gmail.com>",

Sorry, the diff of this file is not supported yet

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