| !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.DOMMAP=t():e.DOMMAP=t()}(self,(function(){return(()=>{"use strict";var e={d:(t,o)=>{for(var r in o)e.o(o,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:o[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},t={};e.d(t,{default:()=>o});class o{constructor(e){this.container=e}insert(...e){var t;if(arguments)for(let e in arguments)null===(t=this.container)||void 0===t||t.append(arguments[e])}createElem(e,t,o,r){const n=document.createElement(e);if(t)for(let e in t)n.setAttribute(e,t[e]);if(o&&o(n),r)for(let e=3;e<arguments.length;e++)arguments[e]&&n.append(arguments[e]);return n}}return t.default})()})); |
| declare type DOMManipulationFn = (elem: HTMLElement) => void; | ||
| export default class DOMMap { | ||
| container: HTMLElement | null; | ||
| constructor(container: HTMLElement | null); | ||
| insert(...args: any[]): void; | ||
| createElem<K extends keyof HTMLElementTagNameMap, T>(tagName: K, property: any, cb?: DOMManipulationFn | null, children?: T): HTMLElementTagNameMap[K]; | ||
| } | ||
| export {}; |
+13
-7
| { | ||
| "name": "dom-map", | ||
| "version": "0.2.1", | ||
| "main": "lib/dom-map.js", | ||
| "types": "lib/dom-map.d.ts", | ||
| "version": "0.3.1", | ||
| "main": "dist/dom-map.js", | ||
| "types": "dist/dom-map.d.ts", | ||
| "repository": "git@github.com:Xavier577/DOMMap.git", | ||
@@ -10,3 +10,3 @@ "author": "Joseph <josephtsegen10@gmail.com>", | ||
| "files": [ | ||
| "lib" | ||
| "dist" | ||
| ], | ||
@@ -20,7 +20,13 @@ "keywords": [ | ||
| "scripts": { | ||
| "build": "tsc" | ||
| "dev": "webpack --mode development", | ||
| "dev:watch": "webpack --mode development --watch", | ||
| "build": "webpack --mode production" | ||
| }, | ||
| "dependencies": { | ||
| "dom-map": "^0.0.1" | ||
| "devDependencies": { | ||
| "dom-map": "^0.0.1", | ||
| "ts-loader": "^9.2.6", | ||
| "typescript": "^4.5.5", | ||
| "webpack": "^5.67.0", | ||
| "webpack-cli": "^4.9.2" | ||
| } | ||
| } |
| declare type DOMManipulationFn = (elem: HTMLElement) => void; | ||
| declare class DOMMap { | ||
| container: HTMLElement | null; | ||
| constructor(container: HTMLElement | null); | ||
| insert(...args: any[]): void; | ||
| createElem<K extends keyof HTMLElementTagNameMap, T>(tagName: K, property: any, cb?: DOMManipulationFn | null, children?: T): HTMLElementTagNameMap[K]; | ||
| } |
| class DOMMap { | ||
| constructor(container) { | ||
| this.container = container; | ||
| } | ||
| insert(...args) { | ||
| var _a; | ||
| if (arguments) { | ||
| for (let idx in arguments) { | ||
| (_a = this.container) === null || _a === void 0 ? void 0 : _a.append(arguments[idx]); | ||
| } | ||
| } | ||
| } | ||
| createElem(tagName, property, cb, children) { | ||
| const elem = document.createElement(tagName); | ||
| if (property) { | ||
| for (let attribute in property) { | ||
| elem.setAttribute(attribute, property[attribute]); | ||
| } | ||
| } | ||
| if (cb) { | ||
| cb(elem); | ||
| } | ||
| if (children) { | ||
| for (let idx = 3; idx < arguments.length; idx++) { | ||
| if (arguments[idx]) { | ||
| elem.append(arguments[idx]); | ||
| } | ||
| } | ||
| } | ||
| return elem; | ||
| } | ||
| } | ||
| //# sourceMappingURL=dom-map.js.map |
| {"version":3,"file":"dom-map.js","sourceRoot":"","sources":["../src/dom-map.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM;IAGV,YAAY,SAA6B;QACvC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED,MAAM,CAAC,GAAG,IAAW;;QACnB,IAAI,SAAS,EAAE;YACb,KAAK,IAAI,GAAG,IAAI,SAAS,EAAE;gBACzB,MAAA,IAAI,CAAC,SAAS,0CAAE,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;aACxC;SACF;IACH,CAAC;IACD,UAAU,CACR,OAAU,EACV,QAAa,EACb,EAA6B,EAC7B,QAAY;QAEZ,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAC7C,IAAI,QAAQ,EAAE;YACZ,KAAK,IAAI,SAAS,IAAI,QAAQ,EAAE;gBAC9B,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;aACnD;SACF;QAED,IAAI,EAAE,EAAE;YACN,EAAE,CAAC,IAAI,CAAC,CAAC;SACV;QAED,IAAI,QAAQ,EAAE;YACZ,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE;gBAC/C,IAAI,SAAS,CAAC,GAAG,CAAC,EAAE;oBAClB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;iBAC7B;aACF;SACF;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF"} |
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
0
-100%1850
-29.44%5
Infinity%4
-20%8
-79.49%3
50%1
Infinity%- Removed
- Removed