attempt-x

WebJar for attempt-x

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

attempt-x
Последняя версия

Последняя версия

1.1.3
Дата

Дата

Тип

Тип

jar
Описание

Описание

attempt-x
WebJar for attempt-x
Ссылка на сайт

Ссылка на сайт

https://www.webjars.org
Система контроля версий

Система контроля версий

https://github.com/Xotic750/attempt-x

Скачать attempt-x

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/attempt-x/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>attempt-x</artifactId>
    <version>1.1.3</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/attempt-x/
implementation 'org.webjars.npm:attempt-x:1.1.3'
// https://jarcasting.com/artifacts/org.webjars.npm/attempt-x/
implementation ("org.webjars.npm:attempt-x:1.1.3")
'org.webjars.npm:attempt-x:jar:1.1.3'
<dependency org="org.webjars.npm" name="attempt-x" rev="1.1.3">
  <artifact name="attempt-x" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='attempt-x', version='1.1.3')
)
libraryDependencies += "org.webjars.npm" % "attempt-x" % "1.1.3"
[org.webjars.npm/attempt-x "1.1.3"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

Travis status Dependency status devDependency status npm version jsDelivr hits bettercodehub score Coverage Status

attempt-x

Invokes function, returning an object of the results.

module.exports(fn, [...args])Object

This method attempts to invoke the function, returning either the result or the caught error object. Any additional arguments are provided to the function when it's invoked.

Kind: Exported function
Returns: Object - Returns an object of the result.

Param Type Description
fn function The function to attempt.
[...args] * The arguments to invoke the function with.

Example

import attempt from 'attempt-x';

function thrower() {
  throw new Error('Threw');
}

attempt(thrower, 1, 2);
// {
//   threw: true,
//   value: // Error('Threw') object
// }

function sumArgs(a, b) {
  return a + b;
}

attempt(sumArgs, 1, 2);
// {
//   threw: false,
//   value: 3
// }

const thisArg = [];
function pusher(a, b) {
  return this.push(a, b);
}

attempt.call(thisArg, pusher, 1, 2);
// {
//   threw: false,
//   value: 2
// }
// thisArg => [1, 2];

Версии библиотеки

Версия
1.1.3