Overview
Comment: | [core][js] str_transform as object |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | core | webext |
Files: | files | file ages | folders |
SHA3-256: |
856cdd76cb24da050cbd699219ed3518 |
User & Date: | olr on 2017-07-29 09:25:01 |
Other Links: | branch diff | manifest | tags |
Context
2017-07-29
| ||
09:30 | [core][js] text as object check-in: df0f360e7e user: olr tags: core, webext | |
09:25 | [core][js] str_transform as object check-in: 856cdd76cb user: olr tags: core, webext | |
09:13 | [core][js] helpers as object check-in: a5d2fe7405 user: olr tags: core, webext | |
Changes
Modified gc_core/js/str_transform.js from [0fafeda9a5] to [2b77b3d6d8].
1 2 | //// STRING TRANSFORMATION | | < < < < < < < < < < < < < < < < < < < < < < < < < < < < | > | < | | | | | > | < | | | | | | | | | > | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | //// STRING TRANSFORMATION // Note: 48 is the ASCII code for "0" const str_transform = { getStemFromSuffixCode: function (sFlex, sSfxCode) { // Suffix only if (sSfxCode == "0") { return sFlex; } return sSfxCode[0] == '0' ? sFlex + sSfxCode.slice(1) : sFlex.slice(0, -(sSfxCode.charCodeAt(0)-48)) + sSfxCode.slice(1); }, getStemFromAffixCode: function (sFlex, sAffCode) { // Prefix and suffix if (sAffCode == "0") { return sFlex; } if (!sAffCode.includes("/")) { return "# error #"; } let [sPfxCode, sSfxCode] = sAffCode.split('/'); sFlex = sPfxCode.slice(1) + sFlex.slice(sPfxCode.charCodeAt(0)-48); return sSfxCode[0] == '0' ? sFlex + sSfxCode.slice(1) : sFlex.slice(0, -(sSfxCode.charCodeAt(0)-48)) + sSfxCode.slice(1); } } if (typeof(exports) !== 'undefined') { exports.getStemFromSuffixCode = str_transform.getStemFromSuffixCode; exports.getStemFromAffixCode = str_transform.getStemFromAffixCode; } |