@chapeaux/cpx-eddl
Advanced tools
Comparing version 0.10.0 to 0.20.0
@@ -121,3 +121,2 @@ import { ReporterEvent } from "./reporter.js"; | ||
report(e) { | ||
var _a, _b, _c; | ||
if (this.debug !== null) { | ||
@@ -133,6 +132,6 @@ if (this.debug !== 'verbose') { | ||
if (this.option) { | ||
this.data = Object.assign((_a = this.data) !== null && _a !== void 0 ? _a : {}, (_b = detail[this.option]) !== null && _b !== void 0 ? _b : {}); | ||
this.data = Object.assign(this.data ?? {}, detail[this.option] ?? {}); | ||
} | ||
else { | ||
this.data = Object.assign((_c = this.data) !== null && _c !== void 0 ? _c : {}, detail !== null && detail !== void 0 ? detail : {}); | ||
this.data = Object.assign(this.data ?? {}, detail ?? {}); | ||
} | ||
@@ -139,0 +138,0 @@ this.dispatchEvent(new ReporterEvent(this.event, this.data, this.emit)); |
@@ -1,2 +0,1 @@ | ||
var _a; | ||
let evtName = 'cpx-report'; | ||
@@ -6,5 +5,7 @@ const seed = new Uint32Array(1); | ||
const src = document.querySelector(`script[src*='${(new URL(import.meta.url)).pathname}']:not(#_${rng})`); | ||
if (src instanceof HTMLElement) { | ||
evtName = (_a = src.getAttribute('data-event')) !== null && _a !== void 0 ? _a : evtName; | ||
src.id = `_${rng}`; | ||
if (import.meta.url) { | ||
if (src instanceof HTMLElement) { | ||
evtName = src.getAttribute('data-event') ?? evtName; | ||
src.id = `_${rng}`; | ||
} | ||
} | ||
@@ -11,0 +12,0 @@ globalThis.appEventData = globalThis.appEventData || []; |
{ | ||
"name": "@chapeaux/cpx-eddl", | ||
"version": "0.10.0", | ||
"description": "Chapeaux EDDL Components", | ||
"version": "0.20.0", | ||
"description": "Chapeaux EDDL Component", | ||
"type": "module", | ||
@@ -33,4 +33,7 @@ "main": "cpx-eddl.js", | ||
"devDependencies": { | ||
"typescript": "^4.0.2" | ||
"@esm-bundle/chai": "^4.3.4-fix.0", | ||
"@open-wc/testing": "3.1.7", | ||
"@web/test-runner": "^0.14.0", | ||
"typescript": "^5.1.3" | ||
} | ||
} |
@@ -1,4 +0,3 @@ | ||
var _a, _b; | ||
function CombineEventData(payload, target, data) { | ||
let combination = Object.assign(payload(target), data !== null && data !== void 0 ? data : {}); | ||
let combination = Object.assign(payload(target), data ?? {}); | ||
return combination; | ||
@@ -78,6 +77,5 @@ } | ||
onsiteSearch: (tgt, data) => { | ||
var _a; | ||
const kw = { searchType: '', searchTerm: '', searchMethod: '' }; | ||
if (data['keyword']) { | ||
data['keyword'] = Object.assign(kw, (_a = data['keyword']) !== null && _a !== void 0 ? _a : {}); | ||
data['keyword'] = Object.assign(kw, data['keyword'] ?? {}); | ||
} | ||
@@ -175,3 +173,3 @@ else { | ||
this.obj.payload, | ||
this.obj.data[this.obj.payload](this.currentTarget, data !== null && data !== void 0 ? data : {}) | ||
this.obj.data[this.obj.payload](this.currentTarget, data ?? {}) | ||
]]); | ||
@@ -182,11 +180,13 @@ this.data = Object.fromEntries(objEntries); | ||
} | ||
const reporter = document.querySelector(`script[src*='${(new URL(import.meta.url)).pathname}']:not([reported])`); | ||
if (reporter instanceof HTMLElement) { | ||
if (reporter.getAttribute('reported') == null) { | ||
const data = JSON.parse((_a = reporter.textContent) !== null && _a !== void 0 ? _a : ''); | ||
const emitName = (_b = reporter.getAttribute('data-emit')) !== null && _b !== void 0 ? _b : 'cpx-report'; | ||
globalThis.dispatchEvent(new ReporterEvent(reporter.dataset.event, data, emitName)); | ||
reporter.setAttribute('reported', ''); | ||
if (import.meta.url) { | ||
const reporter = document.querySelector(`script[src*='${(new URL(import.meta.url)).pathname}']:not([reported])`); | ||
if (reporter instanceof HTMLElement) { | ||
if (reporter.getAttribute('reported') == null) { | ||
const data = JSON.parse(reporter.textContent ?? ''); | ||
const emitName = reporter.getAttribute('data-emit') ?? 'cpx-report'; | ||
globalThis.dispatchEvent(new ReporterEvent(reporter.dataset.event, data, emitName)); | ||
reporter.setAttribute('reported', ''); | ||
} | ||
} | ||
} | ||
globalThis['ReporterEvent'] = ReporterEvent; |
Network access
Supply chain riskThis module accesses the network.
Found 4 instances in 1 package
50649
29
1044
4
8