PromoCursed/node_modules/core-js/internals/create-html.js
2024-08-20 23:25:37 +04:00

17 lines
626 B
JavaScript

'use strict';
var uncurryThis = require('../internals/function-uncurry-this');
var requireObjectCoercible = require('../internals/require-object-coercible');
var toString = require('../internals/to-string');
var quot = /"/g;
var replace = uncurryThis(''.replace);
// `CreateHTML` abstract operation
// https://tc39.es/ecma262/#sec-createhtml
module.exports = function (string, tag, attribute, value) {
var S = toString(requireObjectCoercible(string));
var p1 = '<' + tag;
if (attribute !== '') p1 += ' ' + attribute + '="' + replace(toString(value), quot, '&quot;') + '"';
return p1 + '>' + S + '</' + tag + '>';
};