mirror of
https://github.com/S2-/minifyfromhtml.git
synced 2025-08-03 04:10:04 +02:00
use minify
This commit is contained in:
28
node_modules/try-to-catch/ChangeLog
generated
vendored
Normal file
28
node_modules/try-to-catch/ChangeLog
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
2018.11.08, v1.1.1
|
||||
|
||||
fix:
|
||||
- (try-to-catch) wraptile -> noArg
|
||||
|
||||
|
||||
2018.11.08, v1.1.0
|
||||
|
||||
feature:
|
||||
- (try-to-catch) add support of a functions
|
||||
- (package) redrun v7.0.2
|
||||
- (package) nyc v13.0.1
|
||||
- (package) eslint v5.6.0
|
||||
- (package) babel v7.0.0
|
||||
- (package) redrun v6.0.0
|
||||
|
||||
|
||||
2018.02.13, v1.0.2
|
||||
|
||||
fix:
|
||||
- (package) legacy
|
||||
|
||||
|
||||
2018.02.12, v1.0.1
|
||||
|
||||
feature:
|
||||
- (package) keywords: then
|
||||
|
21
node_modules/try-to-catch/LICENSE
generated
vendored
Normal file
21
node_modules/try-to-catch/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) coderaiser
|
||||
|
||||
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.
|
88
node_modules/try-to-catch/README.md
generated
vendored
Normal file
88
node_modules/try-to-catch/README.md
generated
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
# Try to Catch [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL]
|
||||
|
||||
[NPMIMGURL]: https://img.shields.io/npm/v/try-to-catch.svg?style=flat&longCache=true
|
||||
[BuildStatusIMGURL]: https://img.shields.io/travis/coderaiser/try-to-catch/master.svg?style=flat&longCache=true
|
||||
[DependencyStatusIMGURL]: https://img.shields.io/david/coderaiser/try-to-catch.svg?style=flat&longCache=true
|
||||
[NPMURL]: https://npmjs.org/package/try-to-catch "npm"
|
||||
[BuildStatusURL]: https://travis-ci.org/coderaiser/try-to-catch "Build Status"
|
||||
[DependencyStatusURL]: https://david-dm.org/coderaiser/try-to-catch "Dependency Status"
|
||||
|
||||
[CoverageURL]: https://coveralls.io/github/coderaiser/try-to-catch?branch=master
|
||||
[CoverageIMGURL]: https://coveralls.io/repos/coderaiser/try-to-catch/badge.svg?branch=master&service=github
|
||||
|
||||
Functional `try-catch` wrapper for `promises`.
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
npm i try-to-catch
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### tryToCatch(fn, [...args])
|
||||
|
||||
Wrap function to avoid `try-catch` block, resolves `[error, result]`;
|
||||
|
||||
### Example
|
||||
|
||||
Simplest example with `async-await`:
|
||||
|
||||
```js
|
||||
const tryToCatch = require('try-to-catch');
|
||||
await tryToCatch(Promise.reject('hi'));
|
||||
// returns
|
||||
[ Error: hi]
|
||||
```
|
||||
|
||||
Can be used with functions:
|
||||
|
||||
```js
|
||||
const tryToCatch = require('try-to-catch');
|
||||
await tryToCatch(() => 5);
|
||||
// returns
|
||||
[null, 5]
|
||||
```
|
||||
|
||||
Advanced example:
|
||||
|
||||
```js
|
||||
const fs = require('fs');
|
||||
const tryToCatch = require('try-to-catch');
|
||||
const {promisify} = require('util');
|
||||
const readFile = promisify(fs.readFile);
|
||||
const readDir = promisify(fs.readdir);
|
||||
|
||||
read(process.argv[2])
|
||||
.then(console.log)
|
||||
.catch(console.error);
|
||||
|
||||
async function read(path) {
|
||||
const [error, data] = await tryToCatch(readFile, path, 'utf8');
|
||||
|
||||
if (!error)
|
||||
return data;
|
||||
|
||||
if (error.code !== 'EISDIR')
|
||||
return error;
|
||||
|
||||
return await readDir(path);
|
||||
}
|
||||
```
|
||||
|
||||
## Environments
|
||||
|
||||
In old `node.js` environments that not fully supports `es2015`, `try-to-catch` can be used with:
|
||||
|
||||
```js
|
||||
var tryToCatch = require('try-to-catch/legacy');
|
||||
```
|
||||
|
||||
## Related
|
||||
|
||||
- [try-catch](https://github.com/coderaiser/try-catch "try-catch") - functional try-catch wrapper.
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
|
1
node_modules/try-to-catch/legacy/index.js
generated
vendored
Normal file
1
node_modules/try-to-catch/legacy/index.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
module.exports = require('./try-to-catch')
|
37
node_modules/try-to-catch/legacy/try-to-catch.js
generated
vendored
Normal file
37
node_modules/try-to-catch/legacy/try-to-catch.js
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
'use strict';
|
||||
|
||||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
|
||||
|
||||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
|
||||
|
||||
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
|
||||
|
||||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
|
||||
|
||||
var success = function success(a) {
|
||||
return [null, a];
|
||||
};
|
||||
|
||||
var fail = function fail(a) {
|
||||
return [a];
|
||||
};
|
||||
|
||||
var noArg = function noArg(f, a) {
|
||||
return function () {
|
||||
return f.apply(void 0, _toConsumableArray(a));
|
||||
};
|
||||
};
|
||||
|
||||
module.exports = function (fn) {
|
||||
check(fn);
|
||||
|
||||
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
||||
args[_key - 1] = arguments[_key];
|
||||
}
|
||||
|
||||
return Promise.resolve().then(noArg(fn, args)).then(success).catch(fail);
|
||||
};
|
||||
|
||||
function check(fn) {
|
||||
if (typeof fn !== 'function') throw Error('fn should be a function!');
|
||||
}
|
21
node_modules/try-to-catch/lib/try-to-catch.js
generated
vendored
Normal file
21
node_modules/try-to-catch/lib/try-to-catch.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
'use strict';
|
||||
|
||||
const success = (a) => [null, a];
|
||||
const fail = (a) => [a];
|
||||
|
||||
const noArg = (f, a) => () => f(...a);
|
||||
|
||||
module.exports = (fn, ...args) => {
|
||||
check(fn);
|
||||
|
||||
return Promise.resolve()
|
||||
.then(noArg(fn, args))
|
||||
.then(success)
|
||||
.catch(fail);
|
||||
};
|
||||
|
||||
function check(fn) {
|
||||
if (typeof fn !== 'function')
|
||||
throw Error('fn should be a function!');
|
||||
}
|
||||
|
78
node_modules/try-to-catch/package.json
generated
vendored
Normal file
78
node_modules/try-to-catch/package.json
generated
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
{
|
||||
"_from": "try-to-catch@^1.0.2",
|
||||
"_id": "try-to-catch@1.1.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-ikUlS+/BcImLhNYyIgZcEmq4byc31QpC+46/6Jm5ECWkVFhf8SM2Fp/0pMVXPX6vk45SMCwrP4Taxucne8I0VA==",
|
||||
"_location": "/try-to-catch",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "try-to-catch@^1.0.2",
|
||||
"name": "try-to-catch",
|
||||
"escapedName": "try-to-catch",
|
||||
"rawSpec": "^1.0.2",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.2"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/minify"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/try-to-catch/-/try-to-catch-1.1.1.tgz",
|
||||
"_shasum": "770162dd13b9a0e55da04db5b7f888956072038a",
|
||||
"_spec": "try-to-catch@^1.0.2",
|
||||
"_where": "F:\\projects\\p\\minifyfromhtml\\node_modules\\minify",
|
||||
"author": {
|
||||
"name": "coderaiser",
|
||||
"email": "mnemonic.enemy@gmail.com",
|
||||
"url": "https://github.com/coderaiser"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/coderaiser/try-to-catch/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {},
|
||||
"deprecated": false,
|
||||
"description": "function try-catch wrapper for promises",
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.0.0",
|
||||
"@babel/core": "^7.0.0",
|
||||
"@babel/preset-env": "^7.0.0",
|
||||
"coveralls": "^3.0.0",
|
||||
"eslint": "^5.6.0",
|
||||
"nodemon": "^1.14.12",
|
||||
"nyc": "^13.0.1",
|
||||
"redrun": "^7.0.2",
|
||||
"tape": "^4.8.0",
|
||||
"try-to-tape": "^1.0.0"
|
||||
},
|
||||
"homepage": "http://github.com/coderaiser/try-to-catch",
|
||||
"keywords": [
|
||||
"try",
|
||||
"catch",
|
||||
"function",
|
||||
"promise",
|
||||
"async",
|
||||
"await",
|
||||
"try-catch",
|
||||
"then"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "lib/try-to-catch.js",
|
||||
"name": "try-to-catch",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/coderaiser/try-to-catch.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "babel lib -d legacy",
|
||||
"coverage": "nyc npm test",
|
||||
"legacy": "echo \"module.exports = require('./try-to-catch')\" > legacy/index.js",
|
||||
"lint": "eslint lib test",
|
||||
"report": "nyc report --reporter=text-lcov | coveralls",
|
||||
"test": "tape 'test/*.js'",
|
||||
"watch:test": "nodemon -w lib -w test -x \"npm test\"",
|
||||
"wisdom": "redrun build legacy"
|
||||
},
|
||||
"version": "1.1.1"
|
||||
}
|
Reference in New Issue
Block a user