@ndla/util
Advanced tools
Comparing version 5.0.0-alpha.0 to 5.0.1-alpha.0
@@ -9,3 +9,2 @@ /** | ||
import { useEffect, useState } from "react"; | ||
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime"; | ||
/** | ||
@@ -25,10 +24,6 @@ * A component that makes children not run on the server | ||
if (!mounted) { | ||
return /*#__PURE__*/_jsx(_Fragment, { | ||
children: fallback | ||
}); | ||
return fallback; | ||
} | ||
return /*#__PURE__*/_jsx(_Fragment, { | ||
children: children | ||
}); | ||
return children; | ||
}; | ||
export default NoSSR; |
@@ -28,3 +28,2 @@ /** | ||
function resizeObserverWrapper(element, handler) { | ||
// @ts-ignore ResizeObserver | ||
let resizeObserver = new ResizeObserver(() => { | ||
@@ -48,3 +47,2 @@ handler(element); | ||
export function resizeObserver(element, handler) { | ||
// @ts-ignore ResizeObserver | ||
if (typeof ResizeObserver === "function") { | ||
@@ -51,0 +49,0 @@ return resizeObserverWrapper(element, handler); |
@@ -9,2 +9,3 @@ /** | ||
// TODO: Remove this function. We can use the uuid package if we really need it | ||
function uuid(a) { | ||
@@ -15,5 +16,5 @@ if (a) { | ||
// @ts-ignore | ||
// @ts-expect-error - Magic | ||
return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, uuid); | ||
} | ||
export default uuid; |
@@ -17,3 +17,3 @@ /** | ||
*/ | ||
declare const NoSSR: ({ children, fallback }: Props) => import("react/jsx-runtime").JSX.Element; | ||
declare const NoSSR: ({ children, fallback }: Props) => ReactNode; | ||
export default NoSSR; |
@@ -8,3 +8,2 @@ "use strict"; | ||
var _react = require("react"); | ||
var _jsxRuntime = require("react/jsx-runtime"); | ||
/** | ||
@@ -32,10 +31,6 @@ * Copyright (c) 2022-present, NDLA. | ||
if (!mounted) { | ||
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, { | ||
children: fallback | ||
}); | ||
return fallback; | ||
} | ||
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, { | ||
children: children | ||
}); | ||
return children; | ||
}; | ||
var _default = exports.default = NoSSR; |
@@ -34,3 +34,2 @@ "use strict"; | ||
function resizeObserverWrapper(element, handler) { | ||
// @ts-ignore ResizeObserver | ||
let resizeObserver = new ResizeObserver(() => { | ||
@@ -54,3 +53,2 @@ handler(element); | ||
function resizeObserver(element, handler) { | ||
// @ts-ignore ResizeObserver | ||
if (typeof ResizeObserver === "function") { | ||
@@ -57,0 +55,0 @@ return resizeObserverWrapper(element, handler); |
@@ -15,2 +15,3 @@ "use strict"; | ||
// TODO: Remove this function. We can use the uuid package if we really need it | ||
function uuid(a) { | ||
@@ -21,5 +22,5 @@ if (a) { | ||
// @ts-ignore | ||
// @ts-expect-error - Magic | ||
return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, uuid); | ||
} | ||
var _default = exports.default = uuid; |
{ | ||
"name": "@ndla/util", | ||
"version": "5.0.0-alpha.0", | ||
"version": "5.0.1-alpha.0", | ||
"description": "Collection of util functions used by NDLA", | ||
@@ -35,3 +35,3 @@ "license": "GPL-3.0", | ||
}, | ||
"gitHead": "fe2fb3061416c88e5fd5f1d52c216e17e52c4387" | ||
"gitHead": "3f2d720f26b163be90b396f40f3c1fad746b3cf9" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
85991
1473