Current Folder

This commit is contained in:
Luis Fernando Molina committed 2020-11-20 14:05:59 +01:00
1 parent 8b3382289b
commit cfcada880d
4379 files changed

No files matched your search

+64
View File
@@ -0,0 +1,64 @@
/*
This file is part of web3.js.
web3.js is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
web3.js is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with web3.js. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file index.js
* @author Fabian Vogelsteller <fabian@ethereum.org>
* @date 2016
*/
"use strict";
var EventEmitter = require('eventemitter3');
/**
* This function generates a defer promise and adds eventEmitter functionality to it
*
* @method eventifiedPromise
*/
var PromiEvent = function PromiEvent(justPromise) {
var resolve, reject, eventEmitter = new Promise(function () {
resolve = arguments[0];
reject = arguments[1];
});
if (justPromise) {
return {
resolve: resolve,
reject: reject,
eventEmitter: eventEmitter
};
}
// get eventEmitter
var emitter = new EventEmitter();
// add eventEmitter to the promise
eventEmitter._events = emitter._events;
eventEmitter.emit = emitter.emit;
eventEmitter.on = emitter.on;
eventEmitter.once = emitter.once;
eventEmitter.off = emitter.off;
eventEmitter.listeners = emitter.listeners;
eventEmitter.addListener = emitter.addListener;
eventEmitter.removeListener = emitter.removeListener;
eventEmitter.removeAllListeners = emitter.removeAllListeners;
return {
resolve: resolve,
reject: reject,
eventEmitter: eventEmitter
};
};
PromiEvent.resolve = function (value) {
var promise = PromiEvent(true);
promise.resolve(value);
return promise.eventEmitter;
};
module.exports = PromiEvent;
+48
View File
@@ -0,0 +1,48 @@
{
"_from": "web3-core-promievent@1.3.0",
"_id": "web3-core-promievent@1.3.0",
"_inBundle": false,
"_integrity": "sha512-blv69wrXw447TP3iPvYJpllkhW6B18nfuEbrfcr3n2Y0v1Jx8VJacNZFDFsFIcgXcgUIVCtOpimU7w9v4+rtaw==",
"_location": "/web3-core-promievent",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "web3-core-promievent@1.3.0",
"name": "web3-core-promievent",
"escapedName": "web3-core-promievent",
"rawSpec": "1.3.0",
"saveSpec": null,
"fetchSpec": "1.3.0"
},
"_requiredBy": [
"/web3-core-method",
"/web3-eth-contract",
"/web3-eth-ens"
],
"_resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.3.0.tgz",
"_shasum": "e0442dd0a8989b6bdce09293976cee6d9237a484",
"_spec": "web3-core-promievent@1.3.0",
"_where": "C:\\Users\\Luis\\source\\repos\\AAMasters\\BackendServers\\node_modules\\web3-core-method",
"bundleDependencies": false,
"dependencies": {
"eventemitter3": "4.0.4"
},
"deprecated": false,
"description": "This package extends the EventEmitter with the Promise class to allow chaining as well as multiple final states of a function.",
"engines": {
"node": ">=8.0.0"
},
"gitHead": "a88944fff1f62b2b6f00e3de52446d24d9e92cc6",
"license": "LGPL-3.0",
"main": "lib/index.js",
"name": "web3-core-promievent",
"repository": {
"type": "git",
"url": "https://github.com/ethereum/web3.js/tree/1.x/packages/web3-core-promievent"
},
"scripts": {
"tsc": "tsc -b tsconfig.json"
},
"version": "1.3.0"
}
+74
View File
@@ -0,0 +1,74 @@
/*
This file is part of web3.js.
web3.js is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
web3.js is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with web3.js. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file index.js
* @author Fabian Vogelsteller <fabian@ethereum.org>
* @date 2016
*/
"use strict";
var EventEmitter = require('eventemitter3');
/**
* This function generates a defer promise and adds eventEmitter functionality to it
*
* @method eventifiedPromise
*/
var PromiEvent = function PromiEvent(justPromise) {
var resolve, reject,
eventEmitter = new Promise(function() {
resolve = arguments[0];
reject = arguments[1];
});
if(justPromise) {
return {
resolve: resolve,
reject: reject,
eventEmitter: eventEmitter
};
}
// get eventEmitter
var emitter = new EventEmitter();
// add eventEmitter to the promise
eventEmitter._events = emitter._events;
eventEmitter.emit = emitter.emit;
eventEmitter.on = emitter.on;
eventEmitter.once = emitter.once;
eventEmitter.off = emitter.off;
eventEmitter.listeners = emitter.listeners;
eventEmitter.addListener = emitter.addListener;
eventEmitter.removeListener = emitter.removeListener;
eventEmitter.removeAllListeners = emitter.removeAllListeners;
return {
resolve: resolve,
reject: reject,
eventEmitter: eventEmitter
};
};
PromiEvent.resolve = function(value) {
var promise = PromiEvent(true);
promise.resolve(value);
return promise.eventEmitter;
};
module.exports = PromiEvent;
+9
View File
@@ -0,0 +1,9 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./lib"
},
"include": [
"./src"
]
}