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

@polkadot/util

Package Overview
Dependencies
Maintainers
1
Versions
1411
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@polkadot/util - npm Package Compare versions

Comparing version 0.8.3 to 0.9.1

string/index.js

3

index.js

@@ -22,2 +22,3 @@ 'use strict';

var promisify = require('./promisify');
var string = require('./string');
var u8a = require('./u8a');

@@ -28,2 +29,2 @@

*/
module.exports = (0, _assign2.default)({}, array, { assert: assert }, bn, buffer, ext, hex, is, jsonrpc, keccak, { logger: logger }, number, { promisify: promisify }, u8a);
module.exports = (0, _assign2.default)({}, array, { assert: assert }, bn, buffer, ext, hex, is, jsonrpc, keccak, { logger: logger }, number, { promisify: promisify }, string, u8a);
{
"name": "@polkadot/util",
"version": "0.8.3",
"version": "0.9.1",
"description": "A collection of useful utilities for @polkadot",

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

@@ -15,3 +15,3 @@ 'use strict';

@name promisify
@signature function promisify (fn: (any) => void, ...params: Array<any>): Promise<any>
@signature function promisify (this: any, fn: Function, ...params: Array<any>): Promise<any>
@summary Wraps an async callback into a `Promise`

@@ -23,8 +23,8 @@ @description

await promisify((a, cb) => cb(null, a), true); // resolves with `true`
await promisify((cb) => cb(new Error('error!'))); // rejects with `error!`
await promisify(null, ((a, cb) => cb(null, a), true); // resolves with `true`
await promisify(null, (cb) => cb(new Error('error!'))); // rejects with `error!`
*/
module.exports = function promisify(fn) {
for (var _len = arguments.length, params = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
params[_key - 1] = arguments[_key];
module.exports = function promisify(self, fn) {
for (var _len = arguments.length, params = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
params[_key - 2] = arguments[_key];
}

@@ -35,3 +35,3 @@

return new _promise2.default(function (resolve, reject) {
fn.apply(null, [].concat(params, [function (error, result) {
fn.apply(self, [].concat(params, [function (error, result) {
if (error) {

@@ -38,0 +38,0 @@ reject(error);

Sorry, the diff of this file is not supported yet

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