builder-util-runtime
Advanced tools
Comparing version
@@ -6,7 +6,6 @@ "use strict"; | ||
}); | ||
exports.readEmbeddedBlockMapData = readEmbeddedBlockMapData; | ||
exports.BLOCK_MAP_FILE_NAME = void 0; | ||
exports.readEmbeddedBlockMapData = exports.BLOCK_MAP_FILE_NAME = void 0; | ||
function _bluebirdLst() { | ||
const data = _interopRequireDefault(require("bluebird-lst")); | ||
const data = _interopRequireWildcard(require("bluebird-lst")); | ||
@@ -30,3 +29,3 @@ _bluebirdLst = function () { | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } | ||
@@ -36,21 +35,27 @@ const BLOCK_MAP_FILE_NAME = "_blockMap.blockmap"; | ||
async function readEmbeddedBlockMapData(file) { | ||
const fd = await (0, _fsExtraP().open)(file, "r"); | ||
let readEmbeddedBlockMapData = (() => { | ||
var _ref = (0, _bluebirdLst().coroutine)(function* (file) { | ||
const fd = yield (0, _fsExtraP().open)(file, "r"); | ||
try { | ||
const fileSize = (await (0, _fsExtraP().fstat)(fd)).size; | ||
const sizeBuffer = Buffer.allocUnsafe(4); | ||
await (0, _fsExtraP().read)(fd, sizeBuffer, 0, sizeBuffer.length, fileSize - sizeBuffer.length); | ||
const dataBuffer = Buffer.allocUnsafe(sizeBuffer.readUInt32BE(0)); | ||
await (0, _fsExtraP().read)(fd, dataBuffer, 0, dataBuffer.length, fileSize - sizeBuffer.length - dataBuffer.length); | ||
await (0, _fsExtraP().close)(fd); | ||
try { | ||
const fileSize = (yield (0, _fsExtraP().fstat)(fd)).size; | ||
const sizeBuffer = Buffer.allocUnsafe(4); | ||
yield (0, _fsExtraP().read)(fd, sizeBuffer, 0, sizeBuffer.length, fileSize - sizeBuffer.length); | ||
const dataBuffer = Buffer.allocUnsafe(sizeBuffer.readUInt32BE(0)); | ||
yield (0, _fsExtraP().read)(fd, dataBuffer, 0, dataBuffer.length, fileSize - sizeBuffer.length - dataBuffer.length); | ||
yield (0, _fsExtraP().close)(fd); | ||
const inflateRaw = _bluebirdLst().default.promisify(require("zlib").inflateRaw); | ||
const inflateRaw = _bluebirdLst().default.promisify(require("zlib").inflateRaw); | ||
return (await inflateRaw(dataBuffer)).toString(); | ||
} catch (e) { | ||
await (0, _fsExtraP().close)(fd); | ||
throw e; | ||
} | ||
} | ||
return (yield inflateRaw(dataBuffer)).toString(); | ||
} catch (e) { | ||
yield (0, _fsExtraP().close)(fd); | ||
throw e; | ||
} | ||
}); | ||
return function readEmbeddedBlockMapData(_x) { | ||
return _ref.apply(this, arguments); | ||
}; | ||
})(); exports.readEmbeddedBlockMapData = readEmbeddedBlockMapData; | ||
//# sourceMappingURL=blockMapApi.js.map |
@@ -77,2 +77,3 @@ export declare type PublishProvider = "github" | "bintray" | "s3" | "spaces" | "generic"; | ||
* Generic (any HTTP(S) server) options. | ||
* In all publish options [File Macros](/file-patterns.md#file-macros) are supported. | ||
*/ | ||
@@ -85,3 +86,3 @@ export interface GenericServerOptions extends PublishConfiguration { | ||
/** | ||
* The base url. e.g. `https://bucket_name.s3.amazonaws.com`. You can use `${os}` (expanded to `mac`, `linux` or `win` according to target platform) and `${arch}` macros. | ||
* The base url. e.g. `https://bucket_name.s3.amazonaws.com`. | ||
*/ | ||
@@ -88,0 +89,0 @@ readonly url: string; |
{ | ||
"name": "builder-util-runtime", | ||
"version": "4.2.0", | ||
"version": "4.2.1", | ||
"main": "out/index.js", | ||
@@ -18,3 +18,3 @@ "author": "Vladimir Krivosheev", | ||
"debug": "^3.1.0", | ||
"fs-extra-p": "^4.5.2", | ||
"fs-extra-p": "^4.6.0", | ||
"bluebird-lst": "^1.0.5", | ||
@@ -21,0 +21,0 @@ "sax": "^1.2.4" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
146696
0.38%1770
0.34%Updated