All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.internals.create-html.js Maven / Gradle / Ivy

There is a newer version: 3.39.0
Show newest version
'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, '"') + '"';
  return p1 + '>' + S + '';
};




© 2015 - 2024 Weber Informatics LLC | Privacy Policy