@ndla/util
Advanced tools
Comparing version 4.0.4 to 4.1.0
@@ -15,3 +15,3 @@ /** | ||
if (expiration !== undefined) { | ||
if (typeof expiration === "string") return `expires=${expiration}`;else return `expires=${expiration.toUTCString()}`; | ||
if (typeof expiration === "string") return "expires=".concat(expiration);else return "expires=".concat(expiration.toUTCString()); | ||
} | ||
@@ -23,3 +23,3 @@ if (removeCookie) { | ||
d.setTime(d.getTime() + 9999 * 24 * 60 * 60 * 1000); | ||
return `expires=${d.toUTCString()}`; | ||
return "expires=".concat(d.toUTCString()); | ||
} | ||
@@ -37,3 +37,3 @@ }; | ||
const expires = getCookieExpiration(expiration, removeCookie); | ||
return `${cookieName}=${cookieValue}; ${expires}; SameSite=${lax ? "Lax" : "Strict"}; path=${path}`; | ||
return "".concat(cookieName, "=").concat(cookieValue, "; ").concat(expires, "; SameSite=").concat(lax ? "Lax" : "Strict", "; path=").concat(path); | ||
}; | ||
@@ -40,0 +40,0 @@ |
@@ -26,2 +26,3 @@ /** | ||
export { composeRefs } from "./composeRefs"; | ||
export { polymorphicForwardRef } from "./polymorphicForwardRef"; | ||
export { polymorphicForwardRef } from "./polymorphicForwardRef"; | ||
export { contains } from "./contains"; |
@@ -36,3 +36,3 @@ /** | ||
bodyElement.style.overflow = "hidden"; | ||
bodyElement.style.marginRight = `${scrollWidth}px`; | ||
bodyElement.style.marginRight = "".concat(scrollWidth, "px"); | ||
} | ||
@@ -39,0 +39,0 @@ } else { |
@@ -9,4 +9,3 @@ /** | ||
import { useEffect, useState } from "react"; | ||
import { Fragment as _Fragment } from "@emotion/react/jsx-runtime"; | ||
import { jsx as _jsx } from "@emotion/react/jsx-runtime"; | ||
import { Fragment as _Fragment, jsx as _jsx } from "@emotion/react/jsx-runtime"; | ||
/** | ||
@@ -13,0 +12,0 @@ * A component that makes children not run on the server |
@@ -34,3 +34,4 @@ /** | ||
return () => { | ||
resizeObserver?.disconnect(); | ||
var _resizeObserver; | ||
(_resizeObserver = resizeObserver) === null || _resizeObserver === void 0 || _resizeObserver.disconnect(); | ||
resizeObserver = null; | ||
@@ -37,0 +38,0 @@ }; |
@@ -22,3 +22,3 @@ "use strict"; | ||
if (expiration !== undefined) { | ||
if (typeof expiration === "string") return `expires=${expiration}`;else return `expires=${expiration.toUTCString()}`; | ||
if (typeof expiration === "string") return "expires=".concat(expiration);else return "expires=".concat(expiration.toUTCString()); | ||
} | ||
@@ -30,3 +30,3 @@ if (removeCookie) { | ||
d.setTime(d.getTime() + 9999 * 24 * 60 * 60 * 1000); | ||
return `expires=${d.toUTCString()}`; | ||
return "expires=".concat(d.toUTCString()); | ||
} | ||
@@ -44,3 +44,3 @@ }; | ||
const expires = getCookieExpiration(expiration, removeCookie); | ||
return `${cookieName}=${cookieValue}; ${expires}; SameSite=${lax ? "Lax" : "Strict"}; path=${path}`; | ||
return "".concat(cookieName, "=").concat(cookieValue, "; ").concat(expires, "; SameSite=").concat(lax ? "Lax" : "Strict", "; path=").concat(path); | ||
}; | ||
@@ -47,0 +47,0 @@ |
@@ -9,2 +9,2 @@ /** | ||
import { ReactNode } from "react"; | ||
export declare function createUniversalPortal(children: ReactNode, selector: string): import("@emotion/react/jsx-runtime").JSX.Element; | ||
export declare function createUniversalPortal(children: ReactNode, selector: string): import("react/jsx-runtime").JSX.Element; |
@@ -9,3 +9,3 @@ "use strict"; | ||
var _jsxRuntime = require("@emotion/react/jsx-runtime"); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } | ||
/** | ||
@@ -12,0 +12,0 @@ * Copyright (c) 2016-present, NDLA. |
@@ -26,2 +26,3 @@ /** | ||
export { polymorphicForwardRef } from "./polymorphicForwardRef"; | ||
export { contains } from "./contains"; | ||
export type { PolymorphicProps } from "./polymorphicForwardRef"; |
@@ -24,2 +24,8 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "contains", { | ||
enumerable: true, | ||
get: function () { | ||
return _contains.contains; | ||
} | ||
}); | ||
Object.defineProperty(exports, "copyTextToClipboard", { | ||
@@ -157,4 +163,5 @@ enumerable: true, | ||
var _polymorphicForwardRef = require("./polymorphicForwardRef"); | ||
var _contains = require("./contains"); | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } |
@@ -42,3 +42,3 @@ "use strict"; | ||
bodyElement.style.overflow = "hidden"; | ||
bodyElement.style.marginRight = `${scrollWidth}px`; | ||
bodyElement.style.marginRight = "".concat(scrollWidth, "px"); | ||
} | ||
@@ -45,0 +45,0 @@ } else { |
@@ -17,3 +17,3 @@ /** | ||
*/ | ||
declare const NoSSR: ({ children, fallback }: Props) => import("@emotion/react/jsx-runtime").JSX.Element; | ||
declare const NoSSR: ({ children, fallback }: Props) => import("react/jsx-runtime").JSX.Element; | ||
export default NoSSR; |
@@ -9,3 +9,3 @@ "use strict"; | ||
var _jsxRuntime = require("@emotion/react/jsx-runtime"); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } | ||
/** | ||
@@ -12,0 +12,0 @@ * Copyright (c) 2022-present, NDLA. |
@@ -40,3 +40,4 @@ "use strict"; | ||
return () => { | ||
resizeObserver?.disconnect(); | ||
var _resizeObserver; | ||
(_resizeObserver = resizeObserver) === null || _resizeObserver === void 0 || _resizeObserver.disconnect(); | ||
resizeObserver = null; | ||
@@ -43,0 +44,0 @@ }; |
@@ -9,3 +9,3 @@ /** | ||
import { ForwardedRef } from "react"; | ||
declare const useForwardedRef: <T>(ref?: ForwardedRef<T> | undefined) => import("react").MutableRefObject<T | null>; | ||
declare const useForwardedRef: <T>(ref?: ForwardedRef<T>) => import("react").MutableRefObject<T | null>; | ||
export default useForwardedRef; |
{ | ||
"name": "@ndla/util", | ||
"version": "4.0.4", | ||
"version": "4.1.0", | ||
"description": "Collection of util functions used by NDLA", | ||
@@ -35,3 +35,3 @@ "license": "GPL-3.0", | ||
}, | ||
"gitHead": "9d844b2508b4268099ea16ef69f14c273c4b4033" | ||
"gitHead": "2591a4413a91a0fa4bd4498bdb17ff0b7d0b4c60" | ||
} |
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
89483
63
1551