pack()

in Server/nodejs/app_token_options.js [12:32]


    pack() {
        let buf = new ByteBuffer(0)
        let hasEngineOptions = this.engineOptions !== null

        buf.writeBool(hasEngineOptions)
        if (hasEngineOptions) {
            const engineOptionsEntries = Object.entries(this.engineOptions).sort();
            buf.writeInt32(engineOptionsEntries.length)
            
            for (const [key, value] of engineOptionsEntries) {
                if (key == null || value == null) {
                    throw new Error('Illegal engineOptions entry');
                }

                buf.writeString(key);
                buf.writeString(value);
            }
        }

        return buf.getvalue(true)
    }