Skip to content

Commit b47eac8

Browse files
author
Justin Kimbrell
committed
fix: fix security warnings
1 parent 65b264a commit b47eac8

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/helpers/css.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ export function mergeCss<TSource extends CSSProperties, TTarget extends CSSPrope
2424
target: TTarget
2525
): TSource {
2626
for (const key in target) {
27+
if (!Object.prototype.hasOwnProperty.call(target, key) ||
28+
key === '__proto__' || key === 'constructor' || key === 'prototype') {
29+
continue;
30+
}
31+
2732
const targetVal = target[key];
2833
const sourceVal = source[key];
2934

src/helpers/functions.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
export function parseDuration(duration: string | null | undefined): number {
2-
const match = duration?.trim().split(',')[0]?.match(/^([+-]?(?:\d+\.?\d*|\.\d+))\s*(ms|s|m|h)$/i);
2+
// const match = duration?.trim().split(',')[0]?.match(/^([+-]?(?:\d+\.?\d*|\.\d+))\s*(ms|s|m|h)$/i);
3+
const match = duration?.trim().split(',')[0]?.match(/^([+-]?)(\d+(?:\.\d+)?|\.\d+)\s*(ms|s|m|h)$/i);
34

45
if (!match) {
56
return 0;
67
}
78

8-
const [, val, unit] = match;
9+
const [,, val, unit] = match;
910

1011
return parseFloat(val!) * {
1112
ms: 1,

0 commit comments

Comments
 (0)