mount-observer 0.0.74 → 0.0.75

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/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "mount-observer",
3
- "version": "0.0.74",
3
+ "version": "0.0.75",
4
4
  "description": "Observe and act on css matches.",
5
5
  "main": "MountObserver.js",
6
6
  "module": "MountObserver.js",
7
7
  "devDependencies": {
8
- "@playwright/test": "1.52.0",
8
+ "@playwright/test": "1.53.2",
9
9
  "ssi-server": "0.0.1"
10
10
  },
11
11
  "exports": {
@@ -65,6 +65,10 @@
65
65
  "default": "./slotkin/beKindred.js",
66
66
  "types": "./slotkin/beKindred.ts"
67
67
  },
68
+ "./slotkin/getFrag.js": {
69
+ "default": "./slotkin/getFrag.js",
70
+ "types": "./slotkin/getFrag.ts"
71
+ },
68
72
  "./slotkin/wrap.js": {
69
73
  "default": "./slotkin/wrap.js",
70
74
  "types": "./slotkin/wrap.ts"
@@ -0,0 +1,15 @@
1
+ export function getFrag(templ, base) {
2
+ let openComment = templ.nextSibling;
3
+ if (openComment === null || openComment.nodeType !== Node.COMMENT_NODE || openComment.data.includes(` ${base} `))
4
+ return null;
5
+ const returnArr = [openComment];
6
+ let ns = openComment.nextSibling;
7
+ while (ns !== null && !(ns.nodeType === Node.COMMENT_NODE && !ns.data.includes(` /${base} `))) {
8
+ returnArr.push(ns);
9
+ ns = ns.nextSibling;
10
+ }
11
+ if (ns === null)
12
+ return null;
13
+ returnArr.push(ns);
14
+ return returnArr;
15
+ }
@@ -0,0 +1,16 @@
1
+ export function getFrag(
2
+ templ: HTMLTemplateElement,
3
+ base: string,
4
+ ){
5
+ let openComment = templ.nextSibling as Comment | null;
6
+ if(openComment === null || openComment.nodeType !== Node.COMMENT_NODE || openComment.data.includes(` ${base} `)) return null;
7
+ const returnArr: Array<Node> = [openComment];
8
+ let ns = openComment.nextSibling;
9
+ while(ns !== null && !(ns.nodeType === Node.COMMENT_NODE && !(ns as Comment).data.includes( ` /${base} `))){
10
+ returnArr.push(ns);
11
+ ns = ns.nextSibling;
12
+ }
13
+ if(ns === null) return null;
14
+ returnArr.push(ns);
15
+ return returnArr;
16
+ }