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

lib0

Package Overview
Dependencies
Maintainers
1
Versions
113
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lib0 - npm Package Compare versions

Comparing version 0.1.6 to 0.1.7

.nyc_output/14af51f7-4a6c-4882-bced-b3e6c3d1c450.json

2

.nyc_output/processinfo/index.json

@@ -1,1 +0,1 @@

{"processes":{"5533be88-6af4-4919-a434-8b62ae34ee29":{"parent":null,"children":[]}},"files":{},"externalIds":{}}
{"processes":{"14af51f7-4a6c-4882-bced-b3e6c3d1c450":{"parent":null,"children":[]}},"files":{},"externalIds":{}}

@@ -279,8 +279,18 @@ 'use strict';

const writeUint8Array = (encoder, uint8Array) => {
const prevBufferLen = encoder.cbuf.length;
// TODO: Append to cbuf if possible
encoder.bufs.push(buffer.createUint8ArrayViewFromArrayBuffer(encoder.cbuf.buffer, 0, encoder.cpos));
encoder.bufs.push(uint8Array);
encoder.cbuf = buffer.createUint8ArrayFromLen(prevBufferLen);
encoder.cpos = 0;
const bufferLen = encoder.cbuf.length;
const cpos = encoder.cpos;
const leftCopyLen = math.min(bufferLen - cpos, uint8Array.length);
const rightCopyLen = uint8Array.length - leftCopyLen;
encoder.cbuf.set(uint8Array.subarray(0, leftCopyLen), cpos);
encoder.cpos += leftCopyLen;
if (rightCopyLen > 0) {
// Still something to write, write right half..
// Append new buffer
encoder.bufs.push(encoder.cbuf);
// must have at least size of remaining buffer
encoder.cbuf = new Uint8Array(math.max(bufferLen * 2, rightCopyLen));
// copy array
encoder.cbuf.set(uint8Array.subarray(leftCopyLen));
encoder.cpos = rightCopyLen;
}
};

@@ -287,0 +297,0 @@

@@ -71,2 +71,19 @@ 'use strict';

/**
* @template K
* @template V
* @param {Map<K,V>} m
* @param {function(V,K):boolean} f
* @return {boolean}
*/
const all = (m, f) => {
for (const [key, value] of m) {
if (!f(value, key)) {
return false
}
}
return true
};
exports.all = all;
exports.any = any;

@@ -73,0 +90,0 @@ exports.copy = copy;

@@ -271,8 +271,18 @@ /**

export const writeUint8Array = (encoder, uint8Array) => {
const prevBufferLen = encoder.cbuf.length
// TODO: Append to cbuf if possible
encoder.bufs.push(buffer.createUint8ArrayViewFromArrayBuffer(encoder.cbuf.buffer, 0, encoder.cpos))
encoder.bufs.push(uint8Array)
encoder.cbuf = buffer.createUint8ArrayFromLen(prevBufferLen)
encoder.cpos = 0
const bufferLen = encoder.cbuf.length
const cpos = encoder.cpos
const leftCopyLen = math.min(bufferLen - cpos, uint8Array.length)
const rightCopyLen = uint8Array.length - leftCopyLen
encoder.cbuf.set(uint8Array.subarray(0, leftCopyLen), cpos)
encoder.cpos += leftCopyLen
if (rightCopyLen > 0) {
// Still something to write, write right half..
// Append new buffer
encoder.bufs.push(encoder.cbuf)
// must have at least size of remaining buffer
encoder.cbuf = new Uint8Array(math.max(bufferLen * 2, rightCopyLen))
// copy array
encoder.cbuf.set(uint8Array.subarray(leftCopyLen))
encoder.cpos = rightCopyLen
}
}

@@ -279,0 +289,0 @@

@@ -67,1 +67,17 @@

}
/**
* @template K
* @template V
* @param {Map<K,V>} m
* @param {function(V,K):boolean} f
* @return {boolean}
*/
export const all = (m, f) => {
for (const [key, value] of m) {
if (!f(value, key)) {
return false
}
}
return true
}
{
"name": "lib0",
"version": "0.1.6",
"version": "0.1.7",
"description": "",

@@ -5,0 +5,0 @@ "dependencies": {},

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 too big to display

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