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

@flexilla/utilities

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@flexilla/utilities - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

8

dist/index.d.ts

@@ -21,6 +21,6 @@ export declare const afterTransition: ({ element, callback, }: {

export declare const injectStyle: ({ newStyles, identifier, }: {
newStyles: string;
identifier: string;
}) => void;
export declare const findDirectDescendant: ({ selector, parentElement, }: {
selector: string;
parentElement: HTMLElement;
}) => HTMLElement | undefined;

@@ -27,0 +27,0 @@ export declare const setAttributes: (element: HTMLElement, attributes: Record<string, string>) => void;

@@ -1,52 +0,47 @@

const s = ({
selector: e,
parentElement: t
}) => t.querySelector(e), i = ({
selector: e,
parentElement: t
}) => Array.from(t.querySelectorAll(e)), a = ({
newElement: e,
existingElement: t
const i = ({
selector: t,
parentElement: e
}) => e.querySelector(t), s = ({
selector: t,
parentElement: e
}) => Array.from(e.querySelectorAll(t)), a = ({
selector: t,
parentElement: e
}) => {
if (!(e instanceof HTMLElement) || !(t instanceof HTMLElement))
const n = s({ selector: t, parentElement: e });
return Array.from(n).find((o) => o.parentElement === e);
}, c = ({
newElement: t,
existingElement: e
}) => {
if (!(t instanceof HTMLElement) || !(e instanceof HTMLElement))
throw new Error("Both parameters must be valid HTML elements.");
const n = t.parentElement;
const n = e.parentElement;
if (n)
n.insertBefore(e, t);
n.insertBefore(t, e);
else
throw new Error("Existing element must have a parent element.");
}, l = ({
newStyles: e,
identifier: t
}, d = (t, e) => {
for (const [n, r] of Object.entries(e))
t.setAttribute(n, r);
}, f = ({
element: t,
callback: e
}) => {
const n = document.head.querySelector("[data-fx-style]");
if (n) {
(n.textContent || "").includes(t) || (n.textContent += e);
return;
}
const r = document.createElement("style");
r.textContent = e, r.setAttribute("data-fx-style", ""), document.head.appendChild(r);
}, c = (e, t) => {
for (const [n, r] of Object.entries(t))
e.setAttribute(n, r);
}, d = ({
element: e,
callback: t
}) => {
const n = getComputedStyle(e).transition;
n !== "none" && n !== "" && n !== "all 0s ease 0s" ? e.addEventListener(
const n = getComputedStyle(t).transition;
n !== "none" && n !== "" && n !== "all 0s ease 0s" ? t.addEventListener(
"transitionend",
function r() {
e.removeEventListener("transitionend", r), t();
t.removeEventListener("transitionend", r), e();
},
{ once: !0 }
) : t();
) : e();
};
export {
d as afterTransition,
a as appendBefore,
s as find,
i as findAll,
l as injectStyle,
c as setAttributes
f as afterTransition,
c as appendBefore,
i as find,
s as findAll,
a as findDirectDescendant,
d as setAttributes
};
{
"name": "@flexilla/utilities",
"private": false,
"version": "1.1.0",
"version": "1.2.0",
"type": "module",

@@ -54,4 +54,3 @@ "description": "Utilities package for flexilla library",

"license": "MIT",
"author": "johnkat-mj",
"gitHead": "18549edaac73621574bb4df22436305c201c47c8"
"author": "johnkat-mj"
}
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