Socket
Socket
Sign inDemoInstall

@arcblock/forge-util

Package Overview
Dependencies
Maintainers
1
Versions
102
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@arcblock/forge-util - npm Package Compare versions

Comparing version 0.29.0 to 0.29.3

15

lib/index.d.ts

@@ -12,2 +12,15 @@ // Generate by [js2dts@0.3.3](https://github.com/whxaxes/js2dts#readme)

declare function isUint8Array(value: any): boolean;
/**
* Generate a random UUID
*
* @returns {string} generated uuid
*/
declare function UUID(): string;
/**
* Check if a string is valid UUID
*
* @param {string} str
* @returns {boolean}
*/
declare function isUUID(str: string): boolean;
declare const _Lib: _Lib.T100;

@@ -36,4 +49,6 @@ declare namespace _Lib {

toBN: (number: any) => any;
UUID: typeof UUID;
isUUID: typeof isUUID;
}
}
export = _Lib;

@@ -483,2 +483,25 @@ /* eslint-disable no-bitwise */

/**
* Generate a random UUID
*
* @returns {string} generated uuid
*/
function UUID() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
const r = (Math.random() * 16) | 0;
const v = c === 'x' ? r : (r & 0x3) | 0x8;
return v.toString(16);
});
}
/**
* Check if a string is valid UUID
*
* @param {string} str
* @returns {boolean}
*/
function isUUID(str) {
return /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(str);
}
module.exports = {

@@ -505,2 +528,4 @@ isBN,

toBN,
UUID,
isUUID,
};

4

package.json
{
"name": "@arcblock/forge-util",
"version": "0.29.0",
"version": "0.29.3",
"description": "utils shared across mutlipe forge js libs, works in both node.js and browser",

@@ -54,3 +54,3 @@ "keywords": [

},
"gitHead": "6e922db0d834db071d8208d56cbf46175192e301"
"gitHead": "7df2a2535997bb7606e9ada527d103f47fa698b8"
}
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