Comparing version 5.4.0 to 5.5.0
@@ -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) => { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
137836
1974
1