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

@helios-lang/contract-utils

Package Overview
Dependencies
Maintainers
0
Versions
124
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version 0.2.75 to 0.2.76

2

package.json
{
"name": "@helios-lang/contract-utils",
"version": "0.2.75",
"version": "0.2.76",
"description": "Convenience and type-safety utilities for using Helios validators from within Typescript",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -0,1 +1,4 @@

import * as fs from "node:fs"
import * as os from "node:os"
import * as path from "node:path"
import { contractContextCache } from "./ContractContextCache.js"

@@ -14,20 +17,2 @@

* @private
* @type {typeof import("node:fs")}
*/
fs
/**
* @private
* @type {typeof import("node:os")}
*/
os
/**
* @private
* @type {typeof import("node:path")}
*/
path
/**
* @private
* @type {string}

@@ -38,19 +23,9 @@ */

constructor() {
// hopefully this loads before starting the context build
Promise.all([
import("node:fs"),
import("node:os"),
import("node:path")
]).then(([fs, os, path]) => {
this.fs = fs
this.os = os
this.path = path
this.cacheDir = this.path.join(this.os.tmpdir(), "helios-cache")
this.cacheDir = path.join(os.tmpdir(), "helios-cache")
if (!this.fs.existsSync(this.cacheDir)) {
this.fs.mkdirSync(this.cacheDir, {
recursive: true
})
}
})
if (!fs.existsSync(this.cacheDir)) {
fs.mkdirSync(this.cacheDir, {
recursive: true
})
}
}

@@ -63,3 +38,3 @@

genPath(key) {
return this.path.join(this.cacheDir, key + ".json")
return path.join(this.cacheDir, key + ".json")
}

@@ -71,3 +46,3 @@

has(key) {
return this.fs.existsSync(this.genPath(key))
return fs.existsSync(this.genPath(key))
}

@@ -80,3 +55,3 @@

get(key) {
return JSON.parse(this.fs.readFileSync(this.genPath(key)).toString())
return JSON.parse(fs.readFileSync(this.genPath(key)).toString())
}

@@ -89,3 +64,3 @@

set(key, obj) {
this.fs.writeFileSync(this.genPath(key), JSON.stringify(obj))
fs.writeFileSync(this.genPath(key), JSON.stringify(obj))
}

@@ -92,0 +67,0 @@ }

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