Skip to content

Commit

Permalink
Fix for queries with missing fields, lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewCallis committed Dec 24, 2021
1 parent 01d09a1 commit 2985763
Show file tree
Hide file tree
Showing 23 changed files with 11,917 additions and 3,834 deletions.
44 changes: 21 additions & 23 deletions .eslintrc
Expand Up @@ -2,38 +2,38 @@
"extends": [
"airbnb",
"plugin:ava/recommended",
"plugin:import/recommended",
"plugin:jsdoc/recommended",
"plugin:jsx-a11y/recommended",
"plugin:node/recommended",
"plugin:optimize-regex/all",
"plugin:ramda/recommended",
"plugin:security/recommended",
"plugin:unicorn/recommended"
"plugin:security/recommended"
],
"plugins": [
"anti-trojan-source",
"ava",
"import",
"jsdoc",
"jsx-a11y",
"no-inferred-method-name",
"node",
"optimize-regex",
"ramda",
"security",
"unicorn",
"xss"
],
"env": {
"es6": true,
"browser": true,
"mocha": true
},
"globals": {
"sinon": false,
"mocha": true,
"expect": true
"node": true
},
"globals": {},
"parserOptions": {
"ecmaVersion": 2020
"ecmaVersion": 2021,
"requireConfigFile": false
},
"rules": {
"anti-trojan-source/no-bidi": "error",
"import/no-extraneous-dependencies": [
"error", {
"devDependencies": ["**/*.test.js", "**/test/**/*.js"],
Expand All @@ -43,7 +43,6 @@
],
"ava/no-only-test": 0,
"camelcase": 0,
"class-methods-use-this": 0,
"consistent-return": ["warn", { "treatUndefinedAsUnspecified": false }],
"global-require": 0,
"import/no-dynamic-require": 0,
Expand All @@ -53,22 +52,21 @@
"no-inferred-method-name/no-inferred-method-name": "error",
"no-param-reassign": 0,
"no-plusplus": 0,
"no-restricted-syntax": 0,
"no-underscore-dangle": 0,
"no-unused-vars": ["error", { "varsIgnorePattern": "^_", "argsIgnorePattern": "^_", "caughtErrors": "none" }],
"node/no-unpublished-require": 0,
"object-curly-newline": 0,
"optimize-regex/optimize-regex": "warn",
"ramda/prefer-ramda-boolean": 0,
"security/detect-non-literal-fs-filename": 0,
"security/detect-non-literal-require": 0,
"security/detect-object-injection": 0,
"unicorn/catch-error-name": 0,
"unicorn/filename-case": 0,
"unicorn/no-for-loop": 0,
"unicorn/no-fn-reference-in-iterator": 0,
"unicorn/no-null": 0,
"unicorn/no-reduce": 0,
"unicorn/no-useless-undefined": 0,
"unicorn/prevent-abbreviations": 0
"security/detect-object-injection": 0
},
"settings": {
"jsdoc": {
"mode": "typescript"
},
"react": {
"version": "detect"
}
}
}
2 changes: 1 addition & 1 deletion .nvmrc
@@ -1 +1 @@
v14.15.0
v16.13.1
3 changes: 2 additions & 1 deletion .travis.yml
@@ -1,8 +1,8 @@
language: node_js
node_js:
- "10"
- "12"
- "14"
- "16"

install:
- npm ci
Expand All @@ -12,6 +12,7 @@ cache:
- "$HOME/.npm"

script:
- npm install -g coveralls
- npm run lint
- npm run validate --prod
- npm run test && nyc report --reporter=text-lcov | coveralls
Expand Down
23 changes: 23 additions & 0 deletions .tsconfig.json
@@ -0,0 +1,23 @@
{
"include": [
"src/**/*"
],
"exclude": [
"node_modules",
"test/**/*.js"
],
"compilerOptions": {
"allowJs": true,
"checkJs": false,
"declaration": true,
"emitDeclarationOnly": true,
"extendedDiagnostics": true,
"moduleResolution": "node",
"noEmit": false,
"outFile": "types/index.d.ts",
"removeComments": true,
"strict": false,
"target": "esnext",
"skipLibCheck": true
}
}
2 changes: 1 addition & 1 deletion README.md
@@ -1,6 +1,6 @@
[![view on npm](https://img.shields.io/npm/v/uttori-utilities.svg)](https://www.npmjs.org/package/uttori-utilities)
[![npm module downloads](https://img.shields.io/npm/dt/uttori-utilities.svg)](https://www.npmjs.org/package/uttori-utilities)
[![Build Status](https://travis-ci.org/uttori/uttori-utilities.svg?branch=master)](https://travis-ci.org/uttori/uttori-utilities)
[![Build Status](https://travis-ci.com/uttori/uttori-utilities.svg?branch=master)](https://travis-ci.com/uttori/uttori-utilities)
[![Dependency Status](https://david-dm.org/uttori/uttori-utilities.svg)](https://david-dm.org/uttori/uttori-utilities)
[![Coverage Status](https://coveralls.io/repos/uttori/uttori-utilities/badge.svg?branch=master)](https://coveralls.io/r/uttori/uttori-utilities?branch=master)

Expand Down
8 changes: 2 additions & 6 deletions docs/diff-parser.md
Expand Up @@ -87,9 +87,7 @@ Parse Unified Diff content.
| Param | Type | Description |
| --- | --- | --- |
| line | <code>string</code> | The line to parse. |
| [header] | <code>object</code> | The the header for the diff block. |
| [header.old] | <code>number</code> | The previous line number of the current line. |
| [header.new] | <code>number</code> | The new line number of the current line. |
| [header] | <code>object</code> | The header with the keys 'old' for the previous line number of the current line and 'new' for the new line number of the current line. |

<a name="DiffParser.parseCombinedContent"></a>

Expand All @@ -102,9 +100,7 @@ Parse Combined Diff content.
| Param | Type | Description |
| --- | --- | --- |
| line | <code>string</code> | The line to parse. |
| [header] | <code>object</code> | The the header for the diff block. |
| [header.old] | <code>number</code> | The previous line number of the current line. |
| [header.new] | <code>number</code> | The new line number of the current line. |
| [header] | <code>object</code> | The header with the keys 'old' for the previous line number of the current line and 'new' for the new line number of the current line. |

<a name="DiffParser.praseChunkHeader"></a>

Expand Down
12 changes: 6 additions & 6 deletions docs/function-queue.md
Expand Up @@ -6,13 +6,13 @@ Queue functionality for function calling.
**Kind**: global class
<a name="FunctionQueue.throttle"></a>

### FunctionQueue.throttle(max_requests_per_interval, interval, evenly_spaced) ⇒ <code>function</code>
### FunctionQueue.throttle(max_requests_per_interval, interval, [evenly_spaced]) ⇒ <code>function</code>
**Kind**: static method of [<code>FunctionQueue</code>](#FunctionQueue)
**Returns**: <code>function</code> - A function that can enqueue items.

| Param | Type | Description |
| --- | --- | --- |
| max_requests_per_interval | <code>number</code> | The number of calls to execute for a single interval. |
| interval | <code>number</code> | The time between calls in ms. |
| evenly_spaced | <code>boolean</code> | Determines if all requests should be evenly spaced. |
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| max_requests_per_interval | <code>number</code> | | The number of calls to execute for a single interval. |
| interval | <code>number</code> | | The time between calls in ms. |
| [evenly_spaced] | <code>boolean</code> | <code>false</code> | Determines if all requests should be evenly spaced. |

14 changes: 7 additions & 7 deletions docs/network.md
@@ -1,7 +1,7 @@
## Functions

<dl>
<dt><a href="#base">base(url, [options], [context], callback)</a> ⇒ <code>Promise</code></dt>
<dt><a href="#base">base(url, options, context, callback)</a> ⇒ <code>Promise</code></dt>
<dd><p>Execute a HTTP(S) request with options provided.</p>
</dd>
<dt><a href="#json">json(url, [options], [context])</a> ⇒ <code>Promise</code></dt>
Expand All @@ -17,7 +17,7 @@

<a name="base"></a>

## base(url, [options], [context], callback) ⇒ <code>Promise</code>
## base(url, options, context, callback) ⇒ <code>Promise</code>
Execute a HTTP(S) request with options provided.

**Kind**: global function
Expand All @@ -31,11 +31,11 @@ Execute a HTTP(S) request with options provided.
| Param | Type | Description |
| --- | --- | --- |
| url | <code>string</code> \| <code>URL</code> | URL to communicate with. |
| [options] | <code>object</code> | Configuration to pass to `http(s).request()`. |
| [options.method] | <code>object</code> | HTTP Method to use. |
| [context] | <code>object</code> | Internal options and data used in the request. |
| [context.responseEncoding] | <code>string</code> | Encoding to specify response should be parsed as. |
| [context.data] | <code>string</code> \| <code>Buffer</code> | Data to be sent for POST/PUT requests. |
| options | <code>object</code> | Configuration to pass to `http(s).request()`. |
| options.method | <code>object</code> | HTTP Method to use. |
| context | <code>object</code> | Internal options and data used in the request. |
| context.responseEncoding | <code>string</code> | Encoding to specify response should be parsed as. |
| context.data | <code>string</code> \| <code>Buffer</code> | Data to be sent for POST/PUT requests. |
| callback | <code>function</code> | Logic for responding to non-error responses. |

**Example** *(Network.request(url, options, context))*
Expand Down

0 comments on commit 2985763

Please sign in to comment.