@gedit/utils
Advanced tools
Comparing version 0.1.57 to 0.1.58
@@ -33,4 +33,4 @@ import { CacheManager, Disposable } from '../common'; | ||
*/ | ||
function createDOMCache<T extends DOMCache = DOMCache>(parent: HTMLElement, className: string | (() => HTMLElement)): CacheManager<T>; | ||
function createDOMCache<T extends DOMCache = DOMCache>(parent: HTMLElement, className: string | (() => HTMLElement), children?: string): CacheManager<T>; | ||
} | ||
//# sourceMappingURL=dom-utils.d.ts.map |
@@ -151,5 +151,8 @@ "use strict"; | ||
*/ | ||
function createDOMCache(parent, className) { | ||
function createDOMCache(parent, className, children) { | ||
return common_1.Cache.create(function (item) { | ||
var dom = typeof className === 'string' ? domUtils.createDivWithClass(className) : className(); | ||
if (children) { | ||
dom.innerHTML = children; | ||
} | ||
parent.appendChild(dom); | ||
@@ -156,0 +159,0 @@ return Object.assign(dom, { |
{ | ||
"name": "@gedit/utils", | ||
"version": "0.1.57", | ||
"version": "0.1.58", | ||
"license": "MIT", | ||
@@ -31,3 +31,3 @@ "main": "lib/common/index", | ||
}, | ||
"gitHead": "d83185cc99ccb9faa166136ac4e9aef16409628a" | ||
"gitHead": "a6f1e817d460d94998321db21b0acac6cd189303" | ||
} |
@@ -125,5 +125,8 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ | ||
*/ | ||
export function createDOMCache<T extends DOMCache = DOMCache>(parent: HTMLElement, className: string | (() => HTMLElement)): CacheManager<T> { | ||
export function createDOMCache<T extends DOMCache = DOMCache>(parent: HTMLElement, className: string | (() => HTMLElement), children?: string): CacheManager<T> { | ||
return Cache.create<T>(item => { | ||
const dom = typeof className === 'string' ? domUtils.createDivWithClass(className) : className(); | ||
if (children) { | ||
dom.innerHTML = children; | ||
} | ||
parent.appendChild(dom); | ||
@@ -130,0 +133,0 @@ return Object.assign(dom, { |
@@ -5,3 +5,3 @@ import { Schema, SchemaDecoration } from './schema'; | ||
x: number, | ||
y: number | ||
y: number, | ||
} | ||
@@ -8,0 +8,0 @@ |
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
546915
10356