function encloseHyphenateFunction(baseData, hyphenateFunc) {
            /* eslint-disable no-bitwise */
            var heapBuffer = H.cf.wasm
                ? baseData.wasmMemory.buffer
                : baseData.heapBuffer;
            var wordStore = (new Uint16Array(heapBuffer)).subarray(
                baseData.wo >> 1,
                (baseData.wo >> 1) + 64
            );
            var hydWrdStore = (new Uint16Array(heapBuffer)).subarray(
                baseData.hw >> 1,
                (baseData.hw >> 1) + 128
            );
            /* eslint-enable no-bitwise */
            wordStore[0] = 95;
            return function enclHyphenate(word, hyphencc, leftmin, rightmin) {
                var i = 0;
                var cc = 0;
                do {
                    cc = word.charCodeAt(i);
                    i += 1;
                    // eslint-disable-next-line security/detect-object-injection
                    wordStore[i] = cc;
                } while (cc);
                /* eslint-disable security/detect-object-injection */
                wordStore[i] = 95;
                wordStore[i + 1] = 0;
                /* eslint-enable security/detect-object-injection */
                if (hyphenateFunc(leftmin, rightmin, hyphencc) === 1) {
                    word = decode(hydWrdStore.subarray(1, hydWrdStore[0] + 1));
                }
                return word;
            };
        }
Setup env for hyphenateFunction
@param {Object} baseData baseData
@param {function} hyphenateFunc hyphenateFunction
@returns {function} hyphenateFunction with closured environment