Socket
Socket
Sign inDemoInstall

@metamask/utils

Package Overview
Dependencies
Maintainers
10
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@metamask/utils - npm Package Compare versions

Comparing version 5.0.2 to 7.0.0

dist/cjs/assert.js

40

CHANGELOG.md

@@ -9,2 +9,35 @@ # Changelog

## [7.0.0]
### Added
- Add `getKnownPropertyNames` function ([#111](https://github.com/MetaMask/utils/pull/111))
### Changed
- **BREAKING:** Build the package as both CJS and ESM ([#115](https://github.com/MetaMask/utils/pull/115), [#124](https://github.com/MetaMask/utils/pull/124))
- It's no longer possible to import from the `dist` folder. Everything must be imported from `@metamask/utils`.
- Bump `semver` to `^7.5.4` ([#123](https://github.com/MetaMask/utils/pull/123))
## [6.2.0]
### Added
- Add address related utils ([#112](https://github.com/MetaMask/utils/pull/112))
- `isValidHexAddress` has been added to check the validity of an hex address
- `getChecksumAddress` has been added to calculate the ERC-55 mixed-case checksum of an hex address
- `isValidChecksumAddress` has been added to check the validity of an ERC-55 mixed-case checksum address
## [6.1.0]
### Added
- Add optional `destroy` method to `Keyring` type ([#108](https://github.com/MetaMask/utils/pull/108))
## [6.0.1]
### Fixed
- Strip `__proto__` and `constructor` JSON properties in `getSafeJson` ([#105](https://github.com/MetaMask/utils/pull/105))
## [6.0.0]
### Changed
- **BREAKING:** Bump minimum Node version to 16 ([#102](https://github.com/MetaMask/utils/pull/102))
- **BREAKING:** Target `ES2020` ([#102](https://github.com/MetaMask/utils/pull/102))
### Fixed
- Fix JSON validation security issue ([#103](https://github.com/MetaMask/utils/pull/103))
- This adds a new function `getSafeJson` which validates and returns sanitized JSON.
## [5.0.2]

@@ -145,3 +178,8 @@ ### Changed

[Unreleased]: https://github.com/MetaMask/utils/compare/v5.0.2...HEAD
[Unreleased]: https://github.com/MetaMask/utils/compare/v7.0.0...HEAD
[7.0.0]: https://github.com/MetaMask/utils/compare/v6.2.0...v7.0.0
[6.2.0]: https://github.com/MetaMask/utils/compare/v6.1.0...v6.2.0
[6.1.0]: https://github.com/MetaMask/utils/compare/v6.0.1...v6.1.0
[6.0.1]: https://github.com/MetaMask/utils/compare/v6.0.0...v6.0.1
[6.0.0]: https://github.com/MetaMask/utils/compare/v5.0.2...v6.0.0
[5.0.2]: https://github.com/MetaMask/utils/compare/v5.0.1...v5.0.2

@@ -148,0 +186,0 @@ [5.0.1]: https://github.com/MetaMask/utils/compare/v5.0.0...v5.0.1

90

package.json
{
"name": "@metamask/utils",
"version": "5.0.2",
"description": "Various JavaScript/TypeScript utilities of wide relevance to the MetaMask codebase.",
"version": "7.0.0",
"description": "Various JavaScript/TypeScript utilities of wide relevance to the MetaMask codebase",
"homepage": "https://github.com/MetaMask/utils#readme",
"bugs": {
"url": "https://github.com/MetaMask/utils/issues"
},
"repository": {

@@ -10,18 +14,37 @@ "type": "git",

"license": "ISC",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js",
"types": "./dist/types/index.d.ts"
},
"./package.json": "./package.json"
},
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
"types": "./dist/types/index.d.ts",
"files": [
"dist/"
"dist/cjs/**",
"dist/esm/**",
"dist/types/**"
],
"scripts": {
"build": "tsc --project tsconfig.build.json",
"build": "yarn build:source && yarn build:types",
"build:cjs": "swc src --out-dir dist/cjs --config-file .swcrc.build.json --config module.type=commonjs",
"build:clean": "rimraf dist && yarn build",
"build:docs": "typedoc",
"lint": "yarn lint:eslint && yarn lint:misc --check",
"build:esm": "swc src --out-dir dist/esm --config-file .swcrc.build.json --config module.type=es6 && yarn build:esm:package",
"build:esm:package": "echo >dist/esm/package.json \"{\\\"type\\\":\\\"module\\\"}\"",
"build:source": "yarn build:esm && yarn build:cjs",
"build:types": "tsc --project tsconfig.build.json",
"lint": "yarn lint:eslint && yarn lint:constraints && yarn lint:misc --check && yarn lint:dependencies --check && yarn lint:changelog",
"lint:changelog": "auto-changelog validate",
"lint:constraints": "yarn constraints",
"lint:dependencies": "depcheck && yarn dedupe",
"lint:eslint": "eslint . --cache --ext js,ts",
"lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write",
"lint:fix": "yarn lint:eslint --fix && yarn lint:constraints --fix && yarn lint:misc --write && yarn lint:dependencies && yarn lint:changelog",
"lint:misc": "prettier '**/*.json' '**/*.md' '!CHANGELOG.md' '**/*.yml' '!.yarnrc.yml' --ignore-path .gitignore --no-error-on-unmatched-pattern",
"prepack": "./scripts/prepack.sh",
"test": "yarn test:source && yarn test:types",
"test:source": "jest",
"test:source": "jest && jest-it-up",
"test:types": "tsd",

@@ -35,33 +58,41 @@ "test:watch": "jest --watch"

"@ethereumjs/tx": "^4.1.2",
"@noble/hashes": "^1.3.1",
"@types/debug": "^4.1.7",
"debug": "^4.3.4",
"semver": "^7.3.8",
"semver": "^7.5.4",
"superstruct": "^1.0.3"
},
"devDependencies": {
"@lavamoat/allow-scripts": "^2.0.3",
"@metamask/auto-changelog": "^2.3.0",
"@metamask/eslint-config": "^11.0.1",
"@metamask/eslint-config-jest": "^11.0.0",
"@metamask/eslint-config-nodejs": "^11.0.1",
"@metamask/eslint-config-typescript": "^11.0.0",
"@lavamoat/allow-scripts": "^2.3.1",
"@lavamoat/preinstall-always-fail": "^1.0.0",
"@metamask/auto-changelog": "^3.1.0",
"@metamask/eslint-config": "^12.0.0",
"@metamask/eslint-config-jest": "^12.0.0",
"@metamask/eslint-config-nodejs": "^12.0.0",
"@metamask/eslint-config-typescript": "^12.0.0",
"@swc/cli": "^0.1.62",
"@swc/core": "^1.3.66",
"@types/jest": "^28.1.7",
"@typescript-eslint/eslint-plugin": "^5.42.1",
"@typescript-eslint/parser": "^5.42.1",
"eslint": "^8.27.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^27.1.5",
"eslint-plugin-jsdoc": "^39.6.2",
"eslint-plugin-node": "^11.1.0",
"@types/node": "^17.0.23",
"@typescript-eslint/eslint-plugin": "^5.43.0",
"@typescript-eslint/parser": "^5.43.0",
"depcheck": "^1.4.3",
"eslint": "^8.44.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jest": "^27.2.2",
"eslint-plugin-jsdoc": "^39.9.1",
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-promise": "^6.1.1",
"jest": "^29.2.2",
"json-bigint": "^1.0.0",
"jest-it-up": "^2.0.2",
"prettier": "^2.7.1",
"prettier-plugin-packagejson": "^2.2.11",
"prettier-plugin-packagejson": "^2.3.0",
"rimraf": "^3.0.2",
"stdio-mock": "^1.2.0",
"ts-jest": "^29.0.3",
"ts-node": "^10.7.0",
"tsd": "^0.24.1",
"typedoc": "^0.23.10",
"typedoc": "^0.23.15",
"typescript": "~4.8.4"

@@ -71,3 +102,3 @@ },

"engines": {
"node": ">=14.0.0"
"node": ">=16.0.0"
},

@@ -80,3 +111,4 @@ "publishConfig": {

"allowScripts": {
"@lavamoat/preinstall-always-fail": false
"@lavamoat/preinstall-always-fail": false,
"@swc/core": true
}

@@ -83,0 +115,0 @@ },

@@ -21,7 +21,6 @@ # MetaMask Utils

- Install [Node.js](https://nodejs.org) version 12
- Install [Node.js](https://nodejs.org) version 16
- If you are using [nvm](https://github.com/creationix/nvm#installation) (recommended) running `nvm use` will automatically choose the right node version for you.
- Install [Yarn v1](https://yarnpkg.com/en/docs/install)
- Run `yarn setup` to install dependencies and run any required post-install scripts
- **Warning:** Do not use the `yarn` / `yarn install` command directly. Use `yarn setup` instead. The normal install command will skip required post-install scripts, leaving your development environment in an invalid state.
- Install [Yarn v3](https://yarnpkg.com/getting-started/install)
- Run `yarn install` to install dependencies and run any required post-install scripts

@@ -28,0 +27,0 @@ ### Testing and Linting

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