Socket
Socket
Sign inDemoInstall

araz

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

araz - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

package.json
{
"name": "araz",
"version": "1.0.0",
"version": "1.0.1",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.ts",

@@ -32,6 +32,8 @@ import { Element } from './types';

const createElement = <P extends { [key: string]: any }>({
const h = <P extends { [key: string]: any }>({
name,
props = {} as P,
children = null,
setup,
onMounted,
}: Element<P>): HTMLElement => {

@@ -43,6 +45,14 @@ const element: HTMLElement = document.createElement(name);

addChildren(element, children);
if (setup) {
setup(element); // Call the setup function with the created element
}
if (onMounted) {
element.addEventListener('DOMContentLoaded', () => {
onMounted(element); // Call the onMounted function when the element is mounted
});
}
return element;
};
export default createElement;
export default h;
// types.ts
export interface Element<P extends { [key: string]: any } = {}> {
name: string;
props?: P;
children?: Node | string | (Node | string)[] | null;
}
name: string;
props?: P;
children?: Node | string | (Node | string)[] | null;
setup :any
onMounted: any
}
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