|
|
@ -7,6 +7,12 @@ function _class(obj) { return Object.prototype.toString.call(obj); } |
|
|
|
|
|
|
|
function isString(obj) { return _class(obj) === '[object String]'; } |
|
|
|
|
|
|
|
var _hasOwnProperty = Object.prototype.hasOwnProperty; |
|
|
|
|
|
|
|
function has(object, key) { |
|
|
|
return object ? _hasOwnProperty.call(object, key) : false; |
|
|
|
} |
|
|
|
|
|
|
|
// Merge objects
|
|
|
|
//
|
|
|
|
function assign(obj /*from1, from2, from3, ...*/) { |
|
|
@ -74,7 +80,7 @@ var entities = require('./entities'); |
|
|
|
function replaceEntityPattern(match, name) { |
|
|
|
var code = 0; |
|
|
|
|
|
|
|
if (entities.hasOwnProperty(name)) { |
|
|
|
if (has(entities, name)) { |
|
|
|
return entities[name]; |
|
|
|
} else if (name.charCodeAt(0) === 0x23/* # */ && DIGITAL_ENTITY_TEST_RE.test(name)) { |
|
|
|
code = name[1].toLowerCase() === 'x' ? |
|
|
@ -120,6 +126,7 @@ function escapeHtml(str) { |
|
|
|
|
|
|
|
exports.assign = assign; |
|
|
|
exports.isString = isString; |
|
|
|
exports.has = has; |
|
|
|
exports.unescapeMd = unescapeMd; |
|
|
|
exports.isValidEntityCode = isValidEntityCode; |
|
|
|
exports.fromCodePoint = fromCodePoint; |
|
|
|