Consolidate docs and finalize APK companion updates
This commit is contained in:
31
dewemoji-capacitor/www/twemoji-lite.js
Normal file
31
dewemoji-capacitor/www/twemoji-lite.js
Normal file
@@ -0,0 +1,31 @@
|
||||
(() => {
|
||||
const root = window;
|
||||
if (root?.twemoji?.convert?.toCodePoint) return;
|
||||
|
||||
function toCodePoint(unicodeSurrogates, sep = '-') {
|
||||
const r = [];
|
||||
let c = 0;
|
||||
let p = 0;
|
||||
let i = 0;
|
||||
const s = String(unicodeSurrogates || '');
|
||||
|
||||
while (i < s.length) {
|
||||
c = s.charCodeAt(i++);
|
||||
if (p) {
|
||||
r.push((0x10000 + ((p - 0xD800) * 0x400) + (c - 0xDC00)).toString(16));
|
||||
p = 0;
|
||||
} else if (c >= 0xD800 && c <= 0xDBFF) {
|
||||
p = c;
|
||||
} else {
|
||||
r.push(c.toString(16));
|
||||
}
|
||||
}
|
||||
|
||||
return r.join(sep);
|
||||
}
|
||||
|
||||
root.twemoji = root.twemoji || {};
|
||||
root.twemoji.convert = root.twemoji.convert || {};
|
||||
root.twemoji.convert.toCodePoint = toCodePoint;
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user