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

@bnaya/objectbuffer

Package Overview
Dependencies
Maintainers
1
Versions
122
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bnaya/objectbuffer - npm Package Compare versions

Comparing version 0.0.0-4b90e23 to 0.0.0-6858e67

dist/internal/assertNonNull.js

7

dist/internal/assertNonNull.d.ts

@@ -1,7 +0,2 @@

/**
* @template T
* @param {T} v
* @return {asserts v is NonNullable<T>}
*/
export function assertNonNull<T>(v: T): asserts v is NonNullable<T>;
export declare function assertNonNull<T>(v: T): asserts v is NonNullable<T>;
//# sourceMappingURL=assertNonNull.d.ts.map
{
"name": "@bnaya/objectbuffer",
"description": "Object-like api, backed by an array buffer",
"version": "0.0.0-4b90e23",
"version": "0.0.0-6858e67",
"main": "dist/objectbuffer.cjs.js",

@@ -39,24 +39,24 @@ "module": "dist/index.js",

"devDependencies": {
"@babel/cli": "^7.7.0",
"@babel/core": "^7.7.0",
"@babel/preset-env": "^7.7.1",
"@babel/preset-typescript": "^7.7.0",
"@types/jest": "^24.0.22",
"@types/node": "^12.12.6",
"@typescript-eslint/eslint-plugin": "^2.6.1",
"@typescript-eslint/parser": "^2.6.1",
"@babel/cli": "^7.7.4",
"@babel/core": "^7.7.4",
"@babel/preset-env": "^7.7.4",
"@babel/preset-typescript": "^7.7.4",
"@types/jest": "^24.0.23",
"@types/node": "^12.12.14",
"@typescript-eslint/eslint-plugin": "^2.9.0",
"@typescript-eslint/parser": "^2.9.0",
"babel-loader": "^8.0.6",
"concurrently": "^5.0.0",
"core-js": "^3.4.0",
"eslint": "^6.6.0",
"eslint-config-prettier": "^6.5.0",
"core-js": "^3.4.5",
"eslint": "^6.7.2",
"eslint-config-prettier": "^6.7.0",
"eslint-plugin-prettier": "^3.1.1",
"gh-pages": "^2.1.1",
"html-webpack-plugin": "^3.2.0",
"husky": "^3.0.9",
"husky": "^3.1.0",
"jest": "^24.9.0",
"prettier": "^1.18.2",
"prettier-eslint": "^9.0.0",
"prettier": "^1.19.1",
"prettier-eslint": "^9.0.1",
"rimraf": "^3.0.0",
"rollup": "^1.26.3",
"rollup": "^1.27.6",
"rollup-plugin-babel": "^4.3.3",

@@ -89,4 +89,4 @@ "rollup-plugin-node-resolve": "^5.2.0",

"dependencies": {
"@thi.ng/malloc": "^4.1.0"
"@thi.ng/malloc": "^4.1.1"
}
}

@@ -121,3 +121,6 @@ /* eslint-env jest */

test.skip("iterate + delete compare", () => {
const nativeMap = new Map([[1, "a"], [2, "b"]]);
const nativeMap = new Map([
[1, "a"],
[2, "b"]
]);
for (const [key] of nativeMap) {

@@ -128,3 +131,6 @@ nativeMap.delete(key);

const objectBuffer = createObjectBuffer<any>(externalArgs, 1024, {
foo: new Map([[1, "a"], [2, "b"]])
foo: new Map([
[1, "a"],
[2, "b"]
])
});

@@ -131,0 +137,0 @@ for (const [key] of objectBuffer.foo) {

@@ -204,2 +204,61 @@ /* eslint-env jest */

test.skip("linkedList linkedListLowLevelIterator - delete while iteration - delete current value", () => {
setABSize(256);
const linkedListPointer = initLinkedList({ dataView, allocator });
expect(allocator.stats().available).toMatchInlineSnapshot(`184`);
const regularSet = new Set([7, 6, 5, 4]);
const itemsPointers = [
linkedListItemInsert({ dataView, allocator }, linkedListPointer, 7),
linkedListItemInsert({ dataView, allocator }, linkedListPointer, 6),
linkedListItemInsert({ dataView, allocator }, linkedListPointer, 5),
linkedListItemInsert({ dataView, allocator }, linkedListPointer, 4)
];
const linkedLintResults = [];
let iteratorPointer = 0;
while (
(iteratorPointer = linkedListLowLevelIterator(
dataView,
linkedListPointer,
iteratorPointer
))
) {
linkedLintResults.push(linkedListGetValue(dataView, iteratorPointer));
linkedListItemRemove({ dataView, allocator }, iteratorPointer);
}
const regularSetResults: number[] = [];
for (const v of regularSet) {
regularSetResults.push(v);
regularSet.delete(v);
}
expect(regularSetResults).toMatchInlineSnapshot(`
Array [
7,
6,
5,
4,
]
`);
expect(linkedLintResults).toMatchInlineSnapshot(`
Array [
7,
5,
]
`);
expect(regularSetResults).toEqual(linkedLintResults);
expect(allocator.stats().available).toMatchInlineSnapshot(`152`);
itemsPointers.forEach(p =>
linkedListItemRemove({ dataView, allocator }, p)
);
expect(allocator.stats().available).toMatchInlineSnapshot(`184`);
});
test("linkedList linkedListLowLevelIterator - add while iteration", () => {

@@ -206,0 +265,0 @@ setABSize(256);

@@ -85,5 +85,6 @@ const ALLOWS_TYPED_ARRAYS_CTORS = [

const oldEntries = Object.entries(input);
const newObjectEntries: Array<
[string, { type: TypedArrayCtor; bytesOffset: number }]
> = [];
const newObjectEntries: Array<[
string,
{ type: TypedArrayCtor; bytesOffset: number }
]> = [];

@@ -90,0 +91,0 @@ for (const [index, [key, type]] of oldEntries.entries()) {

@@ -88,3 +88,6 @@ import {

const r = sizeOfHashmap(externalArgs, objectEntries.map(([key]) => key));
const r = sizeOfHashmap(
externalArgs,
objectEntries.map(([key]) => key)
);

@@ -91,0 +94,0 @@ memoryAllocated += r.memoryAllocated;

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

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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