Browse Source

[advancedcontentfilter] Removed yet more JS/PHP Composer files

- Removed vendor/npm-asset
- Removed vendor/slim/slim-skeleton
pull/586/head
Hypolite Petovan 3 years ago
parent
commit
6112160888
323 changed files with 1 additions and 41410 deletions
  1. +1
    -7
      advancedcontentfilter/composer.json
  2. +0
    -21
      advancedcontentfilter/vendor/npm-asset/cacheable-request/LICENSE
  3. +0
    -190
      advancedcontentfilter/vendor/npm-asset/cacheable-request/README.md
  4. +0
    -57
      advancedcontentfilter/vendor/npm-asset/cacheable-request/package.json
  5. +0
    -155
      advancedcontentfilter/vendor/npm-asset/cacheable-request/src/index.js
  6. +0
    -21
      advancedcontentfilter/vendor/npm-asset/clone-response/LICENSE
  7. +0
    -62
      advancedcontentfilter/vendor/npm-asset/clone-response/README.md
  8. +0
    -44
      advancedcontentfilter/vendor/npm-asset/clone-response/package.json
  9. +0
    -17
      advancedcontentfilter/vendor/npm-asset/clone-response/src/index.js
  10. +0
    -19
      advancedcontentfilter/vendor/npm-asset/core-util-is/LICENSE
  11. +0
    -3
      advancedcontentfilter/vendor/npm-asset/core-util-is/README.md
  12. +0
    -604
      advancedcontentfilter/vendor/npm-asset/core-util-is/float.patch
  13. +0
    -107
      advancedcontentfilter/vendor/npm-asset/core-util-is/lib/util.js
  14. +0
    -32
      advancedcontentfilter/vendor/npm-asset/core-util-is/package.json
  15. +0
    -68
      advancedcontentfilter/vendor/npm-asset/core-util-is/test.js
  16. +0
    -94
      advancedcontentfilter/vendor/npm-asset/decode-uri-component/index.js
  17. +0
    -21
      advancedcontentfilter/vendor/npm-asset/decode-uri-component/license
  18. +0
    -37
      advancedcontentfilter/vendor/npm-asset/decode-uri-component/package.json
  19. +0
    -70
      advancedcontentfilter/vendor/npm-asset/decode-uri-component/readme.md
  20. +0
    -29
      advancedcontentfilter/vendor/npm-asset/decompress-response/index.js
  21. +0
    -21
      advancedcontentfilter/vendor/npm-asset/decompress-response/license
  22. +0
    -53
      advancedcontentfilter/vendor/npm-asset/decompress-response/package.json
  23. +0
    -31
      advancedcontentfilter/vendor/npm-asset/decompress-response/readme.md
  24. +0
    -26
      advancedcontentfilter/vendor/npm-asset/duplexer3/LICENSE.md
  25. +0
    -115
      advancedcontentfilter/vendor/npm-asset/duplexer3/README.md
  26. +0
    -76
      advancedcontentfilter/vendor/npm-asset/duplexer3/index.js
  27. +0
    -28
      advancedcontentfilter/vendor/npm-asset/duplexer3/package.json
  28. +0
    -8
      advancedcontentfilter/vendor/npm-asset/from2/.travis.yml
  29. +0
    -21
      advancedcontentfilter/vendor/npm-asset/from2/LICENSE.md
  30. +0
    -70
      advancedcontentfilter/vendor/npm-asset/from2/README.md
  31. +0
    -103
      advancedcontentfilter/vendor/npm-asset/from2/index.js
  32. +0
    -37
      advancedcontentfilter/vendor/npm-asset/from2/package.json
  33. +0
    -123
      advancedcontentfilter/vendor/npm-asset/from2/test.js
  34. +0
    -51
      advancedcontentfilter/vendor/npm-asset/get-stream/buffer-stream.js
  35. +0
    -51
      advancedcontentfilter/vendor/npm-asset/get-stream/index.js
  36. +0
    -21
      advancedcontentfilter/vendor/npm-asset/get-stream/license
  37. +0
    -48
      advancedcontentfilter/vendor/npm-asset/get-stream/package.json
  38. +0
    -117
      advancedcontentfilter/vendor/npm-asset/get-stream/readme.md
  39. +0
    -92
      advancedcontentfilter/vendor/npm-asset/got/errors.js
  40. +0
    -661
      advancedcontentfilter/vendor/npm-asset/got/index.js
  41. +0
    -9
      advancedcontentfilter/vendor/npm-asset/got/license
  42. +0
    -95
      advancedcontentfilter/vendor/npm-asset/got/package.json
  43. +0
    -650
      advancedcontentfilter/vendor/npm-asset/got/readme.md
  44. +0
    -26
      advancedcontentfilter/vendor/npm-asset/has-symbol-support-x/.editorconfig
  45. +0
    -1
      advancedcontentfilter/vendor/npm-asset/has-symbol-support-x/.eslintignore
  46. +0
    -6
      advancedcontentfilter/vendor/npm-asset/has-symbol-support-x/.eslintrc.json
  47. +0
    -1
      advancedcontentfilter/vendor/npm-asset/has-symbol-support-x/.nvmrc
  48. +0
    -111
      advancedcontentfilter/vendor/npm-asset/has-symbol-support-x/.travis.yml
  49. +0
    -17
      advancedcontentfilter/vendor/npm-asset/has-symbol-support-x/.uglifyjsrc.json
  50. +0
    -21
      advancedcontentfilter/vendor/npm-asset/has-symbol-support-x/LICENSE
  51. +0
    -36
      advancedcontentfilter/vendor/npm-asset/has-symbol-support-x/README.md
  52. +0
    -20
      advancedcontentfilter/vendor/npm-asset/has-symbol-support-x/badges.html
  53. +0
    -18
      advancedcontentfilter/vendor/npm-asset/has-symbol-support-x/index.js
  54. +0
    -22
      advancedcontentfilter/vendor/npm-asset/has-symbol-support-x/lib/has-symbol-support-x.js
  55. +0
    -10
      advancedcontentfilter/vendor/npm-asset/has-symbol-support-x/lib/has-symbol-support-x.min.js
  56. +0
    -1
      advancedcontentfilter/vendor/npm-asset/has-symbol-support-x/lib/has-symbol-support-x.min.js.map
  57. +0
    -86
      advancedcontentfilter/vendor/npm-asset/has-symbol-support-x/package.json
  58. +0
    -34
      advancedcontentfilter/vendor/npm-asset/has-symbol-support-x/tests/index.html
  59. +0
    -25
      advancedcontentfilter/vendor/npm-asset/has-symbol-support-x/tests/run.js
  60. +0
    -29
      advancedcontentfilter/vendor/npm-asset/has-symbol-support-x/tests/spec/test.js
  61. +0
    -26
      advancedcontentfilter/vendor/npm-asset/has-to-string-tag-x/.editorconfig
  62. +0
    -1
      advancedcontentfilter/vendor/npm-asset/has-to-string-tag-x/.eslintignore
  63. +0
    -6
      advancedcontentfilter/vendor/npm-asset/has-to-string-tag-x/.eslintrc.json
  64. +0
    -1
      advancedcontentfilter/vendor/npm-asset/has-to-string-tag-x/.nvmrc
  65. +0
    -93
      advancedcontentfilter/vendor/npm-asset/has-to-string-tag-x/.travis.yml
  66. +0
    -17
      advancedcontentfilter/vendor/npm-asset/has-to-string-tag-x/.uglifyjsrc.json
  67. +0
    -21
      advancedcontentfilter/vendor/npm-asset/has-to-string-tag-x/LICENSE
  68. +0
    -37
      advancedcontentfilter/vendor/npm-asset/has-to-string-tag-x/README.md
  69. +0
    -20
      advancedcontentfilter/vendor/npm-asset/has-to-string-tag-x/badges.html
  70. +0
    -19
      advancedcontentfilter/vendor/npm-asset/has-to-string-tag-x/index.js
  71. +0
    -43
      advancedcontentfilter/vendor/npm-asset/has-to-string-tag-x/lib/has-to-string-tag-x.js
  72. +0
    -18
      advancedcontentfilter/vendor/npm-asset/has-to-string-tag-x/lib/has-to-string-tag-x.min.js
  73. +0
    -1
      advancedcontentfilter/vendor/npm-asset/has-to-string-tag-x/lib/has-to-string-tag-x.min.js.map
  74. +0
    -87
      advancedcontentfilter/vendor/npm-asset/has-to-string-tag-x/package.json
  75. +0
    -177
      advancedcontentfilter/vendor/npm-asset/http-cache-semantics/README.md
  76. +0
    -559
      advancedcontentfilter/vendor/npm-asset/http-cache-semantics/node4/index.js
  77. +0
    -22
      advancedcontentfilter/vendor/npm-asset/http-cache-semantics/package.json
  78. +0
    -16
      advancedcontentfilter/vendor/npm-asset/inherits/LICENSE
  79. +0
    -42
      advancedcontentfilter/vendor/npm-asset/inherits/README.md
  80. +0
    -7
      advancedcontentfilter/vendor/npm-asset/inherits/inherits.js
  81. +0
    -23
      advancedcontentfilter/vendor/npm-asset/inherits/inherits_browser.js
  82. +0
    -29
      advancedcontentfilter/vendor/npm-asset/inherits/package.json
  83. +0
    -79
      advancedcontentfilter/vendor/npm-asset/into-stream/index.js
  84. +0
    -21
      advancedcontentfilter/vendor/npm-asset/into-stream/license
  85. +0
    -50
      advancedcontentfilter/vendor/npm-asset/into-stream/package.json
  86. +0
    -42
      advancedcontentfilter/vendor/npm-asset/into-stream/readme.md
  87. +0
    -55
      advancedcontentfilter/vendor/npm-asset/is-object/.jscs.json
  88. +0
    -15
      advancedcontentfilter/vendor/npm-asset/is-object/.npmignore
  89. +0
    -14
      advancedcontentfilter/vendor/npm-asset/is-object/.testem.json
  90. +0
    -18
      advancedcontentfilter/vendor/npm-asset/is-object/.travis.yml
  91. +0
    -19
      advancedcontentfilter/vendor/npm-asset/is-object/LICENSE
  92. +0
    -55
      advancedcontentfilter/vendor/npm-asset/is-object/README.md
  93. +0
    -5
      advancedcontentfilter/vendor/npm-asset/is-object/index.js
  94. +0
    -59
      advancedcontentfilter/vendor/npm-asset/is-object/package.json
  95. +0
    -23
      advancedcontentfilter/vendor/npm-asset/is-object/test/index.js
  96. +0
    -7
      advancedcontentfilter/vendor/npm-asset/is-plain-obj/index.js
  97. +0
    -21
      advancedcontentfilter/vendor/npm-asset/is-plain-obj/license
  98. +0
    -36
      advancedcontentfilter/vendor/npm-asset/is-plain-obj/package.json
  99. +0
    -35
      advancedcontentfilter/vendor/npm-asset/is-plain-obj/readme.md
  100. +0
    -60
      advancedcontentfilter/vendor/npm-asset/is-retry-allowed/index.js

+ 1
- 7
advancedcontentfilter/composer.json View File

@ -20,12 +20,6 @@
"config": {
"optimize-autoloader": true,
"autoloader-suffix": "AdvancedContentFilterAddon",
"preferred-install": "dist",
"fxp-asset": {
"installer-paths": {
"npm-asset-library": "vendor/asset",
"bower-asset-library": "vendor/asset"
}
}
"preferred-install": "dist"
}
}

+ 0
- 21
advancedcontentfilter/vendor/npm-asset/cacheable-request/LICENSE View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) 2017 Luke Childs
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.

+ 0
- 190
advancedcontentfilter/vendor/npm-asset/cacheable-request/README.md View File

@ -1,190 +0,0 @@
# cacheable-request
> Wrap native HTTP requests with RFC compliant cache support
[![Build Status](https://travis-ci.org/lukechilds/cacheable-request.svg?branch=master)](https://travis-ci.org/lukechilds/cacheable-request)
[![Coverage Status](https://coveralls.io/repos/github/lukechilds/cacheable-request/badge.svg?branch=master)](https://coveralls.io/github/lukechilds/cacheable-request?branch=master)
[![npm](https://img.shields.io/npm/dm/cacheable-request.svg)](https://www.npmjs.com/package/cacheable-request)
[![npm](https://img.shields.io/npm/v/cacheable-request.svg)](https://www.npmjs.com/package/cacheable-request)
[RFC 7234](http://httpwg.org/specs/rfc7234.html) compliant HTTP caching for native Node.js HTTP/HTTPS requests. Caching works out of the box in memory or is easily pluggable with a wide range of storage adapters.
**Note:** This is a low level wrapper around the core HTTP modules, it's not a high level request library.
## Features
- Only stores cacheable responses as defined by RFC 7234
- Fresh cache entries are served directly from cache
- Stale cache entries are revalidated with `If-None-Match`/`If-Modified-Since` headers
- 304 responses from revalidation requests use cached body
- Updates `Age` header on cached responses
- Can completely bypass cache on a per request basis
- In memory cache by default
- Official support for Redis, MongoDB, SQLite, PostgreSQL and MySQL storage adapters
- Easily plug in your own or third-party storage adapters
- If DB connection fails, cache is automatically bypassed ([disabled by default](#optsautomaticfailover))
- Adds cache support to any existing HTTP code with minimal changes
- Uses [http-cache-semantics](https://github.com/pornel/http-cache-semantics) internally for HTTP RFC 7234 compliance
## Install
```shell
npm install --save cacheable-request
```
## Usage
```js
const http = require('http');
const CacheableRequest = require('cacheable-request');
// Then instead of
const req = http.request('http://example.com', cb);
req.end();
// You can do
const cacheableRequest = new CacheableRequest(http.request);
const cacheReq = cacheableRequest('http://example.com', cb);
cacheReq.on('request', req => req.end());
// Future requests to 'example.com' will be returned from cache if still valid
// You pass in any other http.request API compatible method to be wrapped with cache support:
const cacheableRequest = new CacheableRequest(https.request);
const cacheableRequest = new CacheableRequest(electron.net);
```
## Storage Adapters
`cacheable-request` uses [Keyv](https://github.com/lukechilds/keyv) to support a wide range of storage adapters.
For example, to use Redis as a cache backend, you just need to install the official Redis Keyv storage adapter:
```
npm install --save @keyv/redis
```
And then you can pass `CacheableRequest` your connection string:
```js
const cacheableRequest = new CacheableRequest(http.request, 'redis://user:pass@localhost:6379');
```
[View all official Keyv storage adapters.](https://github.com/lukechilds/keyv#official-storage-adapters)
Keyv also supports anything that follows the Map API so it's easy to write your own storage adapter or use a third-party solution.
e.g The following are all valid storage adapters
```js
const storageAdapter = new Map();
// or
const storageAdapter = require('./my-storage-adapter');
// or
const QuickLRU = require('quick-lru');
const storageAdapter = new QuickLRU({ maxSize: 1000 });
const cacheableRequest = new CacheableRequest(http.request, storageAdapter);
```
View the [Keyv docs](https://github.com/lukechilds/keyv) for more information on how to use storage adapters.
## API
### new cacheableRequest(request, [storageAdapter])
Returns the provided request function wrapped with cache support.
#### request
Type: `function`
Request function to wrap with cache support. Should be [`http.request`](https://nodejs.org/api/http.html#http_http_request_options_callback) or a similar API compatible request function.
#### storageAdapter
Type: `Keyv storage adapter`<br>
Default: `new Map()`
A [Keyv](https://github.com/lukechilds/keyv) storage adapter instance, or connection string if using with an official Keyv storage adapter.
### Instance
#### cacheableRequest(opts, [cb])
Returns an event emitter.
##### opts
Type: `object`, `string`
Any of the default request functions options plus:
###### opts.cache
Type: `boolean`<br>
Default: `true`
If the cache should be used. Setting this to false will completely bypass the cache for the current request.
###### opts.strictTtl
Type: `boolean`<br>
Default: `false`
If set to `false`, after a cached resource's TTL expires it is kept in the cache and will be revalidated on the next request with `If-None-Match`/`If-Modified-Since` headers.
If set to `true` once a cached resource has expired it is deleted and will have to be re-requested.
###### opts.automaticFailover
Type: `boolean`<br>
Default: `false`
When set to `true`, if the DB connection fails we will automatically fallback to a network request. DB errors will still be emitted to notify you of the problem even though the request callback may succeed.
##### cb
Type: `function`
The callback function which will receive the response as an argument.
The response can be either a [Node.js HTTP response stream](https://nodejs.org/api/http.html#http_class_http_incomingmessage) or a [responselike object](https://github.com/lukechilds/responselike). The response will also have a `fromCache` property set with a boolean value.
##### .on('request', request)
`request` event to get the request object of the request.
**Note:** This event will only fire if an HTTP request is actually made, not when a response is retrieved from cache. However, you should always handle the `request` event to end the request and handle any potential request errors.
##### .on('response', response)
`response` event to get the response object from the HTTP request or cache.
##### .on('error', error)
`error` event emitted in case of an error with the cache.
Errors emitted here will be an instance of `CacheableRequest.RequestError` or `CacheableRequest.CacheError`. You will only ever receive a `RequestError` if the request function throws (normally caused by invalid user input). Normal request errors should be handled inside the `request` event.
To properly handle all error scenarios you should use the following pattern:
```js
cacheableRequest('example.com', cb)
.on('error', err => {
if (err instanceof CacheableRequest.CacheError) {
handleCacheError(err); // Cache error
} else if (err instanceof CacheableRequest.RequestError) {
handleRequestError(err); // Request function thrown
}
})
.on('request', req => {
req.on('error', handleRequestError); // Request error emitted
req.end();
});
```
**Note:** Database connection errors are emitted here, however `cacheable-request` will attempt to re-request the resource and bypass the cache on a connection error. Therefore a database connection error doesn't necessarily mean the request won't be fulfilled.
## License
MIT © Luke Childs

+ 0
- 57
advancedcontentfilter/vendor/npm-asset/cacheable-request/package.json View File

@ -1,57 +0,0 @@
{
"name": "cacheable-request",
"version": "2.1.4",
"description": "Wrap native HTTP requests with RFC compliant cache support",
"main": "src/index.js",
"scripts": {
"test": "xo && nyc ava",
"coverage": "nyc report --reporter=text-lcov | coveralls"
},
"xo": {
"extends": "xo-lukechilds"
},
"repository": {
"type": "git",
"url": "git+https://github.com/lukechilds/cacheable-request.git"
},
"keywords": [
"HTTP",
"HTTPS",
"cache",
"caching",
"layer",
"cacheable",
"RFC 7234",
"RFC",
"7234",
"compliant"
],
"author": "Luke Childs <lukechilds123@gmail.com> (http://lukechilds.co.uk)",
"license": "MIT",
"bugs": {
"url": "https://github.com/lukechilds/cacheable-request/issues"
},
"homepage": "https://github.com/lukechilds/cacheable-request",
"dependencies": {
"clone-response": "1.0.2",
"get-stream": "3.0.0",
"http-cache-semantics": "3.8.1",
"keyv": "3.0.0",
"lowercase-keys": "1.0.0",
"normalize-url": "2.0.1",
"responselike": "1.0.2"
},
"devDependencies": {
"@keyv/sqlite": "^1.2.6",
"ava": "^0.24.0",
"coveralls": "^3.0.0",
"create-test-server": "^2.0.0",
"delay": "^2.0.0",
"eslint-config-xo-lukechilds": "^1.0.0",
"nyc": "^11.0.2",
"pify": "^3.0.0",
"sqlite3": "^3.1.9",
"this": "^1.0.2",
"xo": "^0.19.0"
}
}

+ 0
- 155
advancedcontentfilter/vendor/npm-asset/cacheable-request/src/index.js View File

@ -1,155 +0,0 @@
'use strict';
const EventEmitter = require('events');
const urlLib = require('url');
const normalizeUrl = require('normalize-url');
const getStream = require('get-stream');
const CachePolicy = require('http-cache-semantics');
const Response = require('responselike');
const lowercaseKeys = require('lowercase-keys');
const cloneResponse = require('clone-response');
const Keyv = require('keyv');
class CacheableRequest {
constructor(request, cacheAdapter) {
if (typeof request !== 'function') {
throw new TypeError('Parameter `request` must be a function');
}
this.cache = new Keyv({
uri: typeof cacheAdapter === 'string' && cacheAdapter,
store: typeof cacheAdapter !== 'string' && cacheAdapter,
namespace: 'cacheable-request'
});
return this.createCacheableRequest(request);
}
createCacheableRequest(request) {
return (opts, cb) => {
if (typeof opts === 'string') {
opts = urlLib.parse(opts);
}
opts = Object.assign({
headers: {},
method: 'GET',
cache: true,
strictTtl: false,
automaticFailover: false
}, opts);
opts.headers = lowercaseKeys(opts.headers);
const ee = new EventEmitter();
const url = normalizeUrl(urlLib.format(opts));
const key = `${opts.method}:${url}`;
let revalidate = false;
let madeRequest = false;
const makeRequest = opts => {
madeRequest = true;
const handler = response => {
if (revalidate) {
const revalidatedPolicy = CachePolicy.fromObject(revalidate.cachePolicy).revalidatedPolicy(opts, response);
if (!revalidatedPolicy.modified) {
const headers = revalidatedPolicy.policy.responseHeaders();
response = new Response(response.statusCode, headers, revalidate.body, revalidate.url);
response.cachePolicy = revalidatedPolicy.policy;
response.fromCache = true;
}
}
if (!response.fromCache) {
response.cachePolicy = new CachePolicy(opts, response);
response.fromCache = false;
}
let clonedResponse;
if (opts.cache && response.cachePolicy.storable()) {
clonedResponse = cloneResponse(response);
getStream.buffer(response)
.then(body => {
const value = {
cachePolicy: response.cachePolicy.toObject(),
url: response.url,
statusCode: response.fromCache ? revalidate.statusCode : response.statusCode,
body
};
const ttl = opts.strictTtl ? response.cachePolicy.timeToLive() : undefined;
return this.cache.set(key, value, ttl);
})
.catch(err => ee.emit('error', new CacheableRequest.CacheError(err)));
} else if (opts.cache && revalidate) {
this.cache.delete(key)
.catch(err => ee.emit('error', new CacheableRequest.CacheError(err)));
}
ee.emit('response', clonedResponse || response);
if (typeof cb === 'function') {
cb(clonedResponse || response);
}
};
try {
const req = request(opts, handler);
ee.emit('request', req);
} catch (err) {
ee.emit('error', new CacheableRequest.RequestError(err));
}
};
const get = opts => Promise.resolve()
.then(() => opts.cache ? this.cache.get(key) : undefined)
.then(cacheEntry => {
if (typeof cacheEntry === 'undefined') {
return makeRequest(opts);
}
const policy = CachePolicy.fromObject(cacheEntry.cachePolicy);
if (policy.satisfiesWithoutRevalidation(opts)) {
const headers = policy.responseHeaders();
const response = new Response(cacheEntry.statusCode, headers, cacheEntry.body, cacheEntry.url);
response.cachePolicy = policy;
response.fromCache = true;
ee.emit('response', response);
if (typeof cb === 'function') {
cb(response);
}
} else {
revalidate = cacheEntry;
opts.headers = policy.revalidationHeaders(opts);
makeRequest(opts);
}
});
this.cache.on('error', err => ee.emit('error', new CacheableRequest.CacheError(err)));
get(opts).catch(err => {
if (opts.automaticFailover && !madeRequest) {
makeRequest(opts);
}
ee.emit('error', new CacheableRequest.CacheError(err));
});
return ee;
};
}
}
CacheableRequest.RequestError = class extends Error {
constructor(err) {
super(err.message);
this.name = 'RequestError';
Object.assign(this, err);
}
};
CacheableRequest.CacheError = class extends Error {
constructor(err) {
super(err.message);
this.name = 'CacheError';
Object.assign(this, err);
}
};
module.exports = CacheableRequest;

+ 0
- 21
advancedcontentfilter/vendor/npm-asset/clone-response/LICENSE View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) 2017 Luke Childs
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.

+ 0
- 62
advancedcontentfilter/vendor/npm-asset/clone-response/README.md View File

@ -1,62 +0,0 @@
# clone-response
> Clone a Node.js HTTP response stream
[![Build Status](https://travis-ci.org/lukechilds/clone-response.svg?branch=master)](https://travis-ci.org/lukechilds/clone-response)
[![Coverage Status](https://coveralls.io/repos/github/lukechilds/clone-response/badge.svg?branch=master)](https://coveralls.io/github/lukechilds/clone-response?branch=master)
[![npm](https://img.shields.io/npm/dm/clone-response.svg)](https://www.npmjs.com/package/clone-response)
[![npm](https://img.shields.io/npm/v/clone-response.svg)](https://www.npmjs.com/package/clone-response)
Returns a new stream and copies over all properties and methods from the original response giving you a complete duplicate.
This is useful in situations where you need to consume the response stream but also want to pass an unconsumed stream somewhere else to be consumed later.
## Install
```shell
npm install --save clone-response
```
## Usage
```js
const http = require('http');
const cloneResponse = require('clone-response');
http.get('http://example.com', response => {
const clonedResponse = cloneResponse(response);
response.pipe(process.stdout);
setImmediate(() => {
// The response stream has already been consumed by the time this executes,
// however the cloned response stream is still available.
doSomethingWithResponse(clonedResponse);
});
});
```
Please bear in mind that the process of cloning a stream consumes it. However, you can consume a stream multiple times in the same tick, therefore allowing you to create multiple clones. e.g:
```js
const clone1 = cloneResponse(response);
const clone2 = cloneResponse(response);
// response can still be consumed in this tick but cannot be consumed if passed
// into any async callbacks. clone1 and clone2 can be passed around and be
// consumed in the future.
```
## API
### cloneResponse(response)
Returns a clone of the passed in response.
#### response
Type: `stream`
A [Node.js HTTP response stream](https://nodejs.org/api/http.html#http_class_http_incomingmessage) to clone.
## License
MIT © Luke Childs

+ 0
- 44
advancedcontentfilter/vendor/npm-asset/clone-response/package.json View File

@ -1,44 +0,0 @@
{
"name": "clone-response",
"version": "1.0.2",
"description": "Clone a Node.js HTTP response stream",
"main": "src/index.js",
"scripts": {
"test": "xo && nyc ava",
"coverage": "nyc report --reporter=text-lcov | coveralls"
},
"xo": {
"extends": "xo-lukechilds"
},
"repository": {
"type": "git",
"url": "git+https://github.com/lukechilds/clone-response.git"
},
"keywords": [
"clone",
"duplicate",
"copy",
"response",
"HTTP",
"stream"
],
"author": "Luke Childs <lukechilds123@gmail.com> (http://lukechilds.co.uk)",
"license": "MIT",
"bugs": {
"url": "https://github.com/lukechilds/clone-response/issues"
},
"homepage": "https://github.com/lukechilds/clone-response",
"dependencies": {
"mimic-response": "^1.0.0"
},
"devDependencies": {
"ava": "^0.22.0",
"coveralls": "^2.13.1",
"create-test-server": "^2.0.1",
"eslint-config-xo-lukechilds": "^1.0.0",
"get-stream": "^3.0.0",
"nyc": "^11.0.2",
"pify": "^3.0.0",
"xo": "^0.19.0"
}
}

+ 0
- 17
advancedcontentfilter/vendor/npm-asset/clone-response/src/index.js View File

@ -1,17 +0,0 @@
'use strict';
const PassThrough = require('stream').PassThrough;
const mimicResponse = require('mimic-response');
const cloneResponse = response => {
if (!(response && response.pipe)) {
throw new TypeError('Parameter `response` must be a response stream.');
}
const clone = new PassThrough();
mimicResponse(response, clone);
return response.pipe(clone);
};
module.exports = cloneResponse;

+ 0
- 19
advancedcontentfilter/vendor/npm-asset/core-util-is/LICENSE View File

@ -1,19 +0,0 @@
Copyright Node.js contributors. All rights reserved.
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.

+ 0
- 3
advancedcontentfilter/vendor/npm-asset/core-util-is/README.md View File

@ -1,3 +0,0 @@
# core-util-is
The `util.is*` functions introduced in Node v0.12.

+ 0
- 604
advancedcontentfilter/vendor/npm-asset/core-util-is/float.patch View File

@ -1,604 +0,0 @@
diff --git a/lib/util.js b/lib/util.js
index a03e874..9074e8e 100644
--- a/lib/util.js
+++ b/lib/util.js
@@ -19,430 +19,6 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
-var formatRegExp = /%[sdj%]/g;
-exports.format = function(f) {
- if (!isString(f)) {
- var objects = [];
- for (var i = 0; i < arguments.length; i++) {
- objects.push(inspect(arguments[i]));
- }
- return objects.join(' ');
- }
-
- var i = 1;
- var args = arguments;
- var len = args.length;
- var str = String(f).replace(formatRegExp, function(x) {
- if (x === '%%') return '%';
- if (i >= len) return x;
- switch (x) {
- case '%s': return String(args[i++]);
- case '%d': return Number(args[i++]);
- case '%j':
- try {
- return JSON.stringify(args[i++]);
- } catch (_) {
- return '[Circular]';
- }
- default:
- return x;
- }
- });
- for (var x = args[i]; i < len; x = args[++i]) {
- if (isNull(x) || !isObject(x)) {
- str += ' ' + x;
- } else {
- str += ' ' + inspect(x);
- }
- }
- return str;
-};
-
-
-// Mark that a method should not be used.
-// Returns a modified function which warns once by default.
-// If --no-deprecation is set, then it is a no-op.
-exports.deprecate = function(fn, msg) {
- // Allow for deprecating things in the process of starting up.
- if (isUndefined(global.process)) {
- return function() {
- return exports.deprecate(fn, msg).apply(this, arguments);
- };
- }
-
- if (process.noDeprecation === true) {
- return fn;
- }
-
- var warned = false;
- function deprecated() {
- if (!warned) {
- if (process.throwDeprecation) {
- throw new Error(msg);
- } else if (process.traceDeprecation) {
- console.trace(msg);
- } else {
- console.error(msg);
- }
- warned = true;
- }
- return fn.apply(this, arguments);
- }
-
- return deprecated;
-};
-
-
-var debugs = {};
-var debugEnviron;
-exports.debuglog = function(set) {
- if (isUndefined(debugEnviron))
- debugEnviron = process.env.NODE_DEBUG || '';
- set = set.toUpperCase();
- if (!debugs[set]) {
- if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
- var pid = process.pid;
- debugs[set] = function() {
- var msg = exports.format.apply(exports, arguments);
- console.error('%s %d: %s', set, pid, msg);
- };
- } else {
- debugs[set] = function() {};
- }
- }
- return debugs[set];
-};
-
-
-/**
- * Echos the value of a value. Trys to print the value out
- * in the best way possible given the different types.
- *
- * @param {Object} obj The object to print out.
- * @param {Object} opts Optional options object that alters the output.
- */
-/* legacy: obj, showHidden, depth, colors*/
-function inspect(obj, opts) {
- // default options
- var ctx = {
- seen: [],
- stylize: stylizeNoColor
- };
- // legacy...
- if (arguments.length >= 3) ctx.depth = arguments[2];
- if (arguments.length >= 4) ctx.colors = arguments[3];
- if (isBoolean(opts)) {
- // legacy...
- ctx.showHidden = opts;
- } else if (opts) {
- // got an "options" object
- exports._extend(ctx, opts);
- }
- // set default options
- if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
- if (isUndefined(ctx.depth)) ctx.depth = 2;
- if (isUndefined(ctx.colors)) ctx.colors = false;
- if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
- if (ctx.colors) ctx.stylize = stylizeWithColor;
- return formatValue(ctx, obj, ctx.depth);
-}
-exports.inspect = inspect;
-
-
-// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
-inspect.colors = {
- 'bold' : [1, 22],
- 'italic' : [3, 23],
- 'underline' : [4, 24],
- 'inverse' : [7, 27],
- 'white' : [37, 39],
- 'grey' : [90, 39],
- 'black' : [30, 39],
- 'blue' : [34, 39],
- 'cyan' : [36, 39],
- 'green' : [32, 39],
- 'magenta' : [35, 39],
- 'red' : [31, 39],
- 'yellow' : [33, 39]
-};
-
-// Don't use 'blue' not visible on cmd.exe
-inspect.styles = {
- 'special': 'cyan',
- 'number': 'yellow',
- 'boolean': 'yellow',
- 'undefined': 'grey',
- 'null': 'bold',
- 'string': 'green',
- 'date': 'magenta',
- // "name": intentionally not styling
- 'regexp': 'red'
-};
-
-
-function stylizeWithColor(str, styleType) {
- var style = inspect.styles[styleType];
-
- if (style) {
- return '\u001b[' + inspect.colors[style][0] + 'm' + str +
- '\u001b[' + inspect.colors[style][1] + 'm';
- } else {
- return str;
- }
-}
-
-
-function stylizeNoColor(str, styleType) {
- return str;
-}
-
-
-function arrayToHash(array) {
- var hash = {};
-
- array.forEach(function(val, idx) {
- hash[val] = true;
- });
-
- return hash;
-}
-
-
-function formatValue(ctx, value, recurseTimes) {
- // Provide a hook for user-specified inspect functions.
- // Check that value is an object with an inspect function on it
- if (ctx.customInspect &&
- value &&
- isFunction(value.inspect) &&
- // Filter out the util module, it's inspect function is special
- value.inspect !== exports.inspect &&
- // Also filter out any prototype objects using the circular check.
- !(value.constructor && value.constructor.prototype === value)) {
- var ret = value.inspect(recurseTimes, ctx);
- if (!isString(ret)) {
- ret = formatValue(ctx, ret, recurseTimes);
- }
- return ret;
- }
-
- // Primitive types cannot have properties
- var primitive = formatPrimitive(ctx, value);
- if (primitive) {
- return primitive;
- }
-
- // Look up the keys of the object.
- var keys = Object.keys(value);
- var visibleKeys = arrayToHash(keys);
-
- if (ctx.showHidden) {
- keys = Object.getOwnPropertyNames(value);
- }
-
- // Some type of object without properties can be shortcutted.
- if (keys.length === 0) {
- if (isFunction(value)) {
- var name = value.name ? ': ' + value.name : '';
- return ctx.stylize('[Function' + name + ']', 'special');
- }
- if (isRegExp(value)) {
- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
- }
- if (isDate(value)) {
- return ctx.stylize(Date.prototype.toString.call(value), 'date');
- }
- if (isError(value)) {
- return formatError(value);
- }
- }
-
- var base = '', array = false, braces = ['{', '}'];
-
- // Make Array say that they are Array
- if (isArray(value)) {
- array = true;
- braces = ['[', ']'];
- }
-
- // Make functions say that they are functions
- if (isFunction(value)) {
- var n = value.name ? ': ' + value.name : '';
- base = ' [Function' + n + ']';
- }
-
- // Make RegExps say that they are RegExps
- if (isRegExp(value)) {
- base = ' ' + RegExp.prototype.toString.call(value);
- }
-
- // Make dates with properties first say the date
- if (isDate(value)) {
- base = ' ' + Date.prototype.toUTCString.call(value);
- }
-
- // Make error with message first say the error
- if (isError(value)) {
- base = ' ' + formatError(value);
- }
-
- if (keys.length === 0 && (!array || value.length == 0)) {
- return braces[0] + base + braces[1];
- }
-
- if (recurseTimes < 0) {
- if (isRegExp(value)) {
- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
- } else {
- return ctx.stylize('[Object]', 'special');
- }
- }
-
- ctx.seen.push(value);
-
- var output;
- if (array) {
- output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
- } else {
- output = keys.map(function(key) {
- return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
- });
- }
-
- ctx.seen.pop();
-
- return reduceToSingleString(output, base, braces);
-}
-
-
-function formatPrimitive(ctx, value) {
- if (isUndefined(value))
- return ctx.stylize('undefined', 'undefined');
- if (isString(value)) {
- var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
- .replace(/'/g, "\\'")
- .replace(/\\"/g, '"') + '\'';
- return ctx.stylize(simple, 'string');
- }
- if (isNumber(value)) {
- // Format -0 as '-0'. Strict equality won't distinguish 0 from -0,
- // so instead we use the fact that 1 / -0 < 0 whereas 1 / 0 > 0 .
- if (value === 0 && 1 / value < 0)
- return ctx.stylize('-0', 'number');
- return ctx.stylize('' + value, 'number');
- }
- if (isBoolean(value))
- return ctx.stylize('' + value, 'boolean');
- // For some reason typeof null is "object", so special case here.
- if (isNull(value))
- return ctx.stylize('null', 'null');
-}
-
-
-function formatError(value) {
- return '[' + Error.prototype.toString.call(value) + ']';
-}
-
-
-function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
- var output = [];
- for (var i = 0, l = value.length; i < l; ++i) {
- if (hasOwnProperty(value, String(i))) {
- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
- String(i), true));
- } else {
- output.push('');
- }
- }
- keys.forEach(function(key) {
- if (!key.match(/^\d+$/)) {
- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
- key, true));
- }
- });
- return output;
-}
-
-
-function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
- var name, str, desc;
- desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
- if (desc.get) {
- if (desc.set) {
- str = ctx.stylize('[Getter/Setter]', 'special');
- } else {
- str = ctx.stylize('[Getter]', 'special');
- }
- } else {
- if (desc.set) {
- str = ctx.stylize('[Setter]', 'special');
- }
- }
- if (!hasOwnProperty(visibleKeys, key)) {
- name = '[' + key + ']';
- }
- if (!str) {
- if (ctx.seen.indexOf(desc.value) < 0) {
- if (isNull(recurseTimes)) {
- str = formatValue(ctx, desc.value, null);
- } else {
- str = formatValue(ctx, desc.value, recurseTimes - 1);
- }
- if (str.indexOf('\n') > -1) {
- if (array) {
- str = str.split('\n').map(function(line) {
- return ' ' + line;
- }).join('\n').substr(2);
- } else {
- str = '\n' + str.split('\n').map(function(line) {
- return ' ' + line;
- }).join('\n');
- }
- }
- } else {
- str = ctx.stylize('[Circular]', 'special');
- }
- }
- if (isUndefined(name)) {
- if (array && key.match(/^\d+$/)) {
- return str;
- }
- name = JSON.stringify('' + key);
- if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
- name = name.substr(1, name.length - 2);
- name = ctx.stylize(name, 'name');
- } else {
- name = name.replace(/'/g, "\\'")
- .replace(/\\"/g, '"')
- .replace(/(^"|"$)/g, "'");
- name = ctx.stylize(name, 'string');
- }
- }
-
- return name + ': ' + str;
-}
-
-
-function reduceToSingleString(output, base, braces) {
- var numLinesEst = 0;
- var length = output.reduce(function(prev, cur) {
- numLinesEst++;
- if (cur.indexOf('\n') >= 0) numLinesEst++;
- return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
- }, 0);
-
- if (length > 60) {
- return braces[0] +
- (base === '' ? '' : base + '\n ') +
- ' ' +
- output.join(',\n ') +
- ' ' +
- braces[1];
- }
-
- return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
-}
-
-
// NOTE: These type checking functions intentionally don't use `instanceof`
// because it is fragile and can be easily faked with `Object.create()`.
function isArray(ar) {
@@ -522,166 +98,10 @@ function isPrimitive(arg) {
exports.isPrimitive = isPrimitive;
function isBuffer(arg) {
- return arg instanceof Buffer;
+ return Buffer.isBuffer(arg);
}
exports.isBuffer = isBuffer;
function objectToString(o) {
return Object.prototype.toString.call(o);
-}
-
-
-function pad(n) {
- return n < 10 ? '0' + n.toString(10) : n.toString(10);
-}
-
-
-var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
- 'Oct', 'Nov', 'Dec'];
-
-// 26 Feb 16:19:34
-function timestamp() {
- var d = new Date();
- var time = [pad(d.getHours()),
- pad(d.getMinutes()),
- pad(d.getSeconds())].join(':');
- return [d.getDate(), months[d.getMonth()], time].join(' ');
-}
-
-
-// log is just a thin wrapper to console.log that prepends a timestamp
-exports.log = function() {
- console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
-};
-
-
-/**
- * Inherit the prototype methods from one constructor into another.
- *
- * The Function.prototype.inherits from lang.js rewritten as a standalone
- * function (not on Function.prototype). NOTE: If this file is to be loaded
- * during bootstrapping this function needs to be rewritten using some native
- * functions as prototype setup using normal JavaScript does not work as
- * expected during bootstrapping (see mirror.js in r114903).
- *
- * @param {function} ctor Constructor function which needs to inherit the
- * prototype.
- * @param {function} superCtor Constructor function to inherit prototype from.
- */
-exports.inherits = function(ctor, superCtor) {
- ctor.super_ = superCtor;
- ctor.prototype = Object.create(superCtor.prototype, {
- constructor: {
- value: ctor,
- enumerable: false,
- writable: true,
- configurable: true
- }
- });
-};
-
-exports._extend = function(origin, add) {
- // Don't do anything if add isn't an object
- if (!add || !isObject(add)) return origin;
-
- var keys = Object.keys(add);
- var i = keys.length;
- while (i--) {
- origin[keys[i]] = add[keys[i]];
- }
- return origin;
-};
-
-function hasOwnProperty(obj, prop) {
- return Object.prototype.hasOwnProperty.call(obj, prop);
-}
-
-
-// Deprecated old stuff.
-
-exports.p = exports.deprecate(function() {
- for (var i = 0, len = arguments.length; i < len; ++i) {
- console.error(exports.inspect(arguments[i]));
- }
-}, 'util.p: Use console.error() instead');
-
-
-exports.exec = exports.deprecate(function() {
- return require('child_process').exec.apply(this, arguments);
-}, 'util.exec is now called `child_process.exec`.');
-
-
-exports.print = exports.deprecate(function() {
- for (var i = 0, len = arguments.length; i < len; ++i) {
- process.stdout.write(String(arguments[i]));
- }
-}, 'util.print: Use console.log instead');
-
-
-exports.puts = exports.deprecate(function() {
- for (var i = 0, len = arguments.length; i < len; ++i) {
- process.stdout.write(arguments[i] + '\n');
- }
-}, 'util.puts: Use console.log instead');
-
-
-exports.debug = exports.deprecate(function(x) {
- process.stderr.write('DEBUG: ' + x + '\n');
-}, 'util.debug: Use console.error instead');
-
-
-exports.error = exports.deprecate(function(x) {
- for (var i = 0, len = arguments.length; i < len; ++i) {
- process.stderr.write(arguments[i] + '\n');
- }
-}, 'util.error: Use console.error instead');
-
-
-exports.pump = exports.deprecate(function(readStream, writeStream, callback) {
- var callbackCalled = false;
-
- function call(a, b, c) {
- if (callback && !callbackCalled) {
- callback(a, b, c);
- callbackCalled = true;
- }
- }
-
- readStream.addListener('data', function(chunk) {
- if (writeStream.write(chunk) === false) readStream.pause();
- });
-
- writeStream.addListener('drain', function() {
- readStream.resume();
- });
-
- readStream.addListener('end', function() {
- writeStream.end();
- });
-
- readStream.addListener('close', function() {
- call();
- });
-
- readStream.addListener('error', function(err) {
- writeStream.end();
- call(err);
- });
-
- writeStream.addListener('error', function(err) {
- readStream.destroy();
- call(err);
- });
-}, 'util.pump(): Use readableStream.pipe() instead');
-
-
-var uv;
-exports._errnoException = function(err, syscall) {
- if (isUndefined(uv)) uv = process.binding('uv');
- var errname = uv.errname(err);
- var e = new Error(syscall + ' ' + errname);
- e.code = errname;
- e.errno = errname;
- e.syscall = syscall;
- return e;
-};
+}

+ 0
- 107
advancedcontentfilter/vendor/npm-asset/core-util-is/lib/util.js View File

@ -1,107 +0,0 @@
// Copyright Joyent, Inc. and other Node 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.
// NOTE: These type checking functions intentionally don't use `instanceof`
// because it is fragile and can be easily faked with `Object.create()`.
function isArray(arg) {
if (Array.isArray) {
return Array.isArray(arg);
}
return objectToString(arg) === '[object Array]';
}
exports.isArray = isArray;
function isBoolean(arg) {
return typeof arg === 'boolean';
}
exports.isBoolean = isBoolean;
function isNull(arg) {
return arg === null;
}
exports.isNull = isNull;
function isNullOrUndefined(arg) {
return arg == null;
}
exports.isNullOrUndefined = isNullOrUndefined;
function isNumber(arg) {
return typeof arg === 'number';
}
exports.isNumber = isNumber;
function isString(arg) {
return typeof arg === 'string';
}
exports.isString = isString;
function isSymbol(arg) {
return typeof arg === 'symbol';
}
exports.isSymbol = isSymbol;
function isUndefined(arg) {
return arg === void 0;
}
exports.isUndefined = isUndefined;
function isRegExp(re) {
return objectToString(re) === '[object RegExp]';
}
exports.isRegExp = isRegExp;
function isObject(arg) {
return typeof arg === 'object' && arg !== null;
}
exports.isObject = isObject;
function isDate(d) {
return objectToString(d) === '[object Date]';
}
exports.isDate = isDate;
function isError(e) {
return (objectToString(e) === '[object Error]' || e instanceof Error);
}
exports.isError = isError;
function isFunction(arg) {
return typeof arg === 'function';
}
exports.isFunction = isFunction;
function isPrimitive(arg) {
return arg === null ||
typeof arg === 'boolean' ||
typeof arg === 'number' ||
typeof arg === 'string' ||
typeof arg === 'symbol' || // ES6 symbol
typeof arg === 'undefined';
}
exports.isPrimitive = isPrimitive;
exports.isBuffer = Buffer.isBuffer;
function objectToString(o) {
return Object.prototype.toString.call(o);
}

+ 0
- 32
advancedcontentfilter/vendor/npm-asset/core-util-is/package.json View File

@ -1,32 +0,0 @@
{
"name": "core-util-is",
"version": "1.0.2",
"description": "The `util.is*` functions introduced in Node v0.12.",
"main": "lib/util.js",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/core-util-is"
},
"keywords": [
"util",
"isBuffer",
"isArray",
"isNumber",
"isString",
"isRegExp",
"isThis",
"isThat",
"polyfill"
],
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
"license": "MIT",
"bugs": {
"url": "https://github.com/isaacs/core-util-is/issues"
},
"scripts": {
"test": "tap test.js"
},
"devDependencies": {
"tap": "^2.3.0"
}
}

+ 0
- 68
advancedcontentfilter/vendor/npm-asset/core-util-is/test.js View File

@ -1,68 +0,0 @@
var assert = require('tap');
var t = require('./lib/util');
assert.equal(t.isArray([]), true);
assert.equal(t.isArray({}), false);
assert.equal(t.isBoolean(null), false);
assert.equal(t.isBoolean(true), true);
assert.equal(t.isBoolean(false), true);
assert.equal(t.isNull(null), true);
assert.equal(t.isNull(undefined), false);
assert.equal(t.isNull(false), false);
assert.equal(t.isNull(), false);
assert.equal(t.isNullOrUndefined(null), true);
assert.equal(t.isNullOrUndefined(undefined), true);
assert.equal(t.isNullOrUndefined(false), false);
assert.equal(t.isNullOrUndefined(), true);
assert.equal(t.isNumber(null), false);
assert.equal(t.isNumber('1'), false);
assert.equal(t.isNumber(1), true);
assert.equal(t.isString(null), false);
assert.equal(t.isString('1'), true);
assert.equal(t.isString(1), false);
assert.equal(t.isSymbol(null), false);
assert.equal(t.isSymbol('1'), false);
assert.equal(t.isSymbol(1), false);
assert.equal(t.isSymbol(Symbol()), true);
assert.equal(t.isUndefined(null), false);
assert.equal(t.isUndefined(undefined), true);
assert.equal(t.isUndefined(false), false);
assert.equal(t.isUndefined(), true);
assert.equal(t.isRegExp(null), false);
assert.equal(t.isRegExp('1'), false);
assert.equal(t.isRegExp(new RegExp()), true);
assert.equal(t.isObject({}), true);
assert.equal(t.isObject([]), true);
assert.equal(t.isObject(new RegExp()), true);
assert.equal(t.isObject(new Date()), true);
assert.equal(t.isDate(null), false);
assert.equal(t.isDate('1'), false);
assert.equal(t.isDate(new Date()), true);
assert.equal(t.isError(null), false);
assert.equal(t.isError({ err: true }), false);
assert.equal(t.isError(new Error()), true);
assert.equal(t.isFunction(null), false);
assert.equal(t.isFunction({ }), false);
assert.equal(t.isFunction(function() {}), true);
assert.equal(t.isPrimitive(null), true);
assert.equal(t.isPrimitive(''), true);
assert.equal(t.isPrimitive(0), true);
assert.equal(t.isPrimitive(new Date()), false);
assert.equal(t.isBuffer(null), false);
assert.equal(t.isBuffer({}), false);
assert.equal(t.isBuffer(new Buffer(0)), true);

+ 0
- 94
advancedcontentfilter/vendor/npm-asset/decode-uri-component/index.js View File

@ -1,94 +0,0 @@
'use strict';
var token = '%[a-f0-9]{2}';
var singleMatcher = new RegExp(token, 'gi');
var multiMatcher = new RegExp('(' + token + ')+', 'gi');
function decodeComponents(components, split) {
try {
// Try to decode the entire string first
return decodeURIComponent(components.join(''));
} catch (err) {
// Do nothing
}
if (components.length === 1) {
return components;
}
split = split || 1;
// Split the array in 2 parts
var left = components.slice(0, split);
var right = components.slice(split);
return Array.prototype.concat.call([], decodeComponents(left), decodeComponents(right));
}
function decode(input) {
try {
return decodeURIComponent(input);
} catch (err) {
var tokens = input.match(singleMatcher);
for (var i = 1; i < tokens.length; i++) {
input = decodeComponents(tokens, i).join('');
tokens = input.match(singleMatcher);
}
return input;
}
}
function customDecodeURIComponent(input) {
// Keep track of all the replacements and prefill the map with the `BOM`
var replaceMap = {
'%FE%FF': '\uFFFD\uFFFD',
'%FF%FE': '\uFFFD\uFFFD'
};
var match = multiMatcher.exec(input);
while (match) {
try {
// Decode as big chunks as possible
replaceMap[match[0]] = decodeURIComponent(match[0]);
} catch (err) {
var result = decode(match[0]);
if (result !== match[0]) {
replaceMap[match[0]] = result;
}
}
match = multiMatcher.exec(input);
}
// Add `%C2` at the end of the map to make sure it does not replace the combinator before everything else
replaceMap['%C2'] = '\uFFFD';
var entries = Object.keys(replaceMap);
for (var i = 0; i < entries.length; i++) {
// Replace all decoded components
var key = entries[i];
input = input.replace(new RegExp(key, 'g'), replaceMap[key]);
}
return input;
}
module.exports = function (encodedURI) {
if (typeof encodedURI !== 'string') {
throw new TypeError('Expected `encodedURI` to be of type `string`, got `' + typeof encodedURI + '`');
}
try {
encodedURI = encodedURI.replace(/\+/g, ' ');
// Try the built in decoder first
return decodeURIComponent(encodedURI);
} catch (err) {
// Fallback to a more advanced decoder
return customDecodeURIComponent(encodedURI);
}
};

+ 0
- 21
advancedcontentfilter/vendor/npm-asset/decode-uri-component/license View File

@ -1,21 +0,0 @@
The MIT License (MIT)
Copyright (c) Sam Verschueren <sam.verschueren@gmail.com> (github.com/SamVerschueren)
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.

+ 0
- 37
advancedcontentfilter/vendor/npm-asset/decode-uri-component/package.json View File

@ -1,37 +0,0 @@
{
"name": "decode-uri-component",
"version": "0.2.0",
"description": "A better decodeURIComponent",
"license": "MIT",
"repository": "SamVerschueren/decode-uri-component",
"author": {
"name": "Sam Verschueren",
"email": "sam.verschueren@gmail.com",
"url": "github.com/SamVerschueren"
},
"engines": {
"node": ">=0.10"
},
"scripts": {
"test": "xo && nyc ava",
"coveralls": "nyc report --reporter=text-lcov | coveralls"
},
"files": [
"index.js"
],
"keywords": [
"decode",
"uri",
"component",
"decodeuricomponent",
"components",
"decoder",
"url"
],
"devDependencies": {
"ava": "^0.17.0",
"coveralls": "^2.13.1",
"nyc": "^10.3.2",
"xo": "^0.16.0"
}
}

+ 0
- 70
advancedcontentfilter/vendor/npm-asset/decode-uri-component/readme.md View File

@ -1,70 +0,0 @@
# decode-uri-component
[![Build Status](https://travis-ci.org/SamVerschueren/decode-uri-component.svg?branch=master)](https://travis-ci.org/SamVerschueren/decode-uri-component) [![Coverage Status](https://coveralls.io/repos/SamVerschueren/decode-uri-component/badge.svg?branch=master&service=github)](https://coveralls.io/github/SamVerschueren/decode-uri-component?branch=master)
> A better [decodeURIComponent](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent)
## Why?
- Decodes `+` to a space.
- Converts the [BOM](https://en.wikipedia.org/wiki/Byte_order_mark) to a [replacement character](https://en.wikipedia.org/wiki/Specials_(Unicode_block)#Replacement_character) `�`.
- Does not throw with invalid encoded input.
- Decodes as much of the string as possible.
## Install
```
$ npm install --save decode-uri-component
```
## Usage
```js
const decodeUriComponent = require('decode-uri-component');
decodeUriComponent('%25');
//=> '%'
decodeUriComponent('%');
//=> '%'
decodeUriComponent('st%C3%A5le');
//=> 'ståle'
decodeUriComponent('%st%C3%A5le%');
//=> '%ståle%'
decodeUriComponent('%%7Bst%C3%A5le%7D%');
//=> '%{ståle}%'
decodeUriComponent('%7B%ab%%7C%de%%7D');
//=> '{%ab%|%de%}'
decodeUriComponent('%FE%FF');
//=> '\uFFFD\uFFFD'
decodeUriComponent('%C2');
//=> '\uFFFD'
decodeUriComponent('%C2%B5');
//=> 'µ'
```
## API
### decodeUriComponent(encodedURI)
#### encodedURI
Type: `string`
An encoded component of a Uniform Resource Identifier.
## License
MIT © [Sam Verschueren](https://github.com/SamVerschueren)

+ 0
- 29
advancedcontentfilter/vendor/npm-asset/decompress-response/index.js View File

@ -1,29 +0,0 @@
'use strict';
const PassThrough = require('stream').PassThrough;
const zlib = require('zlib');
const mimicResponse = require('mimic-response');
module.exports = response => {
// TODO: Use Array#includes when targeting Node.js 6
if (['gzip', 'deflate'].indexOf(response.headers['content-encoding']) === -1) {
return response;
}
const unzip = zlib.createUnzip();
const stream = new PassThrough();
mimicResponse(response, stream);
unzip.on('error', err => {
if (err.code === 'Z_BUF_ERROR') {
stream.end();
return;
}
stream.emit('error', err);
});
response.pipe(unzip).pipe(stream);
return stream;
};

+ 0
- 21
advancedcontentfilter/vendor/npm-asset/decompress-response/license View File

@ -1,21 +0,0 @@
`The MIT License (MIT)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.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: