Skip to content
Merged

Pro #36

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "malta",
"version": "4.2.5",
"version": "4.2.7",
"description": "Lightning builder allows to compose on the fly and update packed and full coded huge files, edit its parts as files, splitted and glued as You need.",
"main": "src/index.js",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions src/colors.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ module.exports = {
blue: s => conc(34, s),
magenta: s => conc(35, s),
cyan: s => conc(36, s),
darkcyan: s => conc(36, s),
lightgray: s => conc(37, s),
darkgray: s => conc(90, s),
lightred: s => conc(91, s),
Expand Down
3 changes: 1 addition & 2 deletions src/docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
Changelog
---------
- **v4.2.5**
- **v4.2.7**
- **Security**: removed all eval calls from the core. jsonFromStr now uses a safe manual parser; microTpl runs inside an isolated vm context; replace_calc returns content without executing it.
- **Robustness**: removed all internal process.exit calls. Build, plugin, and child-process errors are now propagated or logged without killing the Node process.
- **Performance**: replaced the file watcher from polling (setInterval + fs.statSync) to event-driven fs.watch, with a lightweight periodic refresh for new files.
- **Quality**: removed stringproto.js (String.prototype pollution) and introduced the colors.js utility module for console coloring.
- **Maintainability**: updated engines.node to >=18.0.0, aligned with actual devDependency requirements. Added hasOwnProperty checks to all for...in loops.
- **Coverage**: raised code coverage

Expand Down
41 changes: 36 additions & 5 deletions src/stringproto.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,47 @@
const colors = require('./colors');

const methods = {
white: colors.white,
normal: colors.normal,
darken: colors.darken,
italic: colors.italic,
underline: colors.underline,
blink: colors.blink,
invert: colors.invert,
gray: colors.gray,
red: colors.red,
green: colors.green,
yellow: colors.yellow,
gray: colors.gray,
darkgray: colors.darkgray,
blue: colors.blue,
magenta: colors.magenta,
cyan: colors.cyan,
darkcyan: colors.darkcyan,
underline: colors.underline,
rainbow: colors.rainbow
lightgray: colors.lightgray,
darkgray: colors.darkgray,
lightred: colors.lightred,
lightgreen: colors.lightgreen,
lightyellow: colors.lightyellow,
lightblue: colors.lightblue,
lightmagenta: colors.lightmagenta,
lightcyan: colors.lightcyan,
white: colors.white,
rainbow: colors.rainbow,
bgblack: colors.bgblack,
bgred: colors.bgred,
bggreen: colors.bggreen,
bgyellow: colors.bgyellow,
bgblue: colors.bgblue,
bgmagenta: colors.bgmagenta,
bgcyan: colors.bgcyan,
bglightgray: colors.bglightgray,
bgdefault: colors.bgdefault,
bgdarkgray: colors.bgdarkgray,
bglightred: colors.bglightred,
bglightgreen: colors.bglightgreen,
bglightyellow: colors.bglightyellow,
bglightblue: colors.bglightblue,
bglightmagenta: colors.bglightmagenta,
bglightcyan: colors.bglightcyan,
bgwhite: colors.bgwhite
};

for (const name in methods) {
Expand Down
Loading