New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@helios-lang/type-utils

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@helios-lang/type-utils - npm Package Compare versions

Comparing version 0.1.8 to 0.1.9

4

package.json
{
"name": "@helios-lang/type-utils",
"version": "0.1.8",
"version": "0.1.9",
"description": "Global utility types",

@@ -9,3 +9,3 @@ "main": "src/index.js",

"scripts": {
"build": "npm test",
"build": "npm run prettify && npm run test:types",
"prepare": "npm run build",

@@ -12,0 +12,0 @@ "prettify": "npx prettier . --write",

declare global {
type Option<T> = null | undefined | T
type Either<L, R> = { left: L } | { right: R } // use right to represent a correct value, left for errors
type JsonSafe =
| (string | number | boolean | null)
| JsonSafe[]
| { [key: string]: JsonSafe }
namespace Json {
function parse(
text: string,
reviver?: ((this: any, key: string, value: any) => any) | undefined
): JsonSafe
function stringify(
value: JsonSafe,
replacer?:
| ((this: any, key: string, value: any) => any)
| undefined,
space?: string | number | undefined
): string
}
}

@@ -5,0 +23,0 @@

@@ -77,3 +77,3 @@ /**

either,
msg = `expected Either.right, got ${either}`
msg = `expected Either.right, got ${JSON.stringify(either)}`
) {

@@ -106,1 +106,9 @@ if ("right" in either) {

}
/**
* Don't shadow `JSON` because that might break existing type-checks
*/
export const Json = {
parse: JSON.parse,
stringify: JSON.stringify
}
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