Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pprof-format

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pprof-format - npm Package Compare versions

Comparing version 2.0.6 to 2.0.7

testing/proto/profile.d.ts

6

dist/index.js

@@ -122,3 +122,7 @@ "use strict";

function push(value, list) {
return Array.isArray(list) ? list.concat(value) : [value];
if (list == null) {
return [value];
}
list.push(value);
return list;
}

@@ -125,0 +129,0 @@ function measureNumber(number) {

@@ -7,2 +7,25 @@ "use strict";

*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -13,2 +36,6 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

const tap_1 = __importDefault(require("tap"));
const profile_1 = require("../testing/proto/profile");
const zlib_1 = require("zlib");
const fs = __importStar(require("fs"));
const { decode, toObject } = profile_1.perftools.profiles.Profile;
const index_js_1 = require("./index.js");

@@ -299,2 +326,21 @@ tap_1.default.Test.prototype.addAssert('constructs', 3, function (Type, data, encodings, message) {

});
function profileToObject(profile) {
profile.stringTable = profile.stringTable.strings;
return profile;
}
tap_1.default.test('Protobufjs compat', (t) => {
t.test('encodes correctly', (t) => {
const profile = new index_js_1.Profile(profileData);
const encodedProfile = profile.encode();
const decodedProfile = decode(encodedProfile);
t.same(profileToObject(profile), toObject(decodedProfile, { longs: String, defaults: true }));
t.end();
});
t.test('decodes correctly', (t) => {
const buf = (0, zlib_1.gunzipSync)(fs.readFileSync('./testing/test.pprof'));
t.same(profileToObject(index_js_1.Profile.decode(buf)), toObject(decode(buf), { longs: String, defaults: true }));
t.end();
});
t.end();
});
//# sourceMappingURL=index.test.js.map

7

package.json
{
"name": "pprof-format",
"version": "2.0.6",
"version": "2.0.7",
"description": "Pure JavaScript pprof encoder and decoder",

@@ -21,3 +21,4 @@ "author": "Datadog Inc. <info@datadoghq.com>",

"pretest": "yarn build",
"test": "node dist/index.test.js"
"test": "node dist/index.test.js",
"proto": "mkdir -p proto && pbjs -t static-module -w commonjs -o testing/proto/profile.js testing/proto/profile.proto && pbts -o testing/proto/profile.d.ts testing/proto/profile.js"
},

@@ -43,2 +44,4 @@ "homepage": "https://github.com/DataDog/pprof-format#readme",

"eslint": "^8.25.0",
"protobufjs": "^7.2.2",
"protobufjs-cli": "^1.1.1",
"tap": "^16.3.0",

@@ -45,0 +48,0 @@ "typescript": "^4.8.4"

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc