Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Ryan778
GitHub Repository: Ryan778/Ryan778.github.io
Path: blob/master/emojionearea/src/function/unicodeTo.js
575 views
1
define([
2
'var/emojione',
3
'var/uniRegexp',
4
'var/emojioneSupportMode',
5
'function/getTemplate'
6
],
7
function(emojione, uniRegexp, emojioneSupportMode, getTemplate) {
8
return function(str, template) {
9
return str.replace(uniRegexp, function(unicodeChar) {
10
var map = emojione[(emojioneSupportMode === 0 ? 'jsecapeMap' : 'jsEscapeMap')];
11
if (typeof unicodeChar !== 'undefined' && unicodeChar in map) {
12
return getTemplate(template, map[unicodeChar]);
13
}
14
return unicodeChar;
15
});
16
}
17
});
18