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

superjson

Package Overview
Dependencies
Maintainers
4
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

superjson - npm Package Compare versions

Comparing version 1.6.1 to 1.6.2

7

dist/registry.js
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
exports.__esModule = true;
exports.Registry = void 0;
var double_indexed_kv_1 = require("./double-indexed-kv");
var debug_1 = __importDefault(require("debug"));
var debug = debug_1["default"]('superjson');
var Registry = /** @class */ (function () {

@@ -20,3 +25,3 @@ function Registry(generateIdentifier) {

if (alreadyRegistered && alreadyRegistered !== value) {
console.warn("Ambiguous class \"" + identifier + "\", provide a unique identifier.");
debug("Ambiguous class \"" + identifier + "\", provide a unique identifier.");
}

@@ -23,0 +28,0 @@ }

2

dist/transformer.js

@@ -167,3 +167,3 @@ "use strict";

if (!clazz) {
throw new Error('Trying to deserialize unknown class');
throw new Error('Trying to deserialize unknown class - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564');
}

@@ -170,0 +170,0 @@ return Object.assign(Object.create(clazz.prototype), v);

{
"version": "1.6.1",
"version": "1.6.2",
"license": "MIT",

@@ -19,3 +19,2 @@ "main": "dist/index.js",

},
"peerDependencies": {},
"husky": {

@@ -61,2 +60,3 @@ "hooks": {

"devDependencies": {
"@types/debug": "^4.1.5",
"@types/lodash": "^4.14.168",

@@ -71,3 +71,5 @@ "@types/mongodb": "^3.6.3",

},
"dependencies": {},
"dependencies": {
"debug": "^4.3.1"
},
"resolutions": {

@@ -74,0 +76,0 @@ "**/@typescript-eslint/eslint-plugin": "^4.11.1",

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

import debug from 'debug';
import { Registry } from './registry';

@@ -19,6 +20,8 @@ import { Class } from './types';

const warnSpy = jest.spyOn(console, 'warn');
debug.enable('superjson');
const warnSpy = jest.spyOn(process.stderr, 'write');
registry.register(class Car {});
expect(warnSpy).toHaveBeenCalledWith(
expect(warnSpy).toHaveBeenCalledTimes(1);
expect(warnSpy.mock.calls[0][0]).toContain(
'Ambiguous class "Car", provide a unique identifier.'

@@ -25,0 +28,0 @@ );

import { DoubleIndexedKV } from './double-indexed-kv';
import createDebug from 'debug';
const debug = createDebug('superjson');
export class Registry<T> {

@@ -20,5 +23,3 @@ private kv = new DoubleIndexedKV<string, T>();

if (alreadyRegistered && alreadyRegistered !== value) {
console.warn(
`Ambiguous class "${identifier}", provide a unique identifier.`
);
debug(`Ambiguous class "${identifier}", provide a unique identifier.`);
}

@@ -25,0 +26,0 @@ }

@@ -254,3 +254,5 @@ import {

if (!clazz) {
throw new Error('Trying to deserialize unknown class');
throw new Error(
'Trying to deserialize unknown class - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564'
);
}

@@ -257,0 +259,0 @@

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