Comparing version 0.2.0 to 0.3.0
@@ -27,3 +27,3 @@ "use strict"; | ||
} | ||
} else if (typeof inpt === "object") { | ||
} else if (typeof inpt === "object" && inpt !== null && inpt.constructor.name.indexOf("Array") === -1) { | ||
const obj = {}; | ||
@@ -30,0 +30,0 @@ for (let key in inpt) { |
"use strict"; | ||
var _expose = _interopRequireDefault(require("./expose.js")); | ||
var _serialize2 = _interopRequireDefault(require("./serialize.js")); | ||
var _wrap = _interopRequireDefault(require("./wrap.js")); | ||
@@ -9,3 +10,4 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
expose: _expose.default, | ||
wrap: _wrap.default | ||
wrap: _wrap.default, | ||
_serialize: _serialize2.default | ||
}; | ||
@@ -16,3 +18,4 @@ } | ||
expose: _expose.default, | ||
wrap: _wrap.default | ||
wrap: _wrap.default, | ||
_serialize: _serialize2.default | ||
}; | ||
@@ -23,3 +26,4 @@ } | ||
expose: _expose.default, | ||
wrap: _wrap.default | ||
wrap: _wrap.default, | ||
_serialize: _serialize2.default | ||
}; | ||
@@ -31,5 +35,6 @@ } | ||
expose: _expose.default, | ||
wrap: _wrap.default | ||
wrap: _wrap.default, | ||
_serialize: _serialize2.default | ||
}; | ||
}); | ||
} |
@@ -29,3 +29,3 @@ "use strict"; | ||
return function_prefix + fid; | ||
} else if (typeof it === "object" && typeof it.then === "function") { | ||
} else if (typeof it === "object" && it !== null && typeof it.then === "function") { | ||
const pid = generate_id(it); | ||
@@ -35,3 +35,4 @@ proms[pid] = it; | ||
return promise_prefix + pid; | ||
} else if (typeof it === "object") { | ||
} else if (typeof it === "object" && it !== null && it.constructor.name.indexOf("Array") === -1) { | ||
// object that is not null nor a typed array | ||
return Object.fromEntries(Object.entries(it).map(([k, v]) => [k, stringify(v)])); | ||
@@ -38,0 +39,0 @@ } else { |
@@ -250,3 +250,3 @@ (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ | ||
} | ||
} else if (typeof inpt === "object") { | ||
} else if (typeof inpt === "object" && inpt !== null && inpt.constructor.name.indexOf("Array") === -1) { | ||
const obj = {}; | ||
@@ -465,2 +465,3 @@ for (let key in inpt) { | ||
var _expose = _interopRequireDefault(require("./expose.js")); | ||
var _serialize2 = _interopRequireDefault(require("./serialize.js")); | ||
var _wrap = _interopRequireDefault(require("./wrap.js")); | ||
@@ -471,3 +472,4 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
expose: _expose.default, | ||
wrap: _wrap.default | ||
wrap: _wrap.default, | ||
_serialize: _serialize2.default | ||
}; | ||
@@ -478,3 +480,4 @@ } | ||
expose: _expose.default, | ||
wrap: _wrap.default | ||
wrap: _wrap.default, | ||
_serialize: _serialize2.default | ||
}; | ||
@@ -485,3 +488,4 @@ } | ||
expose: _expose.default, | ||
wrap: _wrap.default | ||
wrap: _wrap.default, | ||
_serialize: _serialize2.default | ||
}; | ||
@@ -493,7 +497,8 @@ } | ||
expose: _expose.default, | ||
wrap: _wrap.default | ||
wrap: _wrap.default, | ||
_serialize: _serialize2.default | ||
}; | ||
}); | ||
} | ||
},{"./expose.js":7,"./wrap.js":10}],9:[function(require,module,exports){ | ||
},{"./expose.js":7,"./serialize.js":9,"./wrap.js":10}],9:[function(require,module,exports){ | ||
"use strict"; | ||
@@ -527,3 +532,3 @@ | ||
return function_prefix + fid; | ||
} else if (typeof it === "object" && typeof it.then === "function") { | ||
} else if (typeof it === "object" && it !== null && typeof it.then === "function") { | ||
const pid = generate_id(it); | ||
@@ -533,3 +538,4 @@ proms[pid] = it; | ||
return promise_prefix + pid; | ||
} else if (typeof it === "object") { | ||
} else if (typeof it === "object" && it !== null && it.constructor.name.indexOf("Array") === -1) { | ||
// object that is not null nor a typed array | ||
return Object.fromEntries(Object.entries(it).map(([k, v]) => [k, stringify(v)])); | ||
@@ -536,0 +542,0 @@ } else { |
@@ -14,3 +14,3 @@ import batch from "./batch.js"; | ||
} | ||
} else if (typeof inpt === "object") { | ||
} else if (typeof inpt === "object" && inpt !== null && inpt.constructor.name.indexOf("Array") === -1) { | ||
const obj = {}; | ||
@@ -17,0 +17,0 @@ for (let key in inpt) { |
import expose from "./expose.js"; | ||
import { default as _serialize } from "./serialize.js"; | ||
import wrap from "./wrap.js"; | ||
if (typeof window === "object") { | ||
window.microlink = { expose, wrap }; | ||
window.microlink = { expose, wrap, _serialize }; | ||
} | ||
if (typeof self === "object") { | ||
self.microlink = { expose, wrap }; | ||
self.microlink = { expose, wrap, _serialize }; | ||
} | ||
if (typeof module === "object") { | ||
module.exports = { expose, wrap }; | ||
module.exports = { expose, wrap, _serialize }; | ||
} | ||
@@ -18,4 +19,4 @@ | ||
define(function () { | ||
return { expose, wrap }; | ||
return { expose, wrap, _serialize }; | ||
}); | ||
} |
@@ -23,3 +23,3 @@ import { DEFAULT_FUNCTION_PREFIX, DEFAULT_PROMISE_PREFIX } from "./enums.js"; | ||
return function_prefix + fid; | ||
} else if (typeof it === "object" && typeof it.then === "function") { | ||
} else if (typeof it === "object" && it !== null && typeof it.then === "function") { | ||
const pid = generate_id(it); | ||
@@ -29,3 +29,4 @@ proms[pid] = it; | ||
return promise_prefix + pid; | ||
} else if (typeof it === "object") { | ||
} else if (typeof it === "object" && it !== null && it.constructor.name.indexOf("Array") === -1) { | ||
// object that is not null nor a typed array | ||
return Object.fromEntries(Object.entries(it).map(([k, v]) => [k, stringify(v)])); | ||
@@ -32,0 +33,0 @@ } else { |
{ | ||
"name": "microlink", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "Comlink Alternative. Built with JSON-RPC.", | ||
@@ -5,0 +5,0 @@ "unpkg": "./dist/microlink.bundle.js", |
@@ -8,4 +8,4 @@ # microlink | ||
- zero run-time dependencies | ||
- await promise in another thread | ||
- batching | ||
- await promise in another thread | ||
@@ -49,3 +49,2 @@ ## usage | ||
#### debugging | ||
@@ -52,0 +51,0 @@ ```js |
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
62357
25
1496
56