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

@quilted/threads

Package Overview
Dependencies
Maintainers
1
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@quilted/threads - npm Package Compare versions

Comparing version 0.1.14 to 0.1.15

6

CHANGELOG.md
# @quilted/threads
## 0.1.15
### Patch Changes
- [`54e3db19`](https://github.com/lemonmade/quilt/commit/54e3db19094207d5eb5a073cfdbe98cb9ca68372) Thanks [@lemonmade](https://github.com/lemonmade)! - Encode more native JS types
## 0.1.14

@@ -4,0 +10,0 @@

2

package.json

@@ -5,3 +5,3 @@ {

"type": "module",
"version": "0.1.14",
"version": "0.1.15",
"license": "MIT",

@@ -8,0 +8,0 @@ "engines": {

@@ -21,2 +21,6 @@ import {

const FUNCTION = '_@f';
const MAP = '_@m';
const SET = '_@s';
const DATE = '_@d';
const REGEXP = '_@r';
const ASYNC_ITERATOR = '_@i';

@@ -131,3 +135,3 @@

return [result, transferables];
return fullResult;
}

@@ -139,6 +143,37 @@

seen.set(value, fullResult);
return fullResult;
}
if (value instanceof RegExp) {
const result = [{[REGEXP]: [value.source, value.flags]}];
const fullResult: EncodeResult = [result, transferables];
seen.set(value, fullResult);
return fullResult;
}
if (value instanceof Date) {
const result = [{[DATE]: value.toISOString()}];
const fullResult: EncodeResult = [result, transferables];
seen.set(value, fullResult);
return fullResult;
}
if (value instanceof Map) {
const entries = [...value.entries()].map(([key, value]) => {
return [encodeValue(key), encodeValue(value)];
});
const result = [{[MAP]: entries}];
const fullResult: EncodeResult = [result, transferables];
seen.set(value, fullResult);
return fullResult;
}
if (value instanceof Set) {
const entries = [...value].map((entry) => encodeValue(entry));
const result = [{[SET]: entries}];
const fullResult: EncodeResult = [result, transferables];
seen.set(value, fullResult);
return fullResult;
}
const valueIsIterator = isIterator(value);

@@ -209,2 +244,27 @@

if (REGEXP in value) {
return new RegExp(...(value as {[REGEXP]: [string, string]})[REGEXP]);
}
if (DATE in value) {
return new Date((value as {[DATE]: string})[DATE]);
}
if (MAP in value) {
return new Map(
(value as {[MAP]: [any, any]})[MAP].map(([key, value]) => [
decode(key, retainedBy),
decode(value, retainedBy),
]),
);
}
if (SET in value) {
return new Set(
(value as {[SET]: any[]})[SET].map((entry) =>
decode(entry, retainedBy),
),
);
}
if (FUNCTION in value) {

@@ -211,0 +271,0 @@ const id = (value as {[FUNCTION]: string})[FUNCTION];

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

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