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

typeson

Package Overview
Dependencies
Maintainers
2
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typeson - npm Package Compare versions

Comparing version 5.4.0 to 5.5.0

CHANGES.md

17

dist/typeson-commonjs2.js

@@ -124,2 +124,4 @@ 'use strict';

// This function is dependent on both constructors
// being identical so any minimization is expected of both
function hasConstructorOf(a, b) {

@@ -269,10 +271,9 @@ if (!a || (typeof a === 'undefined' ? 'undefined' : _typeof(a)) !== 'object') {

// Add $types to result only if we ever bumped into a special type (or special case where object has own `$types`)
var typeNames = Object.values(types);
if (opts.iterateNone) {
var _typeNames = Object.values(types);
if (_typeNames.length) {
return _typeNames[0];
if (typeNames.length) {
return typeNames[0];
}
return Typeson.getJSONType(ret);
}
var typeNames = Object.values(types);
if (typeNames.length) {

@@ -690,8 +691,10 @@ if (opts.returnTypeNames) {

function Undefined() {}
// We keep these two functions minimized so if using two instances of this
// library, where one is minimized and one is not, it will still work
function Undefined() {} // eslint-disable-line space-before-function-paren, space-before-blocks
// With ES6 classes, we may be able to simply use `class TypesonPromise extends Promise` and add a string tag for detection
function TypesonPromise(f) {
this.p = new Promise(f);
}
} // eslint-disable-line block-spacing, space-before-function-paren, space-before-blocks, space-infix-ops, semi
TypesonPromise.prototype.then = function (onFulfilled, onRejected) {

@@ -698,0 +701,0 @@ var _this = this;

@@ -128,2 +128,4 @@ (function (global, factory) {

// This function is dependent on both constructors
// being identical so any minimization is expected of both
function hasConstructorOf(a, b) {

@@ -273,10 +275,9 @@ if (!a || (typeof a === 'undefined' ? 'undefined' : _typeof(a)) !== 'object') {

// Add $types to result only if we ever bumped into a special type (or special case where object has own `$types`)
var typeNames = Object.values(types);
if (opts.iterateNone) {
var _typeNames = Object.values(types);
if (_typeNames.length) {
return _typeNames[0];
if (typeNames.length) {
return typeNames[0];
}
return Typeson.getJSONType(ret);
}
var typeNames = Object.values(types);
if (typeNames.length) {

@@ -694,8 +695,10 @@ if (opts.returnTypeNames) {

function Undefined() {}
// We keep these two functions minimized so if using two instances of this
// library, where one is minimized and one is not, it will still work
function Undefined() {} // eslint-disable-line space-before-function-paren, space-before-blocks
// With ES6 classes, we may be able to simply use `class TypesonPromise extends Promise` and add a string tag for detection
function TypesonPromise(f) {
this.p = new Promise(f);
}
} // eslint-disable-line block-spacing, space-before-function-paren, space-before-blocks, space-infix-ops, semi
TypesonPromise.prototype.then = function (onFulfilled, onRejected) {

@@ -702,0 +705,0 @@ var _this = this;

{
"name": "typeson",
"version": "5.4.0",
"version": "5.5.0",
"description": "Preserves types over JSON, BSON or socket.io",

@@ -5,0 +5,0 @@ "main": "./dist/typeson-commonjs2.js",

@@ -16,2 +16,4 @@ const keys = Object.keys,

// This function is dependent on both constructors
// being identical so any minimization is expected of both
function hasConstructorOf (a, b) {

@@ -151,4 +153,4 @@ if (!a || typeof a !== 'object') {

// Add $types to result only if we ever bumped into a special type (or special case where object has own `$types`)
const typeNames = Object.values(types);
if (opts.iterateNone) {
const typeNames = Object.values(types);
if (typeNames.length) {

@@ -159,3 +161,2 @@ return typeNames[0];

}
const typeNames = Object.values(types);
if (typeNames.length) {

@@ -585,8 +586,8 @@ if (opts.returnTypeNames) {

function Undefined () {}
// We keep these two functions minimized so if using two instances of this
// library, where one is minimized and one is not, it will still work
function Undefined(){} // eslint-disable-line space-before-function-paren, space-before-blocks
// With ES6 classes, we may be able to simply use `class TypesonPromise extends Promise` and add a string tag for detection
function TypesonPromise(f){this.p=new Promise(f)} // eslint-disable-line block-spacing, space-before-function-paren, space-before-blocks, space-infix-ops, semi
// With ES6 classes, we may be able to simply use `class TypesonPromise extends Promise` and add a string tag for detection
function TypesonPromise (f) {
this.p = new Promise(f);
};
TypesonPromise.prototype.then = function (onFulfilled, onRejected) {

@@ -593,0 +594,0 @@ return new TypesonPromise((typesonResolve, typesonReject) => {

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