summaryrefslogtreecommitdiffstats
path: root/node_modules/nice-try
diff options
context:
space:
mode:
authorGravatar Piotr Russ <mail@pruss.it> 2020-11-16 00:10:28 +0100
committerGravatar Piotr Russ <mail@pruss.it> 2020-11-16 00:10:28 +0100
commite06ec920f7a5d784e674c4c4b4e6d1da3dc7391d (patch)
tree55713f725f77b44ebfec86e4eec3ce33e71458ca /node_modules/nice-try
downloadwebsite_creator-e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d.tar.gz
website_creator-e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d.tar.bz2
website_creator-e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d.zip
api, login, auth
Diffstat (limited to 'node_modules/nice-try')
-rw-r--r--node_modules/nice-try/CHANGELOG.md21
-rw-r--r--node_modules/nice-try/LICENSE21
-rw-r--r--node_modules/nice-try/README.md32
-rw-r--r--node_modules/nice-try/package.json61
-rw-r--r--node_modules/nice-try/src/index.js12
5 files changed, 147 insertions, 0 deletions
diff --git a/node_modules/nice-try/CHANGELOG.md b/node_modules/nice-try/CHANGELOG.md
new file mode 100644
index 0000000..9e6baf2
--- /dev/null
+++ b/node_modules/nice-try/CHANGELOG.md
@@ -0,0 +1,21 @@
+# Changelog
+
+All notable changes to this project will be documented in this file.
+
+The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
+
+## [1.0.5] - 2018-08-25
+
+### Changed
+
+- Removed `prepublish` script from `package.json`
+
+## [1.0.4] - 2017-08-08
+
+### New
+
+- Added a changelog
+
+### Changed
+
+- Ignore `yarn.lock` and `package-lock.json` files \ No newline at end of file
diff --git a/node_modules/nice-try/LICENSE b/node_modules/nice-try/LICENSE
new file mode 100644
index 0000000..681c8f5
--- /dev/null
+++ b/node_modules/nice-try/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2018 Tobias Reich
+
+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/node_modules/nice-try/README.md b/node_modules/nice-try/README.md
new file mode 100644
index 0000000..5b83b78
--- /dev/null
+++ b/node_modules/nice-try/README.md
@@ -0,0 +1,32 @@
+# nice-try
+
+[![Travis Build Status](https://travis-ci.org/electerious/nice-try.svg?branch=master)](https://travis-ci.org/electerious/nice-try) [![AppVeyor Status](https://ci.appveyor.com/api/projects/status/8tqb09wrwci3xf8l?svg=true)](https://ci.appveyor.com/project/electerious/nice-try) [![Coverage Status](https://coveralls.io/repos/github/electerious/nice-try/badge.svg?branch=master)](https://coveralls.io/github/electerious/nice-try?branch=master) [![Dependencies](https://david-dm.org/electerious/nice-try.svg)](https://david-dm.org/electerious/nice-try#info=dependencies) [![Greenkeeper badge](https://badges.greenkeeper.io/electerious/nice-try.svg)](https://greenkeeper.io/)
+
+A function that tries to execute a function and discards any error that occurs.
+
+## Install
+
+```
+npm install nice-try
+```
+
+## Usage
+
+```js
+const niceTry = require('nice-try')
+
+niceTry(() => JSON.parse('true')) // true
+niceTry(() => JSON.parse('truee')) // undefined
+niceTry() // undefined
+niceTry(true) // undefined
+```
+
+## API
+
+### Parameters
+
+- `fn` `{Function}` Function that might or might not throw an error.
+
+### Returns
+
+- `{?*}` Return-value of the function when no error occurred. \ No newline at end of file
diff --git a/node_modules/nice-try/package.json b/node_modules/nice-try/package.json
new file mode 100644
index 0000000..f72fed4
--- /dev/null
+++ b/node_modules/nice-try/package.json
@@ -0,0 +1,61 @@
+{
+ "_from": "nice-try@^1.0.4",
+ "_id": "nice-try@1.0.5",
+ "_inBundle": false,
+ "_integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
+ "_location": "/nice-try",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "nice-try@^1.0.4",
+ "name": "nice-try",
+ "escapedName": "nice-try",
+ "rawSpec": "^1.0.4",
+ "saveSpec": null,
+ "fetchSpec": "^1.0.4"
+ },
+ "_requiredBy": [
+ "/cross-spawn"
+ ],
+ "_resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
+ "_shasum": "a3378a7696ce7d223e88fc9b764bd7ef1089e366",
+ "_spec": "nice-try@^1.0.4",
+ "_where": "/home/pruss/Dev/3-minute-website/node_modules/cross-spawn",
+ "authors": [
+ "Tobias Reich <tobias@electerious.com>"
+ ],
+ "bugs": {
+ "url": "https://github.com/electerious/nice-try/issues"
+ },
+ "bundleDependencies": false,
+ "deprecated": false,
+ "description": "Tries to execute a function and discards any error that occurs",
+ "devDependencies": {
+ "chai": "^4.1.2",
+ "coveralls": "^3.0.0",
+ "mocha": "^5.1.1",
+ "nyc": "^12.0.1"
+ },
+ "files": [
+ "src"
+ ],
+ "homepage": "https://github.com/electerious/nice-try",
+ "keywords": [
+ "try",
+ "catch",
+ "error"
+ ],
+ "license": "MIT",
+ "main": "src/index.js",
+ "name": "nice-try",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/electerious/nice-try.git"
+ },
+ "scripts": {
+ "coveralls": "nyc report --reporter=text-lcov | coveralls",
+ "test": "nyc node_modules/mocha/bin/_mocha"
+ },
+ "version": "1.0.5"
+}
diff --git a/node_modules/nice-try/src/index.js b/node_modules/nice-try/src/index.js
new file mode 100644
index 0000000..837506f
--- /dev/null
+++ b/node_modules/nice-try/src/index.js
@@ -0,0 +1,12 @@
+'use strict'
+
+/**
+ * Tries to execute a function and discards any error that occurs.
+ * @param {Function} fn - Function that might or might not throw an error.
+ * @returns {?*} Return-value of the function when no error occurred.
+ */
+module.exports = function(fn) {
+
+ try { return fn() } catch (e) {}
+
+} \ No newline at end of file