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

@tapjs/node-serialize

Package Overview
Dependencies
Maintainers
2
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tapjs/node-serialize - npm Package Compare versions

Comparing version 1.1.5 to 1.1.6

3

dist/commonjs/test-map.d.ts

@@ -1,3 +0,4 @@

import type { Base } from '@tapjs/core';
import { Base } from '@tapjs/core';
export declare class TestMap<T extends {}> extends Map<Base, T> {
constructor(items?: [Base, T][]);
get(t: Base): T | undefined;

@@ -4,0 +5,0 @@ has(t: Base): boolean;

@@ -6,33 +6,33 @@ "use strict";

exports.TestMap = void 0;
const kSerializationKey = Symbol.for('@tapjs/node-serialize.key');
const getKey = (t) => {
const k = t[kSerializationKey];
if (k)
return k;
const n = String(Math.random());
Object.defineProperty(t, kSerializationKey, {
value: n,
writable: false,
configurable: true,
enumerable: false,
});
return n;
};
class TestMap extends Map {
get(t) {
const tt = t.t;
if (tt !== undefined && tt !== t) {
let vt = super.get(t.t);
if (vt === undefined) {
const v = super.get(t);
if (v !== undefined) {
super.set(tt, v);
super.delete(t);
return v;
}
constructor(items) {
super();
if (items) {
for (const [t, v] of items) {
this.set(t, v);
}
return vt;
}
return super.get(t);
}
get(t) {
return super.get(getKey(t));
}
has(t) {
const tt = t.t;
return super.has(t) || super.has(tt);
return super.has(getKey(t));
}
set(t, v) {
const tt = t.t;
if (tt !== undefined && tt !== t) {
super.delete(t);
super.set(tt, v);
}
else {
super.set(t, v);
}
return this;
return super.set(getKey(t), v);
}

@@ -39,0 +39,0 @@ }

@@ -1,3 +0,4 @@

import type { Base } from '@tapjs/core';
import { Base } from '@tapjs/core';
export declare class TestMap<T extends {}> extends Map<Base, T> {
constructor(items?: [Base, T][]);
get(t: Base): T | undefined;

@@ -4,0 +5,0 @@ has(t: Base): boolean;

// A map of test objects, but make sure that we don't get confused
// if we get the Test proxy or the underlying TestBase.
const kSerializationKey = Symbol.for('@tapjs/node-serialize.key');
const getKey = (t) => {
const k = t[kSerializationKey];
if (k)
return k;
const n = String(Math.random());
Object.defineProperty(t, kSerializationKey, {
value: n,
writable: false,
configurable: true,
enumerable: false,
});
return n;
};
export class TestMap extends Map {
get(t) {
const tt = t.t;
if (tt !== undefined && tt !== t) {
let vt = super.get(t.t);
if (vt === undefined) {
const v = super.get(t);
if (v !== undefined) {
super.set(tt, v);
super.delete(t);
return v;
}
constructor(items) {
super();
if (items) {
for (const [t, v] of items) {
this.set(t, v);
}
return vt;
}
return super.get(t);
}
get(t) {
return super.get(getKey(t));
}
has(t) {
const tt = t.t;
return super.has(t) || super.has(tt);
return super.has(getKey(t));
}
set(t, v) {
const tt = t.t;
if (tt !== undefined && tt !== t) {
super.delete(t);
super.set(tt, v);
}
else {
super.set(t, v);
}
return this;
return super.set(getKey(t), v);
}
}
//# sourceMappingURL=test-map.js.map
{
"name": "@tapjs/node-serialize",
"version": "1.1.5",
"version": "1.1.6",
"description": "Stream TAP test data as a serialized node:test stream",

@@ -46,3 +46,3 @@ "tshy": {

"peerDependencies": {
"@tapjs/core": "1.3.5"
"@tapjs/core": "1.3.6"
},

@@ -49,0 +49,0 @@ "tap": {

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