@ckeditor/ckeditor5-utils
Version:
Miscellaneous utilities used by CKEditor 5.
17 lines (16 loc) • 439 B
JavaScript
/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/
/**
* @module utils/dom/tounit
*/
/**
* Returns a helper function, which adds a desired trailing
* `unit` to the passed value.
*
* @param unit An unit like "px" or "em".
*/
export default function toUnit(unit) {
return value => value + unit;
}