wrappy

WebJar for wrappy

Лицензия

Лицензия

ISC
Группа

Группа

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

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

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

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

1.0.2
Дата

Дата

Тип

Тип

jar
Описание

Описание

wrappy
WebJar for wrappy
Ссылка на сайт

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

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

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

https://github.com/npm/wrappy

Скачать wrappy

Имя Файла Размер
wrappy-1.0.2.pom
wrappy-1.0.2.jar 4 KB
wrappy-1.0.2-sources.jar 22 bytes
Обзор

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

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

Зависимости

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

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

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

wrappy

Callback wrapping utility

USAGE

var wrappy = require("wrappy")

// var wrapper = wrappy(wrapperFunction)

// make sure a cb is called only once
// See also: http://npm.im/once for this specific use case
var once = wrappy(function (cb) {
  var called = false
  return function () {
    if (called) return
    called = true
    return cb.apply(this, arguments)
  }
})

function printBoo () {
  console.log('boo')
}
// has some rando property
printBoo.iAmBooPrinter = true

var onlyPrintOnce = once(printBoo)

onlyPrintOnce() // prints 'boo'
onlyPrintOnce() // does nothing

// random property is retained!
assert.equal(onlyPrintOnce.iAmBooPrinter, true)
org.webjars.npm

npm

node package manager

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

Версия
1.0.2
1.0.1