WIP - add extractor, generate snippet_data
This commit is contained in:
39
node_modules/requestanimationframe-timer/CHANGELOG.md
generated
vendored
Normal file
39
node_modules/requestanimationframe-timer/CHANGELOG.md
generated
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
# Change Log
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
<a name="1.0.4"></a>
|
||||
## [1.0.4](https://github.com/kambing86/requestanimationframe-timer/compare/v1.0.3...v1.0.4) (2018-01-04)
|
||||
|
||||
|
||||
|
||||
<a name="1.0.3"></a>
|
||||
## [1.0.3](https://github.com/kambing86/requestanimationframe-timer/compare/v1.0.2...v1.0.3) (2018-01-04)
|
||||
|
||||
|
||||
|
||||
<a name="1.0.2"></a>
|
||||
## [1.0.2](https://github.com/kambing86/requestanimationframe-timer/compare/v1.0.1...v1.0.2) (2018-01-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* remove webpack as peerDependencies ([acbb8cf](https://github.com/kambing86/requestanimationframe-timer/commit/acbb8cf))
|
||||
|
||||
|
||||
|
||||
<a name="1.0.1"></a>
|
||||
## [1.0.1](https://github.com/kambing86/requestanimationframe-timer/compare/v1.0.0...v1.0.1) (2018-01-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* change the target to IE 10 to convert down to ES5 ([77c03f2](https://github.com/kambing86/requestanimationframe-timer/commit/77c03f2))
|
||||
* optimize code ([84630ab](https://github.com/kambing86/requestanimationframe-timer/commit/84630ab))
|
||||
|
||||
|
||||
|
||||
<a name="1.0.0"></a>
|
||||
# 1.0.0 (2018-01-03)
|
||||
|
||||
FIRST RELEASE!!
|
||||
20
node_modules/requestanimationframe-timer/LICENSE
generated
vendored
Normal file
20
node_modules/requestanimationframe-timer/LICENSE
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
Copyright JS Foundation and other contributors
|
||||
|
||||
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.
|
||||
65
node_modules/requestanimationframe-timer/README.md
generated
vendored
Normal file
65
node_modules/requestanimationframe-timer/README.md
generated
vendored
Normal file
@ -0,0 +1,65 @@
|
||||
<!-- [![npm][npm]][npm-url]
|
||||
[![deps][deps]][deps-url]
|
||||
[![test][test]][test-url]
|
||||
[![coverage][cover]][cover-url]
|
||||
[![chat][chat]][chat-url] -->
|
||||
|
||||
<div align="center">
|
||||
<!-- replace with accurate logo e.g from https://worldvectorlogo.com/ -->
|
||||
<img width="200" height="200" src="https://cdn.worldvectorlogo.com/logos/javascript.svg">
|
||||
<a href="https://webpack.js.org/">
|
||||
<img width="200" height="200" vspace="" hspace="25" src="https://cdn.rawgit.com/webpack/media/e7485eb2/logo/icon-square-big.svg">
|
||||
</a>
|
||||
<h1>requestanimationframe-timer</h1>
|
||||
<p>setTimeout and setInterval by using requestAnimationFrame</p>
|
||||
</div>
|
||||
|
||||
<h2 align="center">Install</h2>
|
||||
|
||||
```bash
|
||||
npm install --save-dev requestanimationframe-timer
|
||||
```
|
||||
|
||||
<h2 align="center">Usage</h2>
|
||||
|
||||
```js
|
||||
import { setInterval, setTimeout, clearInterval, clearTimeout } from 'requestanimationframe-timer';
|
||||
|
||||
const id_1 = setTimeout((a) => console.log(a), 1000, '1000 ms timeout');
|
||||
const id_2 = setInterval((a) => console.log(a), 2000, '2000 ms interval');
|
||||
setTimeout(() => {
|
||||
clearTimeout(id_1);
|
||||
clearInterval(id_2);
|
||||
}, 10000);
|
||||
```
|
||||
|
||||
<h2 align="center">Maintainers</h2>
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="https://github.com/kambing86">
|
||||
<img width="150" height="150" src="https://avatars3.githubusercontent.com/u/1342133?s=460&v=4">
|
||||
</br>
|
||||
Chua Kang Ming
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tbody>
|
||||
</table>
|
||||
|
||||
<!-- [npm]: https://img.shields.io/npm/v/requestanimationframe-timer.svg
|
||||
[npm-url]: https://npmjs.com/package/requestanimationframe-timer
|
||||
|
||||
[deps]: https://david-dm.org/webpack-contrib/requestanimationframe-timer.svg
|
||||
[deps-url]: https://david-dm.org/webpack-contrib/requestanimationframe-timer
|
||||
|
||||
[chat]: https://img.shields.io/badge/gitter-webpack%2Fwebpack-brightgreen.svg
|
||||
[chat-url]: https://gitter.im/webpack/webpack
|
||||
|
||||
[test]: http://img.shields.io/travis/webpack-contrib/requestanimationframe-timer.svg
|
||||
[test-url]: https://travis-ci.org/webpack-contrib/requestanimationframe-timer
|
||||
|
||||
[cover]: https://codecov.io/gh/webpack-contrib/requestanimationframe-timer/branch/master/graph/badge.svg
|
||||
[cover-url]: https://codecov.io/gh/webpack-contrib/requestanimationframe-timer -->
|
||||
3
node_modules/requestanimationframe-timer/dist/cjs.js
generated
vendored
Normal file
3
node_modules/requestanimationframe-timer/dist/cjs.js
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = require('./index').default;
|
||||
121
node_modules/requestanimationframe-timer/dist/index.js
generated
vendored
Normal file
121
node_modules/requestanimationframe-timer/dist/index.js
generated
vendored
Normal file
@ -0,0 +1,121 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _raf = require('raf');
|
||||
|
||||
var _raf2 = _interopRequireDefault(_raf);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
||||
|
||||
var MODE_TIMEOUT = 0;
|
||||
var MODE_INTERVAL = 1;
|
||||
var fnStacks = new Map();
|
||||
var runArray = new Set();
|
||||
var rafStarted = false;
|
||||
var startId = 0;
|
||||
|
||||
function getTimeStamp() {
|
||||
return new Date().getTime();
|
||||
}
|
||||
|
||||
function executeFn(value) {
|
||||
var fn = value.fn,
|
||||
args = value.args;
|
||||
|
||||
fn.apply(undefined, _toConsumableArray(args));
|
||||
}
|
||||
|
||||
function runFunction() {
|
||||
if (runArray.size === 0) return;
|
||||
runArray.forEach(executeFn);
|
||||
runArray.clear();
|
||||
}
|
||||
|
||||
var checkTick = function checkTick(currentTimeTick) {
|
||||
return function (value, id) {
|
||||
var nextTick = value.nextTick,
|
||||
ms = value.ms,
|
||||
mode = value.mode;
|
||||
|
||||
if (currentTimeTick - nextTick >= 0) {
|
||||
runArray.add(value);
|
||||
if (mode === MODE_TIMEOUT) {
|
||||
fnStacks.delete(id);
|
||||
} else {
|
||||
fnStacks.set(id, Object.assign({}, value, {
|
||||
nextTick: nextTick + ms
|
||||
}));
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
function loop() {
|
||||
var currentTimeTick = getTimeStamp();
|
||||
fnStacks.forEach(checkTick(currentTimeTick));
|
||||
runFunction();
|
||||
if (fnStacks.size === 0) {
|
||||
rafStarted = false;
|
||||
return;
|
||||
}
|
||||
(0, _raf2.default)(loop);
|
||||
}
|
||||
|
||||
function addId(_ref) {
|
||||
var fn = _ref.fn,
|
||||
_ref$ms = _ref.ms,
|
||||
ms = _ref$ms === undefined ? 0 : _ref$ms,
|
||||
args = _ref.args,
|
||||
mode = _ref.mode;
|
||||
|
||||
if (!fn) return null;
|
||||
var currentId = startId;
|
||||
fnStacks.set(currentId, {
|
||||
fn: fn,
|
||||
ms: ms,
|
||||
nextTick: getTimeStamp() + ms,
|
||||
args: args,
|
||||
mode: mode
|
||||
});
|
||||
if (!rafStarted) {
|
||||
rafStarted = true;
|
||||
(0, _raf2.default)(loop);
|
||||
}
|
||||
startId += 1;
|
||||
return currentId;
|
||||
}
|
||||
|
||||
function removeId(id) {
|
||||
if (fnStacks.has(id)) {
|
||||
fnStacks.delete(id);
|
||||
}
|
||||
if (fnStacks.size === 0) {
|
||||
rafStarted = false;
|
||||
}
|
||||
}
|
||||
|
||||
exports.default = {
|
||||
setTimeout: function setTimeout(fn) {
|
||||
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
||||
args[_key - 2] = arguments[_key];
|
||||
}
|
||||
|
||||
var ms = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
||||
return addId({ fn: fn, ms: ms, args: args, mode: MODE_TIMEOUT });
|
||||
},
|
||||
clearTimeout: removeId,
|
||||
setInterval: function setInterval(fn) {
|
||||
for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
||||
args[_key2 - 2] = arguments[_key2];
|
||||
}
|
||||
|
||||
var ms = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
||||
return addId({ fn: fn, ms: ms, args: args, mode: MODE_INTERVAL });
|
||||
},
|
||||
clearInterval: removeId
|
||||
};
|
||||
106
node_modules/requestanimationframe-timer/package.json
generated
vendored
Normal file
106
node_modules/requestanimationframe-timer/package.json
generated
vendored
Normal file
@ -0,0 +1,106 @@
|
||||
{
|
||||
"_from": "requestanimationframe-timer@^1.0.4",
|
||||
"_id": "requestanimationframe-timer@1.0.4",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-5ehtMkIS7RLI/UxjgAEZg6zGLoRdSSzfwjwowpBRImAr8Rbs2pdcS/4tmJ7CAtvYjtO/H+ui96AMkyefzUqUlQ==",
|
||||
"_location": "/requestanimationframe-timer",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "requestanimationframe-timer@^1.0.4",
|
||||
"name": "requestanimationframe-timer",
|
||||
"escapedName": "requestanimationframe-timer",
|
||||
"rawSpec": "^1.0.4",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.4"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/gatsby-plugin-transition-link"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/requestanimationframe-timer/-/requestanimationframe-timer-1.0.4.tgz",
|
||||
"_shasum": "3b48fe55f4359f07c54745caec7437e2532f89d8",
|
||||
"_spec": "requestanimationframe-timer@^1.0.4",
|
||||
"_where": "/Users/stefanfejes/Projects/30-seconds-of-python-code/node_modules/gatsby-plugin-transition-link",
|
||||
"author": {
|
||||
"name": "Chua Kang Ming",
|
||||
"url": "https://github.com/kambing86"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/kambing86/requestanimationframe-timer/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"raf": "^3.4.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "setTimeout and setInterval by using requestAnimationFrame",
|
||||
"devDependencies": {
|
||||
"babel-cli": "^6.26.0",
|
||||
"babel-jest": "^22.0.4",
|
||||
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
||||
"babel-polyfill": "^6.26.0",
|
||||
"babel-preset-env": "^1.6.1",
|
||||
"cross-env": "^5.1.3",
|
||||
"del-cli": "^1.1.0",
|
||||
"eslint": "^4.14.0",
|
||||
"eslint-config-webpack": "^1.2.5",
|
||||
"eslint-plugin-import": "^2.8.0",
|
||||
"jest": "^22.0.4",
|
||||
"lint-staged": "^6.0.0",
|
||||
"nsp": "^3.1.0",
|
||||
"pre-commit": "^1.2.2",
|
||||
"standard-version": "^4.2.0",
|
||||
"webpack": "^3.10.0",
|
||||
"webpack-defaults": "^1.6.0"
|
||||
},
|
||||
"email": "kambing860210@gmail.com",
|
||||
"engines": {
|
||||
"node": ">= 4.3 < 5.0.0 || >= 5.10"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"homepage": "https://github.com/kambing86/requestanimationframe-timer#readme",
|
||||
"keywords": [
|
||||
"clearInterval",
|
||||
"clearTimeout",
|
||||
"requestAnimationFrame",
|
||||
"setInterval",
|
||||
"setTimeout"
|
||||
],
|
||||
"license": "ISC",
|
||||
"lint-staged": {
|
||||
"*.js": [
|
||||
"eslint --fix",
|
||||
"git add"
|
||||
]
|
||||
},
|
||||
"main": "dist/cjs.js",
|
||||
"name": "requestanimationframe-timer",
|
||||
"pre-commit": "lint-staged",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/kambing86/requestanimationframe-timer.git"
|
||||
},
|
||||
"scripts": {
|
||||
"appveyor:test": "npm run test",
|
||||
"build": "cross-env NODE_ENV=production babel src -d dist --ignore 'src/**/*.test.js'",
|
||||
"clean": "del-cli dist",
|
||||
"lint": "eslint --cache src test",
|
||||
"lint-staged": "lint-staged",
|
||||
"prebuild": "npm run clean",
|
||||
"prepublish": "npm run build",
|
||||
"release": "standard-version",
|
||||
"security": "nsp check",
|
||||
"start": "npm run build -- -w",
|
||||
"test": "jest",
|
||||
"test:coverage": "jest --collectCoverageFrom='src/**/*.js' --coverage",
|
||||
"test:watch": "jest --watch",
|
||||
"travis:coverage": "npm run test:coverage -- --runInBand",
|
||||
"travis:lint": "npm run lint && npm run security",
|
||||
"travis:test": "npm run test -- --runInBand",
|
||||
"webpack-defaults": "webpack-defaults"
|
||||
},
|
||||
"version": "1.0.4"
|
||||
}
|
||||
Reference in New Issue
Block a user