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

@rustable/utils

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rustable/utils - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

lib/mut.d.ts

1

lib/index.d.ts

@@ -7,1 +7,2 @@ export * from './clone';

export * from './type_id';
export * from './mut';

@@ -13,2 +13,4 @@ "use strict";

var mut = require("./mut.js");
exports.deepClone = clone.deepClone;

@@ -23,1 +25,3 @@

exports.typeId = type_id.typeId;
exports.Mut = mut.Mut;

2

package.json
{
"name": "@rustable/utils",
"version": "0.1.4",
"version": "0.1.5",
"description": "Utility TypeScript utilities inspired by Rust, providing type-safe implementations of HashMap, TypeId, deep cloning, hashing, and equality comparison",

@@ -5,0 +5,0 @@ "keywords": [

# @rustable/utils
This is the utilities package of the Rustable project, providing fundamental utilities and type management functionalities. The package implements essential features like type identification, object cloning, hashing, and string manipulation.
This is the utilities package of the Rustable project, providing fundamental utilities and type management functionalities. The package implements essential features like type identification, object cloning, hashing, string manipulation, and mutable references.

@@ -44,2 +44,7 @@ ## Installation

### Mutable Reference (`mut.ts`)
- Provides a mutable reference with getter and setter functions
- Supports generic types for flexible usage
## Usage

@@ -50,3 +55,3 @@

```typescript
import { typeId, clone, hash, stringify } from '@rustable/utils';
import { typeId, clone, hash, stringify, Mut } from '@rustable/utils';
```

@@ -112,2 +117,28 @@

### Example: Using Mutable Reference
```typescript
import { Mut } from '@rustable/utils';
let value = 10;
const mutRef = new Mut(
() => value,
(newValue) => {
value = newValue;
},
);
console.log(mutRef.value); // Output: 10
mutRef.value = 20;
console.log(mutRef.value); // Output: 20
// Using Mut.of static method
const anotherMutRef = Mut.of(
() => value,
(newValue) => {
value = newValue;
},
);
```
## Notes

@@ -118,2 +149,3 @@

- Generic type support is available where applicable
- The `Mut` class provides a way to create mutable references with custom getter and setter functions

@@ -120,0 +152,0 @@ ## License

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