aboutsummaryrefslogtreecommitdiff
path: root/sandbox/testAppNevena/Front/node_modules/run-async
diff options
context:
space:
mode:
authorNevena Bojovic <nenabojov@gmail.com>2022-03-01 22:05:25 +0100
committerNevena Bojovic <nenabojov@gmail.com>2022-03-01 22:05:25 +0100
commit6555fb80fdd8f6a5d201efadec3189d1244830a0 (patch)
treec1aa1c5aedc634ad1ea7fad4847884d559b51290 /sandbox/testAppNevena/Front/node_modules/run-async
parent7d3640f824f46490b47bd95f1c5a16644f712068 (diff)
Izbrisala bin, obj i node-modules.
Diffstat (limited to 'sandbox/testAppNevena/Front/node_modules/run-async')
-rw-r--r--sandbox/testAppNevena/Front/node_modules/run-async/LICENSE21
-rw-r--r--sandbox/testAppNevena/Front/node_modules/run-async/README.md79
-rw-r--r--sandbox/testAppNevena/Front/node_modules/run-async/index.js98
-rw-r--r--sandbox/testAppNevena/Front/node_modules/run-async/package.json27
4 files changed, 0 insertions, 225 deletions
diff --git a/sandbox/testAppNevena/Front/node_modules/run-async/LICENSE b/sandbox/testAppNevena/Front/node_modules/run-async/LICENSE
deleted file mode 100644
index e895e99b..00000000
--- a/sandbox/testAppNevena/Front/node_modules/run-async/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2014 Simon Boudrias
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/sandbox/testAppNevena/Front/node_modules/run-async/README.md b/sandbox/testAppNevena/Front/node_modules/run-async/README.md
deleted file mode 100644
index 8eb62c24..00000000
--- a/sandbox/testAppNevena/Front/node_modules/run-async/README.md
+++ /dev/null
@@ -1,79 +0,0 @@
-Run Async
-=========
-
-[![npm](https://badge.fury.io/js/run-async.svg)](http://badge.fury.io/js/run-async) [![tests](https://travis-ci.org/SBoudrias/run-async.svg?branch=master)](http://travis-ci.org/SBoudrias/run-async) [![dependencies](https://david-dm.org/SBoudrias/run-async.svg?theme=shields.io)](https://david-dm.org/SBoudrias/run-async)
-
-Utility method to run a function either synchronously or asynchronously using a series of common patterns. This is useful for library author accepting sync or async functions as parameter. `runAsync` will always run them as an async method, and normalize the multiple signature.
-
-Installation
-=========
-
-```bash
-npm install --save run-async
-```
-
-Usage
-=========
-
-Here's a simple example print the function results and three options a user can provide a function.
-
-```js
-var runAsync = require('run-async');
-
-var printAfter = function (func) {
- var cb = function (err, returnValue) {
- console.log(returnValue);
- };
- runAsync(func, cb)(/* arguments for func */);
-};
-```
-
-#### Using `this.async`
-```js
-printAfter(function () {
- var done = this.async();
-
- setTimeout(function () {
- done(null, 'done running with callback');
- }, 10);
-});
-```
-
-#### Returning a promise
-```js
-printAfter(function () {
- return new Promise(function (resolve, reject) {
- resolve('done running with promises');
- });
-});
-```
-
-#### Synchronous function
-```js
-printAfter(function () {
- return 'done running sync function';
-});
-```
-
-### runAsync.cb
-
-`runAsync.cb` supports all the function types that `runAsync` does and additionally a traditional **callback as the last argument** signature:
-
-```js
-var runAsync = require('run-async');
-
-// IMPORTANT: The wrapped function must have a fixed number of parameters.
-runAsync.cb(function(a, b, cb) {
- cb(null, a + b);
-}, function(err, result) {
- console.log(result)
-})(1, 2)
-```
-
-If your version of node support Promises natively (node >= 0.12), `runAsync` will return a promise. Example: `runAsync(func)(arg1, arg2).then(cb)`
-
-Licence
-========
-
-Copyright (c) 2014 Simon Boudrias (twitter: @vaxilart)
-Licensed under the MIT license.
diff --git a/sandbox/testAppNevena/Front/node_modules/run-async/index.js b/sandbox/testAppNevena/Front/node_modules/run-async/index.js
deleted file mode 100644
index c7a2e65d..00000000
--- a/sandbox/testAppNevena/Front/node_modules/run-async/index.js
+++ /dev/null
@@ -1,98 +0,0 @@
-'use strict';
-
-function isPromise(obj) {
- return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
-}
-
-/**
- * Return a function that will run a function asynchronously or synchronously
- *
- * example:
- * runAsync(wrappedFunction, callback)(...args);
- *
- * @param {Function} func Function to run
- * @param {Function} cb Callback function passed the `func` returned value
- * @return {Function(arguments)} Arguments to pass to `func`. This function will in turn
- * return a Promise (Node >= 0.12) or call the callbacks.
- */
-
-var runAsync = module.exports = function (func, cb) {
- cb = cb || function () {};
-
- return function () {
-
- var args = arguments;
-
- var promise = new Promise(function (resolve, reject) {
- var resolved = false;
- const wrappedResolve = function (value) {
- if (resolved) {
- console.warn('Run-async promise already resolved.')
- }
- resolved = true;
- resolve(value);
- }
-
- var rejected = false;
- const wrappedReject = function (value) {
- if (rejected) {
- console.warn('Run-async promise already rejected.')
- }
- rejected = true;
- reject(value);
- }
-
- var usingCallback = false;
- var callbackConflict = false;
- var contextEnded = false;
-
- var answer = func.apply({
- async: function () {
- if (contextEnded) {
- console.warn('Run-async async() called outside a valid run-async context, callback will be ignored.');
- return function() {};
- }
- if (callbackConflict) {
- console.warn('Run-async wrapped function (async) returned a promise.\nCalls to async() callback can have unexpected results.');
- }
- usingCallback = true;
- return function (err, value) {
- if (err) {
- wrappedReject(err);
- } else {
- wrappedResolve(value);
- }
- };
- }
- }, Array.prototype.slice.call(args));
-
- if (usingCallback) {
- if (isPromise(answer)) {
- console.warn('Run-async wrapped function (sync) returned a promise but async() callback must be executed to resolve.');
- }
- } else {
- if (isPromise(answer)) {
- callbackConflict = true;
- answer.then(wrappedResolve, wrappedReject);
- } else {
- wrappedResolve(answer);
- }
- }
- contextEnded = true;
- });
-
- promise.then(cb.bind(null, null), cb);
-
- return promise;
- }
-};
-
-runAsync.cb = function (func, cb) {
- return runAsync(function () {
- var args = Array.prototype.slice.call(arguments);
- if (args.length === func.length - 1) {
- args.push(this.async());
- }
- return func.apply(this, args);
- }, cb);
-};
diff --git a/sandbox/testAppNevena/Front/node_modules/run-async/package.json b/sandbox/testAppNevena/Front/node_modules/run-async/package.json
deleted file mode 100644
index b923265d..00000000
--- a/sandbox/testAppNevena/Front/node_modules/run-async/package.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "name": "run-async",
- "version": "2.4.1",
- "description": "Utility method to run function either synchronously or asynchronously using the common `this.async()` style.",
- "main": "index.js",
- "scripts": {
- "test": "mocha -R spec"
- },
- "engines": {
- "node": ">=0.12.0"
- },
- "repository": "SBoudrias/run-async",
- "keywords": [
- "flow",
- "flow-control",
- "async"
- ],
- "files": [
- "index.js"
- ],
- "author": "Simon Boudrias <admin@simonboudrias.com>",
- "license": "MIT",
- "dependencies": {},
- "devDependencies": {
- "mocha": "^7.1.0"
- }
-}