jizy-dom 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 Joffrey Demetz
3
+ Copyright (c) 2015-present Joffrey Demetz
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/index.js CHANGED
@@ -44,8 +44,7 @@ const jDOMcreate = function(tag, attrs = {}) {
44
44
 
45
45
  return wrapped;
46
46
  };
47
-
48
- export {
47
+ const JiZyDOM = {
49
48
  jDOM,
50
49
  Selector,
51
50
  domUtils,
@@ -58,3 +57,5 @@ export {
58
57
  extendDOMAnimations, extendDOMSwipe, extendDOMMisc
59
58
  };
60
59
 
60
+ export default JiZyDOM;
61
+
package/lib/access.js CHANGED
@@ -12,11 +12,6 @@ export function extendDOMAccess(DOM) {
12
12
  return this.elems.length;
13
13
  };
14
14
 
15
- DOM.prototype.each = function(callback) {
16
- this.elems.forEach((el, i) => callback.call(this, el, i));
17
- return this;
18
- };
19
-
20
15
  DOM.prototype.map = function(callback) {
21
16
  const results = [];
22
17
  this.elems.forEach((el, i) => {
@@ -41,12 +41,4 @@ export function extendDOMManipulation(DOM, Selector) {
41
41
  });
42
42
  };
43
43
 
44
- DOM.prototype.find = function(selector) {
45
- let elems = [];
46
- this.each(el => {
47
- let found = Selector(selector, el);
48
- if (found && found.length) elems.push(...found);
49
- });
50
- return new DOM(elems);
51
- };
52
44
  }
package/lib/traversal.js CHANGED
@@ -34,5 +34,14 @@ export function extendDOMTraversal(DOM) {
34
34
  const last = this.elems.map(el => el.lastElementChild).filter(Boolean);
35
35
  return selector ? new DOM(last).filter(selector) : new DOM(last);
36
36
  };
37
+
38
+ DOM.prototype.find = function(selector) {
39
+ let elems = [];
40
+ this.each(el => {
41
+ let found = Selector(selector, el);
42
+ if (found && found.length) elems.push(...found);
43
+ });
44
+ return new DOM(elems);
45
+ };
37
46
  }
38
47
 
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "jizy-dom",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "My own DOM utility",
5
+ "type": "module",
5
6
  "main": "index.js",
6
7
  "scripts": {
7
8
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -14,10 +15,13 @@
14
15
  "DOM",
15
16
  "Jizy"
16
17
  ],
17
- "author": "Joffrey Demetz",
18
+ "author": "Joffrey Demetz <joffrey.demetz@gmail.com> (https://joffreydemetz.com/jizy-modalizer/)",
18
19
  "license": "MIT",
19
20
  "bugs": {
20
21
  "url": "https://github.com/joffreydemetz/jizy-dom/issues"
21
22
  },
22
- "homepage": "https://github.com/joffreydemetz/jizy-dom#readme"
23
+ "homepage": "https://github.com/joffreydemetz/jizy-dom#readme",
24
+ "directories": {
25
+ "lib": "lib"
26
+ }
23
27
  }