In the course of working with a few scripts, I've noticed many Js
language features I've come to rely on tend to be missing.
For example: Object.(entries|keys|values) and
Array.protype.(find|filter) etc.
The core-js polyfill library does seem to load without any issues into
the platform. How would everyone feel about including it so that it can
be available to everyone closer to in the box?
Where to download the built+minified version https://cdnjs.com/libraries/core-js
The source library.
https://github.com/zloirock/core-js
Note: this is pretty much the core of babel support for legacy browsers, it's been pretty useful in Synchronet as well. It does include some polyfills for ES5 that are already built in, but since some behaviors
change slightly with ES6 it's best to include them all in practice, shouldn't be anything that anyone notices though.
For example, instead of something like...
 var newsgroups = hdr.newsgroups.split(',');
 for(n in newsgroups)
 for(g in msg_area.grp_list)
 for(s in msg_area.grp_list[g].sub_list)
   if (
     msg_area.grp_list[g].sub_list[s].newsgroup.toLowerCase()
     == newsgroups[n].toLowerCase()
 ) {
   ... msg_area.grp_list[g].sub_list[s] ...
 }
You could do...
 var newsgroups = hdr.newsgroups.split(',');
 Object.values(msg_area.sub)
   .filter(function(sub) {
     return newsgroups.includes(sub.newsgroup.toLowerCase());
   })
   .foreach(function(sub) {
      ... sub ...
   });
Of course an updated spidermonkey would allow this to be...
 var newsgroups = hdr.newsgroups.split(',');
 Object.values(msg_area.sub)
   .filter(sub => newsgroups.includes(sub.newsgroup.toLowerCase())
   .foreach(sub => {
      ... sub ...
   });
Sysop: | digital man |
---|---|
Location: | Riverside County, California |
Users: | 1,045 |
Nodes: | 15 (0 / 15) |
Uptime: | 09:44:21 |
Calls: | 500,414 |
Calls today: | 17 |
Files: | 95,209 |
D/L today: |
15,085 files (18,537M bytes) |
Messages: | 465,141 |
Posted today: | 7 |