Permalink
Cannot retrieve contributors at this time
24 lines (24 sloc)
972 Bytes
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
codeql-action/node_modules/@azure/storage-blob/dist-esm/storage-blob/src/PageBlobRangeResponse.js
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) Microsoft Corporation. | |
// Licensed under the MIT license. | |
/** | |
* Function that converts PageRange and ClearRange to a common Range object. | |
* PageRange and ClearRange have start and end while Range offset and count | |
* this function normalizes to Range. | |
* @param response - Model PageBlob Range response | |
*/ | |
export function rangeResponseFromModel(response) { | |
const pageRange = (response._response.parsedBody.pageRange || []).map((x) => ({ | |
offset: x.start, | |
count: x.end - x.start, | |
})); | |
const clearRange = (response._response.parsedBody.clearRange || []).map((x) => ({ | |
offset: x.start, | |
count: x.end - x.start, | |
})); | |
return Object.assign(Object.assign({}, response), { pageRange, | |
clearRange, _response: Object.assign(Object.assign({}, response._response), { parsedBody: { | |
pageRange, | |
clearRange, | |
} }) }); | |
} | |
//# sourceMappingURL=PageBlobRangeResponse.js.map |