Upakovka v Electron.JS no po staroy sborke cherez .cjs
This commit is contained in:
26
node_modules/onetime/readme.md
generated
vendored
26
node_modules/onetime/readme.md
generated
vendored
@@ -1,4 +1,4 @@
|
||||
# onetime
|
||||
# onetime [](https://travis-ci.com/github/sindresorhus/onetime)
|
||||
|
||||
> Ensure a function is only called once
|
||||
|
||||
@@ -8,18 +8,18 @@ When called multiple times it will return the return value from the first call.
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
npm install onetime
|
||||
```
|
||||
$ npm install onetime
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
import onetime from 'onetime';
|
||||
const onetime = require('onetime');
|
||||
|
||||
let index = 0;
|
||||
let i = 0;
|
||||
|
||||
const foo = onetime(() => ++index);
|
||||
const foo = onetime(() => ++i);
|
||||
|
||||
foo(); //=> 1
|
||||
foo(); //=> 1
|
||||
@@ -29,7 +29,7 @@ onetime.callCount(foo); //=> 3
|
||||
```
|
||||
|
||||
```js
|
||||
import onetime from 'onetime';
|
||||
const onetime = require('onetime');
|
||||
|
||||
const foo = onetime(() => {}, {throw: true});
|
||||
|
||||
@@ -49,7 +49,7 @@ Returns a function that only calls `fn` once.
|
||||
|
||||
Type: `Function`
|
||||
|
||||
The function that should only be called once.
|
||||
Function that should only be called once.
|
||||
|
||||
#### options
|
||||
|
||||
@@ -69,7 +69,7 @@ Returns a number representing how many times `fn` has been called.
|
||||
Note: It throws an error if you pass in a function that is not wrapped by `onetime`.
|
||||
|
||||
```js
|
||||
import onetime from 'onetime';
|
||||
const onetime = require('onetime');
|
||||
|
||||
const foo = onetime(() => {});
|
||||
|
||||
@@ -85,4 +85,10 @@ console.log(onetime.callCount(foo));
|
||||
|
||||
Type: `Function`
|
||||
|
||||
The function to get call count from.
|
||||
Function to get call count from.
|
||||
|
||||
## onetime for enterprise
|
||||
|
||||
Available as part of the Tidelift Subscription.
|
||||
|
||||
The maintainers of onetime and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-onetime?utm_source=npm-onetime&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|
||||
|
||||
Reference in New Issue
Block a user