mirror of
https://github.com/flynx/colors.js.git
synced 2025-10-29 19:10:10 +00:00
Remove another dynamic require and add similar deprecation notice
This commit is contained in:
parent
a8ce90c51c
commit
2894751d40
@ -91,14 +91,14 @@ module['exports'] = function() {
|
|||||||
|
|
||||||
colors.setTheme = function(theme) {
|
colors.setTheme = function(theme) {
|
||||||
if (typeof theme === 'string') {
|
if (typeof theme === 'string') {
|
||||||
try {
|
console.log('colors.setTheme now only accepts an object, not a string. ' +
|
||||||
colors.themes[theme] = require(theme);
|
'If you are trying to set a theme from a file, it is now your (the ' +
|
||||||
applyTheme(colors.themes[theme]);
|
'caller\'s) responsibility to require the file. The old syntax ' +
|
||||||
return colors.themes[theme];
|
'looked like colors.setTheme(__dirname + ' +
|
||||||
} catch (err) {
|
'\'/../themes/generic-logging.js\'); The new syntax looks like '+
|
||||||
console.log(err);
|
'colors.setTheme(require(__dirname + ' +
|
||||||
return err;
|
'\'/../themes/generic-logging.js\'));');
|
||||||
}
|
return;
|
||||||
} else {
|
} else {
|
||||||
applyTheme(theme);
|
applyTheme(theme);
|
||||||
}
|
}
|
||||||
|
|||||||
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "colors",
|
"name": "colors",
|
||||||
"version": "1.2.2",
|
"version": "1.3.0",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "colors",
|
"name": "colors",
|
||||||
"description": "get colors in your node.js console",
|
"description": "get colors in your node.js console",
|
||||||
"version": "1.2.5",
|
"version": "1.3.0",
|
||||||
"author": "Marak Squires",
|
"author": "Marak Squires",
|
||||||
"homepage": "https://github.com/Marak/colors.js",
|
"homepage": "https://github.com/Marak/colors.js",
|
||||||
"bugs": "https://github.com/Marak/colors.js/issues",
|
"bugs": "https://github.com/Marak/colors.js/issues",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user