@oozcitak/dom
Advanced tools
Comparing version 0.0.2 to 0.0.4
@@ -676,3 +676,3 @@ "use strict"; | ||
if (idlAttributes) { | ||
for (const [key, value] of Object.entries(idlAttributes)) { | ||
for (const [key, value] of util_1.forEachObject(idlAttributes)) { | ||
const idlObj = event; | ||
@@ -679,0 +679,0 @@ idlObj[key] = value; |
@@ -60,3 +60,3 @@ "use strict"; | ||
// attribute | ||
for (let [attName, attValue] of Object.entries(element.attributes)) { | ||
for (let [attName, attValue] of util_1.forEachObject(element.attributes)) { | ||
if (attName === "xmlns") { | ||
@@ -78,3 +78,3 @@ namespace = attValue; | ||
// assign attributes | ||
for (let [attName, attValue] of Object.entries(element.attributes)) { | ||
for (let [attName, attValue] of util_1.forEachObject(element.attributes)) { | ||
// skip the default namespace declaration attribute | ||
@@ -81,0 +81,0 @@ if (attName === "xmlns") { |
@@ -21,2 +21,10 @@ import { GlobalStore } from './GlobalStore'; | ||
/** | ||
* Iterates over key/value pairs of a map or object. | ||
* | ||
* @param obj - map or object to iterate | ||
*/ | ||
export declare function forEachObject<T>(obj: { | ||
[key: string]: T; | ||
}): IterableIterator<[string, T]>; | ||
/** | ||
* Deep clones the given object. | ||
@@ -23,0 +31,0 @@ * |
@@ -44,2 +44,16 @@ "use strict"; | ||
/** | ||
* Iterates over key/value pairs of a map or object. | ||
* | ||
* @param obj - map or object to iterate | ||
*/ | ||
function* forEachObject(obj) { | ||
for (const key in obj) { | ||
/* istanbul ignore next */ | ||
if (!obj.hasOwnProperty(key)) | ||
continue; | ||
yield [key, obj[key]]; | ||
} | ||
} | ||
exports.forEachObject = forEachObject; | ||
/** | ||
* Deep clones the given object. | ||
@@ -46,0 +60,0 @@ * |
{ | ||
"name": "@oozcitak/dom", | ||
"version": "0.0.2", | ||
"version": "0.0.4", | ||
"keywords": [ | ||
@@ -5,0 +5,0 @@ "dom", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1087301
21538