liferay-npm-build-tools-common
Advanced tools
+26
-0
@@ -131,2 +131,28 @@ 'use strict'; | ||
| } | ||
| /** | ||
| * Test if there are warn messages. | ||
| * @return {boolean} if at least one warn message is registered in the logger | ||
| */ | ||
| }, { | ||
| key: 'warnsPresent', | ||
| get: function get() { | ||
| return this._msgs.filter(function (msg) { | ||
| return msg.level === 'warn'; | ||
| }).length > 0; | ||
| } | ||
| /** | ||
| * Test if there are error messages. | ||
| * @return {boolean} if at least one error message is registered in the logger | ||
| */ | ||
| }, { | ||
| key: 'errorsPresent', | ||
| get: function get() { | ||
| return this._msgs.filter(function (msg) { | ||
| return msg.level === 'error'; | ||
| }).length > 0; | ||
| } | ||
| }]); | ||
@@ -133,0 +159,0 @@ |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../src/plugin-logger.js"],"names":["PluginLogger","_msgs","source","things","push","level","reduce","str","join"],"mappings":";;;;;;;;;;AAAA;;;;IAIqBA,Y;AACpB;;;AAGA,yBAAc;AAAA;;AACb,OAAKC,KAAL,GAAa,EAAb;AACA;;AAED;;;;;;;;;;uBAMKC,M,EAAmB;AAAA,qCAARC,MAAQ;AAARA,UAAQ;AAAA;;AACvB,QAAKF,KAAL,CAAWG,IAAX,CAAgB;AACfF,YAAQA,MADO;AAEfG,WAAO,MAFQ;AAGfF,YAAQA;AAHO,IAAhB;AAKA;;AAED;;;;;;;;;uBAMKD,M,EAAmB;AAAA,sCAARC,MAAQ;AAARA,UAAQ;AAAA;;AACvB,QAAKF,KAAL,CAAWG,IAAX,CAAgB;AACfF,YAAQA,MADO;AAEfG,WAAO,MAFQ;AAGfF,YAAQA;AAHO,IAAhB;AAKA;;AAED;;;;;;;;;wBAMMD,M,EAAmB;AAAA,sCAARC,MAAQ;AAARA,UAAQ;AAAA;;AACxB,QAAKF,KAAL,CAAWG,IAAX,CAAgB;AACfF,YAAQA,MADO;AAEfG,WAAO,OAFQ;AAGfF,YAAQA;AAHO,IAAhB;AAKA;;AAED;;;;;;;;;AAQA;;;;6BAIW;AACV,UAAO,KAAKF,KAAL,CAAWK,MAAX,CACN,UAACC,GAAD;AAAA,QAAOL,MAAP,QAAOA,MAAP;AAAA,QAAeG,KAAf,QAAeA,KAAf;AAAA,QAAsBF,MAAtB,QAAsBA,MAAtB;AAAA,gBACII,GADJ,GACUL,MADV,SACoBG,KADpB,UAC8BF,OAAOK,IAAP,CAAY,GAAZ,CAD9B;AAAA,IADM,EAGN,EAHM,CAAP;AAKA;;AAED;;;;;;;2BAIS;AACR,UAAO,KAAKP,KAAL,CAAWK,MAAX,CACN,UAACC,GAAD;AAAA,QAAOL,MAAP,SAAOA,MAAP;AAAA,QAAeG,KAAf,SAAeA,KAAf;AAAA,QAAsBF,MAAtB,SAAsBA,MAAtB;AAAA,gBACII,GADJ,GACUL,MADV,SACoBG,KADpB,UAC8BF,OAAOK,IAAP,CAAY,GAAZ,CAD9B;AAAA,IADM,EAGN,EAHM,CAAP;AAKA;;;sBA1Bc;AACd,UAAO,KAAKP,KAAZ;AACA;;;;;;kBAxDmBD,Y","file":"plugin-logger.js","sourcesContent":["/**\n * An object to hold babel or liferay-npm-bundler plugin messages.\n * @type {PluginLogger}\n */\nexport default class PluginLogger {\n\t/**\n\t * Construct empty logger with no messages\n\t */\n\tconstructor() {\n\t\tthis._msgs = [];\n\t}\n\n\t/**\n\t * Log an informational message\n\t * @param {String} source the identifier for the source of the message\n\t * @param {Array} things the objects or strings to print\n\t * @return {void}\n\t */\n\tinfo(source, ...things) {\n\t\tthis._msgs.push({\n\t\t\tsource: source,\n\t\t\tlevel: 'info',\n\t\t\tthings: things,\n\t\t});\n\t}\n\n\t/**\n\t * Log a warn message\n\t * @param {String} source the identifier for the source of the message\n\t * @param {Array} things the objects or strings to print\n\t * @return {void}\n\t */\n\twarn(source, ...things) {\n\t\tthis._msgs.push({\n\t\t\tsource: source,\n\t\t\tlevel: 'warn',\n\t\t\tthings: things,\n\t\t});\n\t}\n\n\t/**\n\t * Log an error message\n\t * @param {String} source the identifier for the source of the message\n\t * @param {Array} things the objects or strings to print\n\t * @return {void}\n\t */\n\terror(source, ...things) {\n\t\tthis._msgs.push({\n\t\t\tsource: source,\n\t\t\tlevel: 'error',\n\t\t\tthings: things,\n\t\t});\n\t}\n\n\t/**\n\t * Get the list of messages\n\t * @return {Array} an array containing one object per messages (with fields: source, level and things)\n\t */\n\tget messages() {\n\t\treturn this._msgs;\n\t}\n\n\t/**\n\t * Return a printable string representation of the messages logged till now\n\t * @return {String} a string containing one line per message\n\t */\n\ttoString() {\n\t\treturn this._msgs.reduce(\n\t\t\t(str, {source, level, things}) =>\n\t\t\t\t`${str}${source}:${level}: ${things.join(' ')}\\n`,\n\t\t\t''\n\t\t);\n\t}\n\n\t/**\n\t * Return an HTML string representation of the messages logged till now\n\t * @return {String} HTML containing one line (<br> separated) per message\n\t */\n\ttoHtml() {\n\t\treturn this._msgs.reduce(\n\t\t\t(str, {source, level, things}) =>\n\t\t\t\t`${str}${source}:${level}: ${things.join(' ')}<br>`,\n\t\t\t''\n\t\t);\n\t}\n}\n"]} | ||
| {"version":3,"sources":["../src/plugin-logger.js"],"names":["PluginLogger","_msgs","source","things","push","level","reduce","str","join","filter","msg","length"],"mappings":";;;;;;;;;;AAAA;;;;IAIqBA,Y;AACpB;;;AAGA,yBAAc;AAAA;;AACb,OAAKC,KAAL,GAAa,EAAb;AACA;;AAED;;;;;;;;;;uBAMKC,M,EAAmB;AAAA,qCAARC,MAAQ;AAARA,UAAQ;AAAA;;AACvB,QAAKF,KAAL,CAAWG,IAAX,CAAgB;AACfF,YAAQA,MADO;AAEfG,WAAO,MAFQ;AAGfF,YAAQA;AAHO,IAAhB;AAKA;;AAED;;;;;;;;;uBAMKD,M,EAAmB;AAAA,sCAARC,MAAQ;AAARA,UAAQ;AAAA;;AACvB,QAAKF,KAAL,CAAWG,IAAX,CAAgB;AACfF,YAAQA,MADO;AAEfG,WAAO,MAFQ;AAGfF,YAAQA;AAHO,IAAhB;AAKA;;AAED;;;;;;;;;wBAMMD,M,EAAmB;AAAA,sCAARC,MAAQ;AAARA,UAAQ;AAAA;;AACxB,QAAKF,KAAL,CAAWG,IAAX,CAAgB;AACfF,YAAQA,MADO;AAEfG,WAAO,OAFQ;AAGfF,YAAQA;AAHO,IAAhB;AAKA;;AAED;;;;;;;;;AAwBA;;;;6BAIW;AACV,UAAO,KAAKF,KAAL,CAAWK,MAAX,CACN,UAACC,GAAD;AAAA,QAAOL,MAAP,QAAOA,MAAP;AAAA,QAAeG,KAAf,QAAeA,KAAf;AAAA,QAAsBF,MAAtB,QAAsBA,MAAtB;AAAA,gBACII,GADJ,GACUL,MADV,SACoBG,KADpB,UAC8BF,OAAOK,IAAP,CAAY,GAAZ,CAD9B;AAAA,IADM,EAGN,EAHM,CAAP;AAKA;;AAED;;;;;;;2BAIS;AACR,UAAO,KAAKP,KAAL,CAAWK,MAAX,CACN,UAACC,GAAD;AAAA,QAAOL,MAAP,SAAOA,MAAP;AAAA,QAAeG,KAAf,SAAeA,KAAf;AAAA,QAAsBF,MAAtB,SAAsBA,MAAtB;AAAA,gBACII,GADJ,GACUL,MADV,SACoBG,KADpB,UAC8BF,OAAOK,IAAP,CAAY,GAAZ,CAD9B;AAAA,IADM,EAGN,EAHM,CAAP;AAKA;;;sBA1Cc;AACd,UAAO,KAAKP,KAAZ;AACA;;AAED;;;;;;;sBAImB;AAClB,UAAO,KAAKA,KAAL,CAAWQ,MAAX,CAAkB;AAAA,WAAOC,IAAIL,KAAJ,KAAc,MAArB;AAAA,IAAlB,EAA+CM,MAA/C,GAAwD,CAA/D;AACA;;AAED;;;;;;;sBAIoB;AACnB,UAAO,KAAKV,KAAL,CAAWQ,MAAX,CAAkB;AAAA,WAAOC,IAAIL,KAAJ,KAAc,OAArB;AAAA,IAAlB,EAAgDM,MAAhD,GAAyD,CAAhE;AACA;;;;;;kBAxEmBX,Y","file":"plugin-logger.js","sourcesContent":["/**\n * An object to hold babel or liferay-npm-bundler plugin messages.\n * @type {PluginLogger}\n */\nexport default class PluginLogger {\n\t/**\n\t * Construct empty logger with no messages\n\t */\n\tconstructor() {\n\t\tthis._msgs = [];\n\t}\n\n\t/**\n\t * Log an informational message\n\t * @param {String} source the identifier for the source of the message\n\t * @param {Array} things the objects or strings to print\n\t * @return {void}\n\t */\n\tinfo(source, ...things) {\n\t\tthis._msgs.push({\n\t\t\tsource: source,\n\t\t\tlevel: 'info',\n\t\t\tthings: things,\n\t\t});\n\t}\n\n\t/**\n\t * Log a warn message\n\t * @param {String} source the identifier for the source of the message\n\t * @param {Array} things the objects or strings to print\n\t * @return {void}\n\t */\n\twarn(source, ...things) {\n\t\tthis._msgs.push({\n\t\t\tsource: source,\n\t\t\tlevel: 'warn',\n\t\t\tthings: things,\n\t\t});\n\t}\n\n\t/**\n\t * Log an error message\n\t * @param {String} source the identifier for the source of the message\n\t * @param {Array} things the objects or strings to print\n\t * @return {void}\n\t */\n\terror(source, ...things) {\n\t\tthis._msgs.push({\n\t\t\tsource: source,\n\t\t\tlevel: 'error',\n\t\t\tthings: things,\n\t\t});\n\t}\n\n\t/**\n\t * Get the list of messages\n\t * @return {Array} an array containing one object per messages (with fields: source, level and things)\n\t */\n\tget messages() {\n\t\treturn this._msgs;\n\t}\n\n\t/**\n\t * Test if there are warn messages.\n\t * @return {boolean} if at least one warn message is registered in the logger\n\t */\n\tget warnsPresent() {\n\t\treturn this._msgs.filter(msg => msg.level === 'warn').length > 0;\n\t}\n\n\t/**\n\t * Test if there are error messages.\n\t * @return {boolean} if at least one error message is registered in the logger\n\t */\n\tget errorsPresent() {\n\t\treturn this._msgs.filter(msg => msg.level === 'error').length > 0;\n\t}\n\n\t/**\n\t * Return a printable string representation of the messages logged till now\n\t * @return {String} a string containing one line per message\n\t */\n\ttoString() {\n\t\treturn this._msgs.reduce(\n\t\t\t(str, {source, level, things}) =>\n\t\t\t\t`${str}${source}:${level}: ${things.join(' ')}\\n`,\n\t\t\t''\n\t\t);\n\t}\n\n\t/**\n\t * Return an HTML string representation of the messages logged till now\n\t * @return {String} HTML containing one line (<br> separated) per message\n\t */\n\ttoHtml() {\n\t\treturn this._msgs.reduce(\n\t\t\t(str, {source, level, things}) =>\n\t\t\t\t`${str}${source}:${level}: ${things.join(' ')}<br>`,\n\t\t\t''\n\t\t);\n\t}\n}\n"]} |
+1
-1
| { | ||
| "name": "liferay-npm-build-tools-common", | ||
| "version": "1.7.0-alpha.2956f206", | ||
| "version": "1.7.0-alpha.37376d14", | ||
| "description": "Utility library for Liferay NPM Build Tools.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
+16
-0
@@ -64,2 +64,18 @@ /** | ||
| /** | ||
| * Test if there are warn messages. | ||
| * @return {boolean} if at least one warn message is registered in the logger | ||
| */ | ||
| get warnsPresent() { | ||
| return this._msgs.filter(msg => msg.level === 'warn').length > 0; | ||
| } | ||
| /** | ||
| * Test if there are error messages. | ||
| * @return {boolean} if at least one error message is registered in the logger | ||
| */ | ||
| get errorsPresent() { | ||
| return this._msgs.filter(msg => msg.level === 'error').length > 0; | ||
| } | ||
| /** | ||
| * Return a printable string representation of the messages logged till now | ||
@@ -66,0 +82,0 @@ * @return {String} a string containing one line per message |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
126453
1.43%1974
1.86%