Ignore:
Timestamp:
11/25/21 22:08:24 (3 years ago)
Author:
Ema <ema_spirova@…>
Branches:
master
Children:
8d391a1
Parents:
59329aa
Message:

primeNG components

Location:
trip-planner-front/node_modules/p-limit
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trip-planner-front/node_modules/p-limit/index.d.ts

    r59329aa re29cc2e  
    1 declare namespace pLimit {
    2         interface Limit {
    3                 /**
    4                 The number of promises that are currently running.
    5                 */
    6                 readonly activeCount: number;
     1export interface Limit {
     2        /**
     3        @param fn - Promise-returning/async function.
     4        @param arguments - Any arguments to pass through to `fn`. Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a lot of functions.
     5        @returns The promise returned by calling `fn(...arguments)`.
     6        */
     7        <Arguments extends unknown[], ReturnType>(
     8                fn: (...arguments: Arguments) => PromiseLike<ReturnType> | ReturnType,
     9                ...arguments: Arguments
     10        ): Promise<ReturnType>;
    711
    8                 /**
    9                 The number of promises that are waiting to run (i.e. their internal `fn` was not called yet).
    10                 */
    11                 readonly pendingCount: number;
     12        /**
     13        The number of promises that are currently running.
     14        */
     15        readonly activeCount: number;
    1216
    13                 /**
    14                 Discard pending promises that are waiting to run.
     17        /**
     18        The number of promises that are waiting to run (i.e. their internal `fn` was not called yet).
     19        */
     20        readonly pendingCount: number;
    1521
    16                 This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app.
     22        /**
     23        Discard pending promises that are waiting to run.
    1724
    18                 Note: This does not cancel promises that are already running.
    19                 */
    20                 clearQueue: () => void;
     25        This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app.
    2126
    22                 /**
    23                 @param fn - Promise-returning/async function.
    24                 @param arguments - Any arguments to pass through to `fn`. Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a lot of functions.
    25                 @returns The promise returned by calling `fn(...arguments)`.
    26                 */
    27                 <Arguments extends unknown[], ReturnType>(
    28                         fn: (...arguments: Arguments) => PromiseLike<ReturnType> | ReturnType,
    29                         ...arguments: Arguments
    30                 ): Promise<ReturnType>;
    31         }
     27        Note: This does not cancel promises that are already running.
     28        */
     29        clearQueue(): void;
    3230}
    3331
     
    3836@returns A `limit` function.
    3937*/
    40 declare function pLimit(concurrency: number): pLimit.Limit;
    41 
    42 export = pLimit;
     38export default function pLimit(concurrency: number): Limit;
  • trip-planner-front/node_modules/p-limit/index.js

    r59329aa re29cc2e  
    11'use strict';
    2 const Queue = require('yocto-queue');
     2const pTry = require('p-try');
    33
    44const pLimit = concurrency => {
    55        if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) {
    6                 throw new TypeError('Expected `concurrency` to be a number from 1 and up');
     6                return Promise.reject(new TypeError('Expected `concurrency` to be a number from 1 and up'));
    77        }
    88
    9         const queue = new Queue();
     9        const queue = [];
    1010        let activeCount = 0;
    1111
     
    1313                activeCount--;
    1414
    15                 if (queue.size > 0) {
    16                         queue.dequeue()();
     15                if (queue.length > 0) {
     16                        queue.shift()();
    1717                }
    1818        };
    1919
    20         const run = async (fn, resolve, ...args) => {
     20        const run = (fn, resolve, ...args) => {
    2121                activeCount++;
    2222
    23                 const result = (async () => fn(...args))();
     23                const result = pTry(fn, ...args);
    2424
    2525                resolve(result);
    2626
    27                 try {
    28                         await result;
    29                 } catch {}
    30 
    31                 next();
     27                result.then(next, next);
    3228        };
    3329
    3430        const enqueue = (fn, resolve, ...args) => {
    35                 queue.enqueue(run.bind(null, fn, resolve, ...args));
    36 
    37                 (async () => {
    38                         // This function needs to wait until the next microtask before comparing
    39                         // `activeCount` to `concurrency`, because `activeCount` is updated asynchronously
    40                         // when the run function is dequeued and called. The comparison in the if-statement
    41                         // needs to happen asynchronously as well to get an up-to-date value for `activeCount`.
    42                         await Promise.resolve();
    43 
    44                         if (activeCount < concurrency && queue.size > 0) {
    45                                 queue.dequeue()();
    46                         }
    47                 })();
     31                if (activeCount < concurrency) {
     32                        run(fn, resolve, ...args);
     33                } else {
     34                        queue.push(run.bind(null, fn, resolve, ...args));
     35                }
    4836        };
    4937
    50         const generator = (fn, ...args) => new Promise(resolve => {
    51                 enqueue(fn, resolve, ...args);
    52         });
    53 
     38        const generator = (fn, ...args) => new Promise(resolve => enqueue(fn, resolve, ...args));
    5439        Object.defineProperties(generator, {
    5540                activeCount: {
     
    5742                },
    5843                pendingCount: {
    59                         get: () => queue.size
     44                        get: () => queue.length
    6045                },
    6146                clearQueue: {
    6247                        value: () => {
    63                                 queue.clear();
     48                                queue.length = 0;
    6449                        }
    6550                }
     
    7055
    7156module.exports = pLimit;
     57module.exports.default = pLimit;
  • trip-planner-front/node_modules/p-limit/license

    r59329aa re29cc2e  
    11MIT License
    22
    3 Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
     3Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
    44
    55Permission 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:
  • trip-planner-front/node_modules/p-limit/package.json

    r59329aa re29cc2e  
    11{
    2   "_args": [
    3     [
    4       "p-limit@3.1.0",
    5       "C:\\Users\\DELL\\Desktop\\bachelor-thesis\\trip-planner-front"
    6     ]
    7   ],
    8   "_development": true,
    9   "_from": "p-limit@3.1.0",
    10   "_id": "p-limit@3.1.0",
     2  "_from": "p-limit@^2.2.0",
     3  "_id": "p-limit@2.3.0",
    114  "_inBundle": false,
    12   "_integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==",
     5  "_integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
    136  "_location": "/p-limit",
    147  "_phantomChildren": {},
    158  "_requested": {
    16     "type": "version",
     9    "type": "range",
    1710    "registry": true,
    18     "raw": "p-limit@3.1.0",
     11    "raw": "p-limit@^2.2.0",
    1912    "name": "p-limit",
    2013    "escapedName": "p-limit",
    21     "rawSpec": "3.1.0",
     14    "rawSpec": "^2.2.0",
    2215    "saveSpec": null,
    23     "fetchSpec": "3.1.0"
     16    "fetchSpec": "^2.2.0"
    2417  },
    2518  "_requiredBy": [
    26     "/copy-webpack-plugin",
    27     "/css-minimizer-webpack-plugin",
    28     "/terser-webpack-plugin"
     19    "/import-local/p-locate",
     20    "/p-locate",
     21    "/yargs/p-locate"
    2922  ],
    30   "_resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
    31   "_spec": "3.1.0",
    32   "_where": "C:\\Users\\DELL\\Desktop\\bachelor-thesis\\trip-planner-front",
     23  "_resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
     24  "_shasum": "3dd33c647a214fdfffd835933eb086da0dc21db1",
     25  "_spec": "p-limit@^2.2.0",
     26  "_where": "C:\\Users\\DELL\\Desktop\\bachelor-thesis\\trip-planner-front\\node_modules\\p-locate",
    3327  "author": {
    3428    "name": "Sindre Sorhus",
    3529    "email": "sindresorhus@gmail.com",
    36     "url": "https://sindresorhus.com"
     30    "url": "sindresorhus.com"
    3731  },
    3832  "bugs": {
    3933    "url": "https://github.com/sindresorhus/p-limit/issues"
    4034  },
     35  "bundleDependencies": false,
    4136  "dependencies": {
    42     "yocto-queue": "^0.1.0"
     37    "p-try": "^2.0.0"
    4338  },
     39  "deprecated": false,
    4440  "description": "Run multiple promise-returning & async functions with limited concurrency",
    4541  "devDependencies": {
    46     "ava": "^2.4.0",
    47     "delay": "^4.4.0",
    48     "in-range": "^2.0.0",
    49     "random-int": "^2.0.1",
    50     "time-span": "^4.0.0",
    51     "tsd": "^0.13.1",
    52     "xo": "^0.35.0"
     42    "ava": "^1.2.1",
     43    "delay": "^4.1.0",
     44    "in-range": "^1.0.0",
     45    "random-int": "^1.0.0",
     46    "time-span": "^2.0.0",
     47    "tsd-check": "^0.3.0",
     48    "xo": "^0.24.0"
    5349  },
    5450  "engines": {
    55     "node": ">=10"
     51    "node": ">=6"
    5652  },
    5753  "files": [
     
    8581  },
    8682  "scripts": {
    87     "test": "xo && ava && tsd"
     83    "test": "xo && ava && tsd-check"
    8884  },
    89   "version": "3.1.0"
     85  "version": "2.3.0"
    9086}
  • trip-planner-front/node_modules/p-limit/readme.md

    r59329aa re29cc2e  
    1 # p-limit
     1# p-limit [![Build Status](https://travis-ci.org/sindresorhus/p-limit.svg?branch=master)](https://travis-ci.org/sindresorhus/p-limit)
    22
    33> Run multiple promise-returning & async functions with limited concurrency
Note: See TracChangeset for help on using the changeset viewer.