/**
 * @license Copyright (c) 2017-2025, CKSource Holding sp. z o.o. All rights reserved.
 * For licensing, see LICENSE.md.
 */

'use strict';

/**
 * Escapes string
 * @param str
 * @returns {String}
 */
module.exports = str => {
	if ( typeof str !== 'string' ) {
		str = String( str );
	}

	return str.replace( /&/g, '&amp;' )
		.replace( /</g, '&lt' );
};
