@sutton-signwriting/unicode8
Version:
a javascript package for processing SignWriting in Unicode 8 (uni8) characters
3 lines (2 loc) • 1.08 kB
JavaScript
/* Sutton SignWriting Unicode 8 Module v1.2.0 (https://github.com/sutton-signwriting/unicode8), author: Steve Slevinski (https://SteveSlevinski.me), sponsor: https://patreon.com/signwriting, donate: https://donate.sutton-signwriting.io, license: MIT */
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports):"function"==typeof define&&define.amd?define(["exports"],o):o(((e="undefined"!=typeof globalThis?globalThis:e||self).ssw=e.ssw||{},e.ssw.unicode8=e.ssw.unicode8||{},e.ssw.unicode8.symbol={}))}(this,(function(e){"use strict";let o={base:"(?:\ud836[\udc00-\ude8b])",fill:"(?:\ud836[\ude9b-\ude9f])",rotation:"(?:\ud836[\udea1-\udeaf])"};o.full=`(${o.base})(${o.fill})?(${o.rotation})?`;e.compose=e=>{if("object"!=typeof e||null===e)return;const o=(e.base?e.base:"")+(e.fill?e.fill:"")+(e.rotation?e.rotation:"");return o||void 0},e.parse=e=>{const t=`^${o.full}`,i=("string"==typeof e?e.match(new RegExp(t)):[])||[];return{base:i[1]?i[1]:void 0,fill:i[2]?i[2]:void 0,rotation:i[3]?i[3]:void 0}},e.re=o,Object.defineProperty(e,"__esModule",{value:!0})}));