@ematipico/js-performance
Advanced tools
@@ -1,1 +0,1 @@ | ||
| "use strict";function internalStart(r){var e=r+"-"+START;labels[r]={start:e},performance.mark(e)}function internalEnd(r){var e=r+"-"+STOP;labels[r].stop=e,performance.mark(e)}function giveMeAllMarkers(){for(var r in labels){var e=labels[r],t=e.start,n=e.stop;try{performance.measure(r,t,n)}catch(r){throw new Error("JS Performance is trying access to marker that does not exist")}}for(var a=[],o=performance.getEntriesByType("measure"),s=Array.isArray(o),i=0,o=s?o:o[Symbol.iterator]();;){var c;if(s){if(i>=o.length)break;c=o[i++]}else{if((i=o.next()).done)break;c=i.value}var u=c;a.push(new Marker({name:u.name,duration:u.duration}))}return a}function clearMarkers(){labels={},performance.clearMarks(),performance.clearMeasures()}function recordingStart(){clearMarkers(),start=internalStart,stop=internalEnd}function recordingStop(){start=function(){},stop=function(){}}function getMeasures(){giveMeAllMarkers().map(function(r){return{"Operation name":r.name,"Duration (ms)":r.duration}})}function log(r){}function allowed(){return"undefined"!=typeof window}function precise(){return void 0!==window.performance}function support(){var r="";allowed()&&(r=precise()?"Your browser support the User Timing API. The measures will be precise!":"Your browser does not support the User Timing API. The measures will not be precise"),log(r)}function startRecording(){recordingStart()}function stopRecording(){recordingStop()}function allMeasures(){getMeasures()}function startMark(r){start(r)}function endMark(r){stop(r)}function checkSupport(){support()}Object.defineProperty(exports,"__esModule",{value:!0});var START="START",STOP="STOP",classCallCheck=function(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")},createClass=function(){function r(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Marker=function(){function r(e){var t=e.name,n=e.duration;classCallCheck(this,r),this.name=t,this.duration=n}return createClass(r,[{key:"info",get:function(){return{name:this.name,duratino:this.duration}},set:function(r){var e=r.name,t=r.duration;this.name=e,this.duration=t}}]),r}(),labels={},start=function(){},stop=function(){};exports.startRecording=startRecording,exports.stopRecording=stopRecording,exports.allMeasures=allMeasures,exports.startMark=startMark,exports.endMark=endMark,exports.checkSupport=checkSupport; | ||
| "use strict";function internalStart(r){var e=r+"-"+START;labels[r]={start:e},performance.mark(e)}function internalEnd(r){var e=r+"-"+STOP;labels[r].stop=e,performance.mark(e)}function giveMeAllMarkers(){for(var r in labels){var e=labels[r],t=e.start,n=e.stop;try{performance.measure(r,t,n)}catch(r){throw new Error("JS Performance is trying access to marker that does not exist")}}for(var a=[],o=performance.getEntriesByType("measure"),s=Array.isArray(o),i=0,o=s?o:o[Symbol.iterator]();;){var c;if(s){if(i>=o.length)break;c=o[i++]}else{if((i=o.next()).done)break;c=i.value}var u=c;a.push(new Marker({name:u.name,duration:u.duration}))}return a}function clearMarkers(){labels={},performance.clearMarks(),performance.clearMeasures()}function recordingStart(){clearMarkers(),start=internalStart,stop=internalEnd}function recordingStop(){start=function(){},stop=function(){}}function getMeasures(){giveMeAllMarkers().map(function(r){return{"Operation name":r.name,"Duration (ms)":r.duration}})}function allowed(){return"undefined"!=typeof window}function precise(){return void 0!==window.performance}function support(){allowed()&&precise()}function startRecording(){recordingStart()}function stopRecording(){recordingStop()}function allMeasures(){getMeasures()}function startMark(r){start(r)}function endMark(r){stop(r)}function checkSupport(){return support()}Object.defineProperty(exports,"__esModule",{value:!0});var START="START",STOP="STOP",classCallCheck=function(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")},createClass=function(){function r(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Marker=function(){function r(e){var t=e.name,n=e.duration;classCallCheck(this,r),this.name=t,this.duration=n}return createClass(r,[{key:"info",get:function(){return{name:this.name,duratino:this.duration}},set:function(r){var e=r.name,t=r.duration;this.name=e,this.duration=t}}]),r}(),labels={},start=function(){},stop=function(){};exports.startRecording=startRecording,exports.stopRecording=stopRecording,exports.allMeasures=allMeasures,exports.startMark=startMark,exports.endMark=endMark,exports.checkSupport=checkSupport; |
@@ -1,1 +0,1 @@ | ||
| function internalStart(r){var e=r+"-"+START;labels[r]={start:e},performance.mark(e)}function internalEnd(r){var e=r+"-"+STOP;labels[r].stop=e,performance.mark(e)}function giveMeAllMarkers(){for(var r in labels){var e=labels[r],n=e.start,t=e.stop;try{performance.measure(r,n,t)}catch(r){throw new Error("JS Performance is trying access to marker that does not exist")}}for(var a=[],o=performance.getEntriesByType("measure"),i=Array.isArray(o),s=0,o=i?o:o[Symbol.iterator]();;){var u;if(i){if(s>=o.length)break;u=o[s++]}else{if((s=o.next()).done)break;u=s.value}var c=u;a.push(new Marker({name:c.name,duration:c.duration}))}return a}function clearMarkers(){labels={},performance.clearMarks(),performance.clearMeasures()}function recordingStart(){clearMarkers(),start=internalStart,stop=internalEnd}function recordingStop(){start=function(){},stop=function(){}}function getMeasures(){giveMeAllMarkers().map(function(r){return{"Operation name":r.name,"Duration (ms)":r.duration}})}function log(r){}function allowed(){return"undefined"!=typeof window}function precise(){return void 0!==window.performance}function support(){var r="";allowed()&&(r=precise()?"Your browser support the User Timing API. The measures will be precise!":"Your browser does not support the User Timing API. The measures will not be precise"),log(r)}function startRecording(){recordingStart()}function stopRecording(){recordingStop()}function allMeasures(){getMeasures()}function startMark(r){start(r)}function endMark(r){stop(r)}function checkSupport(){support()}var START="START",STOP="STOP",classCallCheck=function(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")},createClass=function(){function r(r,e){for(var n=0;n<e.length;n++){var t=e[n];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(r,t.key,t)}}return function(e,n,t){return n&&r(e.prototype,n),t&&r(e,t),e}}(),Marker=function(){function r(e){var n=e.name,t=e.duration;classCallCheck(this,r),this.name=n,this.duration=t}return createClass(r,[{key:"info",get:function(){return{name:this.name,duratino:this.duration}},set:function(r){var e=r.name,n=r.duration;this.name=e,this.duration=n}}]),r}(),labels={},start=function(){},stop=function(){};export{startRecording,stopRecording,allMeasures,startMark,endMark,checkSupport}; | ||
| function internalStart(r){var n=r+"-"+START;labels[r]={start:n},performance.mark(n)}function internalEnd(r){var n=r+"-"+STOP;labels[r].stop=n,performance.mark(n)}function giveMeAllMarkers(){for(var r in labels){var n=labels[r],e=n.start,t=n.stop;try{performance.measure(r,e,t)}catch(r){throw new Error("JS Performance is trying access to marker that does not exist")}}for(var a=[],o=performance.getEntriesByType("measure"),i=Array.isArray(o),s=0,o=i?o:o[Symbol.iterator]();;){var c;if(i){if(s>=o.length)break;c=o[s++]}else{if((s=o.next()).done)break;c=s.value}var u=c;a.push(new Marker({name:u.name,duration:u.duration}))}return a}function clearMarkers(){labels={},performance.clearMarks(),performance.clearMeasures()}function recordingStart(){clearMarkers(),start=internalStart,stop=internalEnd}function recordingStop(){start=function(){},stop=function(){}}function getMeasures(){giveMeAllMarkers().map(function(r){return{"Operation name":r.name,"Duration (ms)":r.duration}})}function allowed(){return"undefined"!=typeof window}function precise(){return void 0!==window.performance}function support(){allowed()&&precise()}function startRecording(){recordingStart()}function stopRecording(){recordingStop()}function allMeasures(){getMeasures()}function startMark(r){start(r)}function endMark(r){stop(r)}function checkSupport(){return support()}var START="START",STOP="STOP",classCallCheck=function(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")},createClass=function(){function r(r,n){for(var e=0;e<n.length;e++){var t=n[e];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(r,t.key,t)}}return function(n,e,t){return e&&r(n.prototype,e),t&&r(n,t),n}}(),Marker=function(){function r(n){var e=n.name,t=n.duration;classCallCheck(this,r),this.name=e,this.duration=t}return createClass(r,[{key:"info",get:function(){return{name:this.name,duratino:this.duration}},set:function(r){var n=r.name,e=r.duration;this.name=n,this.duration=e}}]),r}(),labels={},start=function(){},stop=function(){};export{startRecording,stopRecording,allMeasures,startMark,endMark,checkSupport}; |
@@ -1,1 +0,1 @@ | ||
| !function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(n.JSPerf=n.JSPerf||{})}(this,function(n){"use strict";function e(n){var e=n+"-"+b;P[n]={start:e},performance.mark(e)}function r(n){var e=n+"-"+w;P[n].stop=e,performance.mark(e)}function t(){for(var n in P){var e=P[n],r=e.start,t=e.stop;try{performance.measure(n,r,t)}catch(n){throw new Error("JS Performance is trying access to marker that does not exist")}}for(var o=[],i=performance.getEntriesByType("measure"),a=Array.isArray(i),u=0,i=a?i:i[Symbol.iterator]();;){var f;if(a){if(u>=i.length)break;f=i[u++]}else{if((u=i.next()).done)break;f=u.value}var c=f;o.push(new T({name:c.name,duration:c.duration}))}return o}function o(){P={},performance.clearMarks(),performance.clearMeasures()}function i(){o(),S=e,M=r}function a(){S=function(){},M=function(){}}function u(){t().map(function(n){return{"Operation name":n.name,"Duration (ms)":n.duration}})}function f(n){}function c(){return"undefined"!=typeof window}function s(){return void 0!==window.performance}function m(){var n="";c()&&(n=s()?"Your browser support the User Timing API. The measures will be precise!":"Your browser does not support the User Timing API. The measures will not be precise"),f(n)}function p(){i()}function d(){a()}function l(){u()}function h(n){S(n)}function v(n){M(n)}function y(){m()}var b="START",w="STOP",k=function(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")},g=function(){function n(n,e){for(var r=0;r<e.length;r++){var t=e[r];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(n,t.key,t)}}return function(e,r,t){return r&&n(e.prototype,r),t&&n(e,t),e}}(),T=function(){function n(e){var r=e.name,t=e.duration;k(this,n),this.name=r,this.duration=t}return g(n,[{key:"info",get:function(){return{name:this.name,duratino:this.duration}},set:function(n){var e=n.name,r=n.duration;this.name=e,this.duration=r}}]),n}(),P={},S=function(){},M=function(){};n.startRecording=p,n.stopRecording=d,n.allMeasures=l,n.startMark=h,n.endMark=v,n.checkSupport=y,Object.defineProperty(n,"__esModule",{value:!0})}); | ||
| !function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(n.JSPerf={})}(this,function(n){"use strict";function e(n){var e=n+"-"+v;M[n]={start:e},performance.mark(e)}function r(n){var e=n+"-"+k;M[n].stop=e,performance.mark(e)}function t(){for(var n in M){var e=M[n],r=e.start,t=e.stop;try{performance.measure(n,r,t)}catch(n){throw new Error("JS Performance is trying access to marker that does not exist")}}for(var o=[],a=performance.getEntriesByType("measure"),i=Array.isArray(a),u=0,a=i?a:a[Symbol.iterator]();;){var f;if(i){if(u>=a.length)break;f=a[u++]}else{if((u=a.next()).done)break;f=u.value}var c=f;o.push(new g({name:c.name,duration:c.duration}))}return o}function o(){M={},performance.clearMarks(),performance.clearMeasures()}function a(){o(),S=e,x=r}function i(){S=function(){},x=function(){}}function u(){t().map(function(n){return{"Operation name":n.name,"Duration (ms)":n.duration}})}function f(){return"undefined"!=typeof window}function c(){return void 0!==window.performance}function s(){f()&&c()}function m(){a()}function d(){i()}function p(){u()}function l(n){S(n)}function y(n){x(n)}function h(){return s()}var v="START",k="STOP",b=function(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")},w=function(){function n(n,e){for(var r=0;r<e.length;r++){var t=e[r];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(n,t.key,t)}}return function(e,r,t){return r&&n(e.prototype,r),t&&n(e,t),e}}(),g=function(){function n(e){var r=e.name,t=e.duration;b(this,n),this.name=r,this.duration=t}return w(n,[{key:"info",get:function(){return{name:this.name,duratino:this.duration}},set:function(n){var e=n.name,r=n.duration;this.name=e,this.duration=r}}]),n}(),M={},S=function(){},x=function(){};n.startRecording=m,n.stopRecording=d,n.allMeasures=p,n.startMark=l,n.endMark=y,n.checkSupport=h,Object.defineProperty(n,"__esModule",{value:!0})}); |
+15
-14
| { | ||
| "name": "@ematipico/js-performance", | ||
| "version": "1.1.0", | ||
| "version": "1.1.1", | ||
| "description": "A collection of utilities to measure the performance of your application", | ||
@@ -28,25 +28,26 @@ "main": "index.js", | ||
| "devDependencies": { | ||
| "ava": "^0.19.1", | ||
| "ava": "^0.24.0", | ||
| "babel-core": "^6.24.1", | ||
| "babel-plugin-external-helpers": "^6.22.0", | ||
| "babel-plugin-transform-object-assign": "^6.22.0", | ||
| "babel-plugin-transform-remove-console": "^6.8.3", | ||
| "babel-plugin-transform-remove-debugger": "^6.8.3", | ||
| "babel-plugin-transform-remove-console": "^6.8.5", | ||
| "babel-plugin-transform-remove-debugger": "^6.8.5", | ||
| "babel-plugin-transform-runtime": "^6.23.0", | ||
| "babel-polyfill": "^6.23.0", | ||
| "babel-polyfill": "^6.26.0", | ||
| "babel-preset-env": "^1.5.2", | ||
| "babel-preset-latest": "^6.24.1", | ||
| "babel-register": "^6.24.1", | ||
| "cross-env": "^5.0.1", | ||
| "jasmine": "^2.6.0", | ||
| "jsdoc-to-markdown": "^3.0.0", | ||
| "karma": "^1.7.0", | ||
| "rollup": "^0.42.0", | ||
| "rollup-plugin-babel": "^2.7.1", | ||
| "babel-register": "^6.26.0", | ||
| "cross-env": "^5.1.3", | ||
| "jasmine": "^2.8.0", | ||
| "jsdoc-to-markdown": "^3.0.3", | ||
| "karma": "^2.0.0", | ||
| "npm-check-updates": "^2.14.0", | ||
| "rollup": "^0.53.3", | ||
| "rollup-plugin-babel": "^3.0.3", | ||
| "rollup-plugin-node-resolve": "^3.0.0", | ||
| "rollup-plugin-replace": "^1.1.1", | ||
| "rollup-plugin-replace": "^2.0.0", | ||
| "rollup-plugin-uglify": "^2.0.1", | ||
| "rollup-watch": "^4.0.0", | ||
| "snazzy": "^7.0.0", | ||
| "standard": "^10.0.2", | ||
| "standard": "^10.0.3", | ||
| "uglify-es": "^3.0.15" | ||
@@ -53,0 +54,0 @@ }, |
@@ -198,6 +198,6 @@ 'use strict'; | ||
| * Gives information is it is possible to use the library | ||
| * @return {[type]} [description] | ||
| * @return {String?} Reason why the browser doest not support the API | ||
| */ | ||
| function checkSupport() { | ||
| support(); | ||
| return support(); | ||
| } | ||
@@ -211,2 +211,1 @@ | ||
| exports.checkSupport = checkSupport; | ||
| //# sourceMappingURL=js.performance.cjs.js.map |
@@ -194,9 +194,8 @@ var START = 'START'; | ||
| * Gives information is it is possible to use the library | ||
| * @return {[type]} [description] | ||
| * @return {String?} Reason why the browser doest not support the API | ||
| */ | ||
| function checkSupport() { | ||
| support(); | ||
| return support(); | ||
| } | ||
| export { startRecording, stopRecording, allMeasures, startMark, endMark, checkSupport }; | ||
| //# sourceMappingURL=js.performance.es.js.map |
| (function (global, factory) { | ||
| typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
| typeof define === 'function' && define.amd ? define(['exports'], factory) : | ||
| (factory((global.JSPerf = global.JSPerf || {}))); | ||
| (factory((global.JSPerf = {}))); | ||
| }(this, (function (exports) { 'use strict'; | ||
@@ -200,6 +200,6 @@ | ||
| * Gives information is it is possible to use the library | ||
| * @return {[type]} [description] | ||
| * @return {String?} Reason why the browser doest not support the API | ||
| */ | ||
| function checkSupport() { | ||
| support(); | ||
| return support(); | ||
| } | ||
@@ -217,2 +217,1 @@ | ||
| }))); | ||
| //# sourceMappingURL=js.performance.umd.js.map |
@@ -12,3 +12,3 @@ // rollup.config.js | ||
| format: 'es', | ||
| sourceMap: true | ||
| sourcemapFile: true | ||
| }, | ||
@@ -18,4 +18,4 @@ { | ||
| format: 'umd', | ||
| moduleName: 'JSPerf', | ||
| sourceMap: true | ||
| name: 'JSPerf', | ||
| sourcemapFile: true | ||
| }, | ||
@@ -25,3 +25,3 @@ { | ||
| format: 'cjs', | ||
| sourceMap: true | ||
| sourcemapFile: true | ||
| } | ||
@@ -28,0 +28,0 @@ ], |
@@ -18,3 +18,3 @@ // rollup.config.js | ||
| format: 'umd', | ||
| moduleName: 'JSPerf' | ||
| name: 'JSPerf' | ||
| }, | ||
@@ -21,0 +21,0 @@ { |
@@ -6,4 +6,4 @@ const jsdoc2md = require('jsdoc-to-markdown') | ||
| /* input and output paths */ | ||
| const inputFile = path.resolve(path.join(__dirname, 'src/index.js')) | ||
| const outputDir = __dirname | ||
| const inputFile = path.resolve(path.join(__dirname, '../src/index.js')) | ||
| const outputDir = path.resolve(path.join(__dirname, '../')) | ||
@@ -10,0 +10,0 @@ /* get template data */ |
| import test from 'ava' | ||
| import { getStartLabel } from './index' | ||
| test('getStartLabel returns the expected string ', t => { | ||
| const label = 'dummy' | ||
| t.true(getStartLabel(label) === 'dummy_START') | ||
| }) |
| import test from 'ava' | ||
| import { giveMeAllMeasures } from './markerGenerator' | ||
| test('giveMeAllMeasures return all my measures', t => { | ||
| const measures = giveMeAllMeasures() | ||
| const expectedMeasures = [] | ||
| t.deepEqual(measures, expectedMeasures) | ||
| }) |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
58844
-1.64%25
4.17%26
-7.14%797
-2.21%