Initial commit
This commit is contained in:
31
node_modules/http-equiv-refresh/README.md
generated
vendored
Normal file
31
node_modules/http-equiv-refresh/README.md
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
# http-equiv-refresh [![NPM Version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url]
|
||||
|
||||
> Parse an HTML [meta refresh value](https://mdn.io/HTML/Element/meta#attr-http-equiv).
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
[Node.js](http://nodejs.org) `>= 6` is required. To install, type this at the command line:
|
||||
```shell
|
||||
npm install http-equiv-refresh
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
```js
|
||||
const parseMetaRefresh = require('http-equiv-refresh');
|
||||
|
||||
parseMetaRefresh('5; url=http://domain.com/');
|
||||
//-> { timeout:5, url:'http://domain.com/' }
|
||||
|
||||
parseMetaRefresh('5');
|
||||
//-> { timeout:5, url:null }
|
||||
```
|
||||
|
||||
|
||||
[npm-image]: https://img.shields.io/npm/v/http-equiv-refresh.svg
|
||||
[npm-url]: https://npmjs.com/package/http-equiv-refresh
|
||||
[travis-image]: https://img.shields.io/travis/stevenvachon/http-equiv-refresh.svg
|
||||
[travis-url]: https://travis-ci.org/stevenvachon/http-equiv-refresh
|
||||
[coveralls-image]: https://img.shields.io/coveralls/stevenvachon/http-equiv-refresh.svg
|
||||
[coveralls-url]: https://coveralls.io/github/stevenvachon/http-equiv-refresh
|
30
node_modules/http-equiv-refresh/index-es5.js
generated
vendored
Normal file
30
node_modules/http-equiv-refresh/index-es5.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = void 0;
|
||||
var PATTERN = /^\s*(\d+)(?:\s*;(?:\s*url\s*=)?\s*(?:["']\s*(.*?)\s*['"]|(.*?)))?\s*$/i;
|
||||
|
||||
var _default = function _default(content) {
|
||||
content = PATTERN.exec(content);
|
||||
var timeout, url;
|
||||
|
||||
if (content !== null) {
|
||||
timeout = parseInt(content[1], 10);
|
||||
url = content[2] || content[3] || null; // first matching group
|
||||
} else {
|
||||
timeout = null;
|
||||
url = null;
|
||||
}
|
||||
|
||||
return {
|
||||
timeout: timeout,
|
||||
url: url
|
||||
};
|
||||
};
|
||||
|
||||
exports["default"] = _default;
|
||||
module.exports = exports.default;
|
||||
|
||||
//# sourceMappingURL=index-es5.js.map
|
1
node_modules/http-equiv-refresh/index-es5.js.map
generated
vendored
Normal file
1
node_modules/http-equiv-refresh/index-es5.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["index.js"],"names":[],"mappings":";;;;;;AAAA,IAAM,OAAO,GAAG,wEAAhB;;eAIe,kBAAA,OAAO,EACtB;AACC,EAAA,OAAO,GAAG,OAAO,CAAC,IAAR,CAAa,OAAb,CAAV;AAEA,MAAI,OAAJ,EAAa,GAAb;;AAEA,MAAI,OAAO,KAAK,IAAhB,EACA;AACC,IAAA,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAD,CAAR,EAAa,EAAb,CAAlB;AAEA,IAAA,GAAG,GAAG,OAAO,CAAC,CAAD,CAAP,IAAc,OAAO,CAAC,CAAD,CAArB,IAA4B,IAAlC,CAHD,CAGyC;AACxC,GALD,MAOA;AACC,IAAA,OAAO,GAAG,IAAV;AACA,IAAA,GAAG,GAAG,IAAN;AACA;;AAED,SAAO;AAAE,IAAA,OAAO,EAAP,OAAF;AAAW,IAAA,GAAG,EAAH;AAAX,GAAP;AACA,C","file":"index-es5.js","sourcesContent":["const PATTERN = /^\\s*(\\d+)(?:\\s*;(?:\\s*url\\s*=)?\\s*(?:[\"']\\s*(.*?)\\s*['\"]|(.*?)))?\\s*$/i;\n\n\n\nexport default content =>\n{\n\tcontent = PATTERN.exec(content);\n\n\tlet timeout, url;\n\n\tif (content !== null)\n\t{\n\t\ttimeout = parseInt(content[1], 10);\n\n\t\turl = content[2] || content[3] || null; // first matching group\n\t}\n\telse\n\t{\n\t\ttimeout = null;\n\t\turl = null;\n\t}\n\n\treturn { timeout, url };\n};\n"]}
|
24
node_modules/http-equiv-refresh/index.js
generated
vendored
Normal file
24
node_modules/http-equiv-refresh/index.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
const PATTERN = /^\s*(\d+)(?:\s*;(?:\s*url\s*=)?\s*(?:["']\s*(.*?)\s*['"]|(.*?)))?\s*$/i;
|
||||
|
||||
|
||||
|
||||
export default content =>
|
||||
{
|
||||
content = PATTERN.exec(content);
|
||||
|
||||
let timeout, url;
|
||||
|
||||
if (content !== null)
|
||||
{
|
||||
timeout = parseInt(content[1], 10);
|
||||
|
||||
url = content[2] || content[3] || null; // first matching group
|
||||
}
|
||||
else
|
||||
{
|
||||
timeout = null;
|
||||
url = null;
|
||||
}
|
||||
|
||||
return { timeout, url };
|
||||
};
|
21
node_modules/http-equiv-refresh/license
generated
vendored
Normal file
21
node_modules/http-equiv-refresh/license
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Steven Vachon <contact@svachon.com> (svachon.com)
|
||||
|
||||
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.
|
42
node_modules/http-equiv-refresh/package.json
generated
vendored
Normal file
42
node_modules/http-equiv-refresh/package.json
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"name": "http-equiv-refresh",
|
||||
"description": "Parse an HTML meta refresh value.",
|
||||
"version": "2.0.1",
|
||||
"license": "MIT",
|
||||
"author": "Steven Vachon <contact@svachon.com> (https://svachon.com)",
|
||||
"repository": "github:stevenvachon/http-equiv-refresh",
|
||||
"main": "index-es5.js",
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.5.0",
|
||||
"@babel/core": "^7.5.4",
|
||||
"@babel/preset-env": "^7.5.4",
|
||||
"babel-plugin-add-module-exports": "^1.0.2",
|
||||
"chai": "^4.2.0",
|
||||
"coveralls": "^3.0.5",
|
||||
"mocha": "^6.1.4",
|
||||
"nyc": "^14.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
},
|
||||
"scripts": {
|
||||
"ci": "npm test && nyc report --reporter=text-lcov | coveralls",
|
||||
"posttest": "nyc report --reporter=text-summary --reporter=html",
|
||||
"prepublishOnly": "npm test",
|
||||
"pretest": "babel index.js --out-file=index-es5.js --plugins=babel-plugin-add-module-exports --presets=@babel/env --source-maps",
|
||||
"test": "nyc --silent mocha test.js --bail --check-leaks"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index-es5.js",
|
||||
"index-es5.js.map"
|
||||
],
|
||||
"keywords": [
|
||||
"html",
|
||||
"http-equiv",
|
||||
"meta",
|
||||
"metadata",
|
||||
"parse",
|
||||
"refresh"
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user