Skip to content

Commit

Permalink
fixed issue with input type export, eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
dills122 authored and danm committed Aug 2, 2020
1 parent 6e0865a commit b998d18
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
4 changes: 0 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
module.exports = {
extends: ["airbnb-typescript/base"],
env: {
"jest": true
},
rules: {
"no-console": ["error", { allow: ["warn", "error"] }],
"prefer-default-export": false,
}
};
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"types": "lib/imageHash.d.ts",
"scripts": {
"test": "npx mocha -r ts-node/register __tests__/*.test.ts ",
"build": "tsc"
"build": "tsc",
"lint": "eslint src/*.ts",
"lint:fix": "eslint src/*.ts --fix"
},
"files": [
"lib"
Expand Down
7 changes: 4 additions & 3 deletions src/imageHash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,16 @@ const isUrlRequestObject = (obj: UrlRequestObject | BufferObject): obj is UrlReq

const isBufferObject = (obj: UrlRequestObject | BufferObject): obj is BufferObject => {
const casted = (obj as BufferObject);
return Buffer.isBuffer(casted.data) || (Buffer.isBuffer(casted.data) && (casted.ext && casted.ext.length > 0));
return Buffer.isBuffer(casted.data)
|| (Buffer.isBuffer(casted.data) && (casted.ext && casted.ext.length > 0));
};

interface UrlRequestObject {
export interface UrlRequestObject {
encoding?: string | null,
url: string | null,
}

interface BufferObject {
export interface BufferObject {
ext?: string,
data: Buffer,
name?: string
Expand Down

0 comments on commit b998d18

Please sign in to comment.