Follow-up Comment #8, bug #60602 (project groff):

> Excellent!  Except...maybe my JS environment is too old? 

`Array.prototype.flat` was only added to the ECMAScript spec in 2019, so it's
possible your version of Node.js is outdated. If your distro's lagging behind
(i.e., upgrading doesn't help), you can add this to the top of the script to
polyfill the missing method:


if("function" !== typeof [].flat)
        Array.prototype.flat = function(depth = 1){
                const {forEach} = this;
                const results = [];
                const fn = (obj, depth) =>
                        forEach.call(obj, x => depth > 0 && Array.isArray(x)
                                ? fn(x, depth - 1)
                                : results.push(x));
                fn(this, depth);
                return results;
        };


> but you might try the archives of the TUHS list.

Thanks! I'll have a poke around.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?60602>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/


Reply via email to