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

blockmap

Package Overview
Dependencies
Maintainers
3
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blockmap - npm Package Compare versions

Comparing version 4.0.1 to 4.0.2-tslib-156c02ff6b52ed3caede241ee6477e26bd094d22

9

CHANGELOG.md

@@ -7,2 +7,11 @@ # Change Log

# v4.0.2
## (2020-07-14)
* Update generated docs [Alexis Svinartchouk]
* Use tslib [Alexis Svinartchouk]
* Use strict typescript flag [Alexis Svinartchouk]
* Update dependencies [Alexis Svinartchouk]
* Update resin-lint -> balena-lint [Alexis Svinartchouk]
# v4.0.1

@@ -9,0 +18,0 @@ ## (2020-03-31)

7

js/blockmap.js

@@ -19,2 +19,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.BlockMap = void 0;
const crypto_1 = require("crypto");

@@ -45,5 +46,3 @@ const xml_js_1 = require("xml-js");

const value = bmap.replace(xmlTag('BmapFileChecksum', checksum), zerofill);
const digest = crypto_1.createHash(this.checksumType)
.update(value)
.digest('hex');
const digest = crypto_1.createHash(this.checksumType).update(value).digest('hex');
return value.replace(zerofill, xmlTag('BmapFileChecksum', digest));

@@ -58,3 +57,3 @@ }

toString() {
const ranges2 = this.ranges.map(range => {
const ranges2 = this.ranges.map((range) => {
const blockRange = range.start !== range.end ? range.start + '-' + range.end : range.start;

@@ -61,0 +60,0 @@ return {

@@ -19,2 +19,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.Chunk = void 0;
class Chunk {

@@ -21,0 +22,0 @@ constructor(buffer, position) {

@@ -19,2 +19,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.FilterStream = void 0;
const crypto_1 = require("crypto");

@@ -65,3 +66,3 @@ const debug_1 = require("debug");

_getByteRangesFromBlockMap() {
return this.blockMap.ranges.map(range => {
return this.blockMap.ranges.map((range) => {
return new read_range_1.ReadRange(range, this.blockMap.blockSize);

@@ -68,0 +69,0 @@ });

@@ -18,14 +18,12 @@ "use strict";

*/
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./blockmap"));
__export(require("./chunk"));
__export(require("./filter-stream"));
__export(require("./parse"));
__export(require("./range"));
__export(require("./read-range"));
__export(require("./read-stream"));
__export(require("./utils"));
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./blockmap"), exports);
tslib_1.__exportStar(require("./chunk"), exports);
tslib_1.__exportStar(require("./filter-stream"), exports);
tslib_1.__exportStar(require("./parse"), exports);
tslib_1.__exportStar(require("./range"), exports);
tslib_1.__exportStar(require("./read-range"), exports);
tslib_1.__exportStar(require("./read-stream"), exports);
tslib_1.__exportStar(require("./utils"), exports);
//# sourceMappingURL=index.js.map

@@ -19,2 +19,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.parse = void 0;
const crypto_1 = require("crypto");

@@ -74,5 +75,3 @@ const xml_js_1 = require("xml-js");

node.name.toLowerCase() === 'range') {
const [start, end] = getText(node)
.trim()
.split('-');
const [start, end] = getText(node).trim().split('-');
const checksum = getAttribute(node, 'sha1') || getAttribute(node, 'chksum');

@@ -126,5 +125,3 @@ if (checksum === undefined) {

const file = maskChecksum(value);
const digest = crypto_1.createHash(checksumType)
.update(file)
.digest('hex');
const digest = crypto_1.createHash(checksumType).update(file).digest('hex');
if (checksum !== digest) {

@@ -131,0 +128,0 @@ throw new Error(`File checksum mismatch: ${checksum} != ${digest}`);

@@ -19,2 +19,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.Range = void 0;
class Range {

@@ -21,0 +22,0 @@ constructor(start = 0, end = 0, checksum) {

@@ -19,2 +19,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.ReadRangeError = exports.ReadRange = void 0;
class ReadRange {

@@ -21,0 +22,0 @@ constructor(range, blockSize) {

@@ -18,12 +18,5 @@ "use strict";

*/
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ReadStream = void 0;
const tslib_1 = require("tslib");
const crypto_1 = require("crypto");

@@ -100,3 +93,3 @@ const debug_1 = require("debug");

})
.filter(readRange => {
.filter((readRange) => {
return readRange.end <= this.end + this.start;

@@ -133,3 +126,3 @@ });

_readBlock() {
return __awaiter(this, void 0, void 0, function* () {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
if (this.currentRange === undefined) {

@@ -170,3 +163,3 @@ return;

_advanceRange() {
return __awaiter(this, void 0, void 0, function* () {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
if (this.ranges.length > 0) {

@@ -189,3 +182,3 @@ this.currentRange = this.ranges.shift();

_read() {
return __awaiter(this, void 0, void 0, function* () {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
if (this.currentRange === undefined) {

@@ -192,0 +185,0 @@ yield this._advanceRange();

@@ -18,12 +18,5 @@ "use strict";

*/
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.withOpenFile = void 0;
const tslib_1 = require("tslib");
const fs = require("fs");

@@ -55,3 +48,3 @@ function open(filename) {

function withOpenFile(filename, fn) {
return __awaiter(this, void 0, void 0, function* () {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
const fd = yield open(filename);

@@ -58,0 +51,0 @@ try {

@@ -83,5 +83,3 @@ /**

const value = bmap.replace(xmlTag('BmapFileChecksum', checksum), zerofill);
const digest = createHash(this.checksumType)
.update(value)
.digest('hex');
const digest = createHash(this.checksumType).update(value).digest('hex');
return value.replace(zerofill, xmlTag('BmapFileChecksum', digest));

@@ -98,3 +96,3 @@ }

public toString(): string {
const ranges2 = this.ranges.map(range => {
const ranges2 = this.ranges.map((range) => {
const blockRange =

@@ -101,0 +99,0 @@ range.start !== range.end ? range.start + '-' + range.end : range.start;

@@ -78,3 +78,3 @@ /**

private _getByteRangesFromBlockMap() {
return this.blockMap.ranges.map(range => {
return this.blockMap.ranges.map((range) => {
return new ReadRange(range, this.blockMap.blockSize);

@@ -81,0 +81,0 @@ });

@@ -86,5 +86,3 @@ /**

) {
const [start, end] = getText(node)
.trim()
.split('-');
const [start, end] = getText(node).trim().split('-');
const checksum =

@@ -148,5 +146,3 @@ getAttribute(node, 'sha1') || getAttribute(node, 'chksum');

const file = maskChecksum(value);
const digest = createHash(checksumType)
.update(file)
.digest('hex');
const digest = createHash(checksumType).update(file).digest('hex');
if (checksum !== digest) {

@@ -153,0 +149,0 @@ throw new Error(`File checksum mismatch: ${checksum} != ${digest}`);

@@ -131,3 +131,3 @@ /**

)
.filter(readRange => {
.filter((readRange) => {
return readRange.end <= this.end + this.start;

@@ -134,0 +134,0 @@ });

@@ -34,3 +34,3 @@ /**

return new Promise((resolve, reject) => {
fs.close(fd, (error?: Error) => {
fs.close(fd, (error?: Error | null) => {
if (error) {

@@ -37,0 +37,0 @@ reject(error);

{
"name": "blockmap",
"version": "4.0.1",
"version": "4.0.2-tslib-156c02ff6b52ed3caede241ee6477e26bd094d22",
"description": "Tizen's block map format",

@@ -17,17 +17,18 @@ "license": "MIT",

"dependencies": {
"debug": "^3.1.0",
"debug": "^4.1.1",
"tslib": "^2.0.0",
"xml-js": "^1.6.11"
},
"devDependencies": {
"@types/debug": "^4.1.2",
"@types/htmlparser2": "^3.7.31",
"@types/mocha": "^5.2.6",
"@types/node": "^6.14.4",
"@types/xml": "^1.0.3",
"mocha": "^6.0.2",
"resin-lint": "^3.3.1",
"ts-node": "^8.0.3",
"typedoc": "^0.14.2",
"typedoc-plugin-markdown": "^1.1.27",
"typescript": "^3.3.4000"
"@balena/lint": "^5.1.0",
"@types/debug": "^4.1.5",
"@types/htmlparser2": "^3.10.1",
"@types/mocha": "^8.0.0",
"@types/node": "^6.14.10",
"@types/xml": "^1.0.5",
"mocha": "^8.0.1",
"ts-node": "^8.10.2",
"typedoc": "^0.17.8",
"typedoc-plugin-markdown": "^2.3.1",
"typescript": "^3.9.6"
},

@@ -44,4 +45,4 @@ "homepage": "https://github.com/balena-io-modules/blockmap",

"build": "tsc",
"prettier": "resin-lint --typescript --fix benchmark lib test",
"lint": "resin-lint --typescript benchmark lib test",
"prettier": "balena-lint --typescript --fix benchmark lib test",
"lint": "balena-lint --typescript benchmark lib test",
"test": "mocha -r ts-node/register test/*.ts",

@@ -48,0 +49,0 @@ "benchmark": "ts-node benchmark/blockmap.ts",

{
"compilerOptions": {
"strict": true,
"module": "commonjs",

@@ -8,6 +9,5 @@ "outDir": "js",

"target": "es6",
"noImplicitAny": true,
"strictNullChecks": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"importHelpers": true,
"lib": ["es7"]

@@ -14,0 +14,0 @@ },

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

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

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