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

@exodus/atoms

Package Overview
Dependencies
Maintainers
90
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@exodus/atoms - npm Package Compare versions

Comparing version 5.7.1 to 5.7.2

CHANGELOG.md

7

package.json
{
"name": "@exodus/atoms",
"version": "5.7.1",
"version": "5.7.2",
"main": "src/index.js",

@@ -13,3 +13,4 @@ "description": "Abstraction for encapsulating a piece of data behind a simple unified interface: get, set, observe",

"files": [
"src"
"src",
"CHANGELOG.md"
],

@@ -40,3 +41,3 @@ "repository": {

},
"gitHead": "ac180dfc636ccb393938aefa88e3824471646f8b"
"gitHead": "cb5b1ba99a8fb8fe272f76ff61eb94490006c8f7"
}
import assert from 'minimalistic-assert'
import { isEqual as deepEqual } from 'lodash'
const STRINGIFY_LIMIT = 1000
/**
* Serialize an object to a JSON string with a limit on the number of properties shown
* @param {Object} obj - The object to be serialized
* @param {number} limit - The maximum number of properties to include in the output
* @returns {string} - The JSON string representation of the object
*/
const limitedStringify = (obj, limit = STRINGIFY_LIMIT) => {
let count = 0
return JSON.stringify(obj, (_, value) => {
if (count > limit) {
return
}
if (count === limit) {
count++
return '...more properties not shown'
}
count++
return value
})
}
const warnOnSameValueSet = ({ atom, isEqual = deepEqual, logger }) => {

@@ -11,4 +37,5 @@ assert(atom, 'expected "atom')

if (value !== undefined && isEqual(value, previousValue)) {
// limit value shown to avoid a CPU spike that can lead to Android freezing
logger.warn(
`Atom was called with the same value it currently holds: ${JSON.stringify(value)}`
`Atom was called with the same value it currently holds: ${limitedStringify(value)}`
)

@@ -15,0 +42,0 @@ }

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