From 35483b43559b94114dca755f130e6ccb48f18d3b Mon Sep 17 00:00:00 2001 From: Dimitri Benin Date: Mon, 26 Nov 2018 20:30:14 +0100 Subject: [PATCH] Impove types for bitwise-xor --- types/bitwise-xor/bitwise-xor-tests.ts | 12 ++-- types/bitwise-xor/index.d.ts | 7 +-- types/bitwise-xor/tsconfig.json | 4 +- types/bitwise-xor/tslint.json | 78 +------------------------- 4 files changed, 11 insertions(+), 90 deletions(-) diff --git a/types/bitwise-xor/bitwise-xor-tests.ts b/types/bitwise-xor/bitwise-xor-tests.ts index b19768f11f..13ddab8b66 100644 --- a/types/bitwise-xor/bitwise-xor-tests.ts +++ b/types/bitwise-xor/bitwise-xor-tests.ts @@ -1,10 +1,8 @@ +'use strict'; +import xor = require('bitwise-xor'); -"use strict"; +let b: Buffer; -import xor = require("bitwise-xor"); - -var b: Buffer; - -b = xor("a", "b"); -b = xor(new Buffer("a"), new Buffer("b")); +b = xor('a', 'b'); +b = xor(new Buffer('a'), new Buffer('b')); diff --git a/types/bitwise-xor/index.d.ts b/types/bitwise-xor/index.d.ts index 9960023c97..3147c5b675 100644 --- a/types/bitwise-xor/index.d.ts +++ b/types/bitwise-xor/index.d.ts @@ -1,15 +1,14 @@ -// Type definitions for bitwise-xor 0.0.0 +// Type definitions for bitwise-xor 0.0 // Project: https://github.com/czzarr/node-bitwise-xor // Definitions by: Rogier Schouten +// BendingBender // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// - /** * Bitwise XOR between two Buffers or Strings, returns a Buffer */ -declare function xor(b1: Buffer, b2: Buffer): Buffer; -declare function xor(s1: string, s2: string): Buffer; +declare function xor(a: Buffer | string, b: Buffer | string): Buffer; export = xor; diff --git a/types/bitwise-xor/tsconfig.json b/types/bitwise-xor/tsconfig.json index a6b66cda37..f02f5ef72b 100644 --- a/types/bitwise-xor/tsconfig.json +++ b/types/bitwise-xor/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -20,4 +20,4 @@ "index.d.ts", "bitwise-xor-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/bitwise-xor/tslint.json b/types/bitwise-xor/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/bitwise-xor/tslint.json +++ b/types/bitwise-xor/tslint.json @@ -1,79 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } + "extends": "dtslint/dt.json" }