mirror of
https://github.com/biobulkbende/biobulkbende.org.git
synced 2025-10-11 23:25:00 +00:00
structure, layout and automation
This commit is contained in:
3
node_modules/just-debounce/.eslintrc
generated
vendored
Normal file
3
node_modules/just-debounce/.eslintrc
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "standard"
|
||||
}
|
25
node_modules/just-debounce/.npmignore
generated
vendored
Normal file
25
node_modules/just-debounce/.npmignore
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
|
||||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# Compiled binary addons (http://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directory
|
||||
# Deployed apps should consider commenting this line out:
|
||||
# see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git
|
||||
node_modules
|
21
node_modules/just-debounce/LICENSE
generated
vendored
Normal file
21
node_modules/just-debounce/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Michael Hayes
|
||||
|
||||
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.
|
53
node_modules/just-debounce/README.md
generated
vendored
Normal file
53
node_modules/just-debounce/README.md
generated
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
just-debounce
|
||||
=============
|
||||
|
||||
just a basic debounce function
|
||||
|
||||
# Why?
|
||||
I searched npm and the first 3 pages of results for "debounce" did not have a
|
||||
small correctly implemented version of debounce
|
||||
|
||||
# Usage
|
||||
|
||||
### arguments
|
||||
* `fn`: the function to debounce
|
||||
* `delay`: debounce delay in ms
|
||||
* `at_start:` if true, the function will be called at the beginning of the
|
||||
delay rather than the end
|
||||
* `guarantee`: ensures the time before the next call the `fn` is not greater \
|
||||
than the delay period.
|
||||
|
||||
```javascript
|
||||
var db = require('just-debounce')
|
||||
|
||||
var debounced = db(function(v) {console.log(v)}, 100)
|
||||
|
||||
debounced('hi')
|
||||
debounced('hi')
|
||||
// logs 'hi' once after 100ms
|
||||
```
|
||||
|
||||
```javascript
|
||||
var db = require('just-debounce')
|
||||
|
||||
var debounced = db(function(v) {console.log(v)}, 100, true)
|
||||
|
||||
debounced('hi')
|
||||
debounced('hi')
|
||||
// logs 'hi' once right away, but not a second time. calling after 100ms will log again
|
||||
```
|
||||
|
||||
```javascript
|
||||
var db = require('just-debounce')
|
||||
|
||||
var debounced = db(function(v) {console.log(v)}, 100, false, true)
|
||||
|
||||
debounced('hi')
|
||||
setTimeout(function() {debounced('hi2')}, 80)
|
||||
|
||||
// logs 'hi2' once 100ms after the first call to debounced
|
||||
```
|
||||
|
||||
# license
|
||||
|
||||
MIT
|
34
node_modules/just-debounce/index.js
generated
vendored
Normal file
34
node_modules/just-debounce/index.js
generated
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
module.exports = debounce
|
||||
|
||||
function debounce (fn, delay, at_start, guarantee) {
|
||||
var timeout
|
||||
var args
|
||||
var self
|
||||
|
||||
return function debounced () {
|
||||
self = this
|
||||
args = Array.prototype.slice.call(arguments)
|
||||
|
||||
if (timeout && (at_start || guarantee)) {
|
||||
return
|
||||
} else if (!at_start) {
|
||||
clear()
|
||||
|
||||
timeout = setTimeout(run, delay)
|
||||
return timeout
|
||||
}
|
||||
|
||||
timeout = setTimeout(clear, delay)
|
||||
fn.apply(self, args)
|
||||
|
||||
function run () {
|
||||
clear()
|
||||
fn.apply(self, args)
|
||||
}
|
||||
|
||||
function clear () {
|
||||
clearTimeout(timeout)
|
||||
timeout = null
|
||||
}
|
||||
}
|
||||
}
|
56
node_modules/just-debounce/package.json
generated
vendored
Normal file
56
node_modules/just-debounce/package.json
generated
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
{
|
||||
"_from": "just-debounce@^1.0.0",
|
||||
"_id": "just-debounce@1.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-h/zPrv/AtozRnVX2cilD+SnqNeo=",
|
||||
"_location": "/just-debounce",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "just-debounce@^1.0.0",
|
||||
"name": "just-debounce",
|
||||
"escapedName": "just-debounce",
|
||||
"rawSpec": "^1.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/glob-watcher"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/just-debounce/-/just-debounce-1.0.0.tgz",
|
||||
"_shasum": "87fccfaeffc0b68cd19d55f6722943f929ea35ea",
|
||||
"_spec": "just-debounce@^1.0.0",
|
||||
"_where": "/home/outis/Documents/Sites/BBB/node_modules/glob-watcher",
|
||||
"author": {
|
||||
"name": "Michael Hayes"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/hayes/just-debounce/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "a simple debounce with no dependencies or crazy defaults",
|
||||
"devDependencies": {
|
||||
"eslint": "^0.22.1",
|
||||
"eslint-config-standard": "^2.0.0",
|
||||
"eslint-plugin-react": "^2.4.0",
|
||||
"tape": "^4.0.0"
|
||||
},
|
||||
"homepage": "https://github.com/hayes/just-debounce",
|
||||
"keywords": [
|
||||
"debounce"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "just-debounce",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/hayes/just-debounce.git"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint .",
|
||||
"test": "node test.js && npm run lint"
|
||||
},
|
||||
"version": "1.0.0"
|
||||
}
|
121
node_modules/just-debounce/test.js
generated
vendored
Normal file
121
node_modules/just-debounce/test.js
generated
vendored
Normal file
@ -0,0 +1,121 @@
|
||||
var debounce = require('./index.js')
|
||||
var test = require('tape')
|
||||
|
||||
test('debauce', function (t) {
|
||||
t.plan(3)
|
||||
|
||||
var fn = debounce(function (a, b) {
|
||||
t.deepEqual(this, {call: 3}, 'context should be preserved')
|
||||
t.equal(a, 30, 'should preserve args')
|
||||
t.equal(b, 300, 'should preserve args')
|
||||
}, 10)
|
||||
|
||||
fn.call({call: 1}, 10, 100)
|
||||
fn.call({call: 2}, 20, 200)
|
||||
|
||||
setTimeout(function () {
|
||||
fn.call({call: 3}, 30, 300)
|
||||
}, 3)
|
||||
})
|
||||
|
||||
test('multiple calls should extend delay', function (t) {
|
||||
t.plan(4)
|
||||
|
||||
var wasDelayed = false
|
||||
|
||||
var fn = debounce(function (a, b) {
|
||||
t.deepEqual(this, {call: 3}, 'context should be preserved')
|
||||
t.equal(a, 30, 'should preserve args')
|
||||
t.equal(b, 300, 'should preserve args')
|
||||
t.ok(wasDelayed, 'should have waited longer than debounce period')
|
||||
}, 6)
|
||||
|
||||
setTimeout(function longer () {
|
||||
wasDelayed = true
|
||||
}, 9)
|
||||
|
||||
fn.call({call: 1}, 10, 100)
|
||||
|
||||
setTimeout(function () {
|
||||
fn.call({call: 2}, 20, 200)
|
||||
|
||||
setTimeout(function () {
|
||||
fn.call({call: 3}, 30, 300)
|
||||
}, 5)
|
||||
}, 3)
|
||||
})
|
||||
|
||||
test('multiple calls should not extend delay when guarantee is true', function (t) {
|
||||
t.plan(8)
|
||||
|
||||
var first = true
|
||||
var wasDelayed = false
|
||||
|
||||
var fn = debounce(function (a, b) {
|
||||
if (first) {
|
||||
t.deepEqual(this, {call: 2}, '1st context should be preserved')
|
||||
t.equal(a, 20, '1st should preserve 1st args')
|
||||
t.equal(b, 200, '1st should preserve 2nd args')
|
||||
t.notOk(wasDelayed, 'should not have waited longer than debounce period')
|
||||
first = false
|
||||
} else {
|
||||
t.deepEqual(this, {call: 3}, 'context should be preserved')
|
||||
t.equal(a, 30, 'should preserve args')
|
||||
t.equal(b, 300, 'should preserve args')
|
||||
t.ok(wasDelayed, 'should have waited longer than debounce period')
|
||||
}
|
||||
}, 6, false, true)
|
||||
|
||||
setTimeout(function longer () {
|
||||
wasDelayed = true
|
||||
}, 7)
|
||||
|
||||
fn.call({call: 1}, 10, 100)
|
||||
|
||||
setTimeout(function () {
|
||||
fn.call({call: 2}, 20, 200)
|
||||
|
||||
setTimeout(function () {
|
||||
fn.call({call: 3}, 30, 300)
|
||||
}, 5)
|
||||
}, 3)
|
||||
})
|
||||
|
||||
test('at start', function (t) {
|
||||
t.plan(9)
|
||||
|
||||
var callCount = 0
|
||||
|
||||
var fn = debounce(function (a, b) {
|
||||
if (callCount === 0) {
|
||||
t.deepEqual(this, {call: 1}, '1st context should be preserved')
|
||||
t.equal(a, 10, '1st should preserve 1st args')
|
||||
t.equal(b, 100, '1st should preserve 2nd args')
|
||||
} else if (callCount === 1) {
|
||||
t.deepEqual(this, {call: 3}, 'context should be preserved')
|
||||
t.equal(a, 30, 'should preserve args')
|
||||
t.equal(b, 300, 'should preserve args')
|
||||
} else {
|
||||
t.deepEqual(this, {call: 4}, 'context should be preserved')
|
||||
t.equal(a, 40, 'should preserve 1st args')
|
||||
t.equal(b, 400, 'should preserve 2nd args')
|
||||
}
|
||||
|
||||
callCount += 1
|
||||
}, 6, true)
|
||||
|
||||
fn.call({call: 1}, 10, 100)
|
||||
fn.call({call: 2}, 20, 200)
|
||||
|
||||
setTimeout(function () {
|
||||
fn.call({call: 3}, 30, 300)
|
||||
|
||||
setTimeout(function () {
|
||||
fn.call({call: 4}, 40, 400)
|
||||
}, 10)
|
||||
|
||||
setTimeout(function () {
|
||||
fn.call({call: 5}, 50, 500)
|
||||
}, 3)
|
||||
}, 10)
|
||||
})
|
Reference in New Issue
Block a user