New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@codedazur/react-date-picker

Package Overview
Dependencies
Maintainers
22
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@codedazur/react-date-picker - npm Package Compare versions

Comparing version
0.0.2
to
0.0.3
+2
-2
.turbo/turbo-audit.log
> @codedazur/react-date-picker@0.0.2 audit
> npm audit --omit dev
> @codedazur/react-date-picker@0.0.3 audit
> npm audit --omit dev --audit-level high
found 0 vulnerabilities
> @codedazur/react-date-picker@0.0.2 build
> @codedazur/react-date-picker@0.0.3 build
> tsup index.ts --format esm,cjs --dts
CLI Building entry: index.ts
CLI Using tsconfig: tsconfig.json
CLI tsup v8.1.0
CLI Target: es6
ESM Build start
CJS Build start
ESM dist/index.mjs 13.98 KB
ESM ⚡️ Build success in 99ms
CJS dist/index.js 16.03 KB
CJS ⚡️ Build success in 105ms
DTS Build start
DTS ⚡️ Build success in 7866ms
DTS dist/index.d.mts 5.23 KB
DTS dist/index.d.ts 5.23 KB
CLI Building entry: index.ts
CLI Using tsconfig: tsconfig.json
CLI tsup v8.5.0
CLI Target: es2020
ESM Build start
CJS Build start
CJS dist/index.js 14.42 KB
CJS ⚡️ Build success in 133ms
ESM dist/index.mjs 12.31 KB
ESM ⚡️ Build success in 135ms
DTS Build start
DTS ⚡️ Build success in 8744ms
DTS dist/index.d.mts 5.23 KB
DTS dist/index.d.ts 5.23 KB
> @codedazur/react-date-picker@0.0.2 lint
> @codedazur/react-date-picker@0.0.3 lint
> TIMING=1 eslint "**/*.ts*"

@@ -8,11 +8,11 @@

:---------------------------------|----------:|--------:
react/display-name | 124.360 | 22.6%
@typescript-eslint/no-unused-vars | 110.125 | 20.0%
react/no-direct-mutation-state | 52.978 | 9.6%
react-hooks/exhaustive-deps | 50.460 | 9.2%
@next/next/no-html-link-for-pages | 44.837 | 8.2%
no-fallthrough | 39.485 | 7.2%
react/no-unescaped-entities | 22.263 | 4.0%
prefer-const | 20.470 | 3.7%
react/require-render-return | 18.359 | 3.3%
no-empty-pattern | 15.166 | 2.8%
turbo/no-undeclared-env-vars | 192.180 | 23.0%
@typescript-eslint/no-unused-vars | 153.555 | 18.4%
react/display-name | 138.966 | 16.7%
react/no-direct-mutation-state | 67.625 | 8.1%
@next/next/no-html-link-for-pages | 49.962 | 6.0%
react-hooks/exhaustive-deps | 30.167 | 3.6%
no-fallthrough | 20.218 | 2.4%
react-hooks/rules-of-hooks | 18.138 | 2.2%
use-isnan | 14.656 | 1.8%
@typescript-eslint/no-namespace | 14.183 | 1.7%
> @codedazur/react-date-picker@0.0.2 test
> @codedazur/react-date-picker@0.0.3 test
> vitest run --passWithNoTests
 RUN  v1.6.0 /home/runner/work/toolkit/toolkit/packages/react-date-picker
 RUN  v3.2.3 /home/runner/work/toolkit/toolkit/packages/react-date-picker
No test files found, exiting with code 0
include: **/*.{test,spec}.?(c|m)[jt]s?(x)
exclude: **/node_modules/**, **/dist/**, **/cypress/**, **/.{idea,git,cache,output,temp}/**, **/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.*
watch exclude: **/node_modules/**, **/dist/**
No test files found, exiting with code 0
# @codedazur/react-date-picker
## 0.0.3
### Patch Changes
- [`b24894a`](https://github.com/codedazur/toolkit/commit/b24894a2de01e596669c2b5aca51bc0b28533106) Thanks [@thijsdaniels](https://github.com/thijsdaniels)! - Mark the package as side-effect-free for tree shaking.
- Updated dependencies [[`b24894a`](https://github.com/codedazur/toolkit/commit/b24894a2de01e596669c2b5aca51bc0b28533106)]:
- @codedazur/essentials@1.12.1
## 0.0.2

@@ -4,0 +13,0 @@

"use strict";
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __objRest = (source, exclude) => {
var target = {};
for (var prop in source)
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
target[prop] = source[prop];
if (source != null && __getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(source)) {
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
target[prop] = source[prop];
}
return target;
};
var __export = (target, all) => {

@@ -50,8 +21,8 @@ for (var name in all)

// index.ts
var react_date_picker_exports = {};
__export(react_date_picker_exports, {
var index_exports = {};
__export(index_exports, {
useDatePicker: () => useDatePicker,
useSingleDatePicker: () => useSingleDatePicker
});
module.exports = __toCommonJS(react_date_picker_exports);
module.exports = __toCommonJS(index_exports);

@@ -217,12 +188,8 @@ // hooks/useDatePicker.ts

} = {}) => {
var _a;
const [dates, setDates] = (0, import_react.useState)(
new Array(count).fill(null).map((_, index) => {
var _a2;
return (_a2 = initialDates == null ? void 0 : initialDates[index]) != null ? _a2 : null;
})
new Array(count).fill(null).map((_, index) => initialDates?.[index] ?? null)
);
const [cursor, setCursor] = (0, import_react.useState)(initialCursor);
const [month, setMonth] = (0, import_react.useState)(
(0, import_date_fns6.startOfMonth)((_a = initialMonth != null ? initialMonth : initialDates == null ? void 0 : initialDates[0]) != null ? _a : /* @__PURE__ */ new Date())
(0, import_date_fns6.startOfMonth)(initialMonth ?? initialDates?.[0] ?? /* @__PURE__ */ new Date())
);

@@ -233,6 +200,3 @@ const [focusedDate, setFocusedDate] = (0, import_react.useState)(null);

setDates(
(dates2) => new Array(count).fill(null).map((_, index) => {
var _a2;
return (_a2 = dates2 == null ? void 0 : dates2[index]) != null ? _a2 : null;
})
(dates2) => new Array(count).fill(null).map((_, index) => dates2?.[index] ?? null)
);

@@ -474,11 +438,8 @@ }, [count]);

var import_essentials2 = require("@codedazur/essentials");
var useSingleDatePicker = (_a = {}) => {
var _b = _a, {
initialDate,
isDateDisabled
} = _b, props = __objRest(_b, [
"initialDate",
"isDateDisabled"
]);
const _a2 = useDatePicker(__spreadValues({
var useSingleDatePicker = ({
initialDate,
isDateDisabled,
...props
} = {}) => {
const { dates, setDate, ...results } = useDatePicker({
count: 1,

@@ -488,5 +449,7 @@ initialDates: initialDate ? [initialDate] : void 0,

maxDuration: 1,
isDateDisabled: isDateDisabled ? (date, cursor, dates2) => isDateDisabled(date, dates2[0]) : void 0
}, props)), { dates, setDate } = _a2, results = __objRest(_a2, ["dates", "setDate"]);
return __spreadProps(__spreadValues({}, (0, import_essentials2.omit)(results, ["cursor", "setCursor", "isFirstDate", "isLastDate"])), {
isDateDisabled: isDateDisabled ? (date, _, dates2) => isDateDisabled(date, dates2[0]) : void 0,
...props
});
return {
...(0, import_essentials2.omit)(results, ["cursor", "setCursor", "isFirstDate", "isLastDate"]),
date: dates[0],

@@ -496,3 +459,3 @@ setDate: (date) => {

}
});
};
};

@@ -499,0 +462,0 @@ // Annotate the CommonJS export names for ESM import in node:

@@ -1,33 +0,1 @@

var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __objRest = (source, exclude) => {
var target = {};
for (var prop in source)
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
target[prop] = source[prop];
if (source != null && __getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(source)) {
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
target[prop] = source[prop];
}
return target;
};
// hooks/useDatePicker.ts

@@ -218,12 +186,8 @@ import { clamp } from "@codedazur/essentials";

} = {}) => {
var _a;
const [dates, setDates] = useState(
new Array(count).fill(null).map((_, index) => {
var _a2;
return (_a2 = initialDates == null ? void 0 : initialDates[index]) != null ? _a2 : null;
})
new Array(count).fill(null).map((_, index) => initialDates?.[index] ?? null)
);
const [cursor, setCursor] = useState(initialCursor);
const [month, setMonth] = useState(
startOfMonth3((_a = initialMonth != null ? initialMonth : initialDates == null ? void 0 : initialDates[0]) != null ? _a : /* @__PURE__ */ new Date())
startOfMonth3(initialMonth ?? initialDates?.[0] ?? /* @__PURE__ */ new Date())
);

@@ -234,6 +198,3 @@ const [focusedDate, setFocusedDate] = useState(null);

setDates(
(dates2) => new Array(count).fill(null).map((_, index) => {
var _a2;
return (_a2 = dates2 == null ? void 0 : dates2[index]) != null ? _a2 : null;
})
(dates2) => new Array(count).fill(null).map((_, index) => dates2?.[index] ?? null)
);

@@ -475,11 +436,8 @@ }, [count]);

import { omit } from "@codedazur/essentials";
var useSingleDatePicker = (_a = {}) => {
var _b = _a, {
initialDate,
isDateDisabled
} = _b, props = __objRest(_b, [
"initialDate",
"isDateDisabled"
]);
const _a2 = useDatePicker(__spreadValues({
var useSingleDatePicker = ({
initialDate,
isDateDisabled,
...props
} = {}) => {
const { dates, setDate, ...results } = useDatePicker({
count: 1,

@@ -489,5 +447,7 @@ initialDates: initialDate ? [initialDate] : void 0,

maxDuration: 1,
isDateDisabled: isDateDisabled ? (date, cursor, dates2) => isDateDisabled(date, dates2[0]) : void 0
}, props)), { dates, setDate } = _a2, results = __objRest(_a2, ["dates", "setDate"]);
return __spreadProps(__spreadValues({}, omit(results, ["cursor", "setCursor", "isFirstDate", "isLastDate"])), {
isDateDisabled: isDateDisabled ? (date, _, dates2) => isDateDisabled(date, dates2[0]) : void 0,
...props
});
return {
...omit(results, ["cursor", "setCursor", "isFirstDate", "isLastDate"]),
date: dates[0],

@@ -497,3 +457,3 @@ setDate: (date) => {

}
});
};
};

@@ -500,0 +460,0 @@ export {

@@ -44,3 +44,3 @@ import { omit } from "@codedazur/essentials";

isDateDisabled: isDateDisabled
? (date, cursor, dates) => isDateDisabled(date, dates[0])
? (date, _, dates) => isDateDisabled(date, dates[0])
: undefined,

@@ -47,0 +47,0 @@ ...props,

{
"name": "@codedazur/react-date-picker",
"version": "0.0.2",
"version": "0.0.3",
"main": ".dist/index.js",

@@ -17,6 +17,7 @@ "module": "./dist/index.mjs",

"license": "MIT",
"sideEffects": false,
"scripts": {
"develop": "tsup index.ts --format esm,cjs --dts --watch --external react",
"build": "tsup index.ts --format esm,cjs --dts",
"audit": "npm audit --omit dev",
"audit": "npm audit --omit dev --audit-level high",
"lint": "TIMING=1 eslint \"**/*.ts*\"",

@@ -31,7 +32,7 @@ "types": "tsc --noEmit",

"dependencies": {
"@codedazur/essentials": "^1.9.1",
"@codedazur/essentials": "^1.12.1",
"date-fns": "^2.30.0"
},
"devDependencies": {
"@testing-library/dom": "10.2.0",
"@testing-library/dom": "10.4.0",
"@testing-library/react": "alpha",

@@ -38,0 +39,0 @@ "@types/react-dom": "^18.3.0",