Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: is_js vulnearabilities #411

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"elliptic": "^6.5.4",
"eslint-utils": "^1.4.2",
"events": "^3.0.0",
"is_js": "^0.9.0",
"is-it-check": "^1.0.12",
"lodash": "^4.17.21",
"minimist": "^1.2.5",
"ndjson": "^1.5.0",
Expand Down
2 changes: 1 addition & 1 deletion src/amino/decoder/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import is from "is_js"
import is from "is-it-check"
import {
string as varString,
bool as varBool,
Expand All @@ -8,7 +8,7 @@

import typeToTyp3 from "../../utils/encoderHelper"

const decoder = (bytes: Buffer, varType: any) => {

Check warning on line 11 in src/amino/decoder/index.ts

View workflow job for this annotation

GitHub Actions / Test

Unexpected any. Specify a different type
const val = varType.decode(bytes, 0)
const offset = varType.encodingLength(val)
return { val, offset }
Expand All @@ -23,8 +23,8 @@
* */
export const unMarshalBinaryLengthPrefixed = (
bytes: Buffer,
type: any

Check warning on line 26 in src/amino/decoder/index.ts

View workflow job for this annotation

GitHub Actions / Test

Unexpected any. Specify a different type
): any => {

Check warning on line 27 in src/amino/decoder/index.ts

View workflow job for this annotation

GitHub Actions / Test

Unexpected any. Specify a different type
if (bytes.length === 0) throw new TypeError("Cannot decode empty bytes")

// read byte-length prefix
Expand All @@ -45,7 +45,7 @@
* @param {Object} type
* @returns {Object}
* */
export const unMarshalBinaryBare = (bytes: Buffer, type: any): any => {

Check warning on line 48 in src/amino/decoder/index.ts

View workflow job for this annotation

GitHub Actions / Test

Unexpected any. Specify a different type

Check warning on line 48 in src/amino/decoder/index.ts

View workflow job for this annotation

GitHub Actions / Test

Unexpected any. Specify a different type
if (!is.object(type)) throw new TypeError("type should be object")

if (!Buffer.isBuffer(bytes)) throw new TypeError("bytes must be buffer")
Expand All @@ -61,7 +61,7 @@

const decodeBinary = (
bytes: Buffer,
type: any,

Check warning on line 64 in src/amino/decoder/index.ts

View workflow job for this annotation

GitHub Actions / Test

Unexpected any. Specify a different type
isLengthPrefixed?: boolean
): any => {
if (Buffer.isBuffer(type)) {
Expand Down
2 changes: 1 addition & 1 deletion src/amino/encoder/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import is from "is_js"
import is from "is-it-check"
import { string as VarString } from "protocol-buffers-encodings"

import typeToTyp3 from "../../utils/encoderHelper"
Expand Down
2 changes: 1 addition & 1 deletion src/crypto/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as bip32 from "bip32"
import * as bip39 from "bip39"
import cryp from "crypto-browserify"
import { ec as EC, curve } from "elliptic"
import is from "is_js"
import is from "is-it-check"
import csprng from "secure-random"
import ecc from "tiny-secp256k1"
import uuid from "uuid"
Expand Down
2 changes: 1 addition & 1 deletion src/declarations.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable */

declare module "is_js" {
declare module "is-it-check" {
export const boolean: (a: any) => a is boolean
export const number: (a: any) => a is number
export const integer: (a: any) => a is number
Expand Down
2 changes: 1 addition & 1 deletion src/rpc/baseRpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import axios from "axios"
import { EventEmitter } from "events"
import is from "is_js"
import is from "is-it-check"
import ndjson from "ndjson"
import Pumpify from "pumpify"
import url from "url"
Expand Down
2 changes: 1 addition & 1 deletion src/utils/encoderHelper.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import is from "is_js"
import is from "is-it-check"

// typeToTyp3
//amino type convert
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4858,6 +4858,11 @@ is-glob@^4.0.0, is-glob@^4.0.1:
dependencies:
is-extglob "^2.1.1"

is-it-check@^1.0.12:
version "1.0.12"
resolved "https://registry.yarnpkg.com/is-it-check/-/is-it-check-1.0.12.tgz#001761b0e2b98b5dbb19685fbe950e153c62ba80"
integrity sha512-PR3WPg5i52YRDRUvrQQM9PJCDFR3/hJ1ZdOxS0ooWia3EcrNDnz+4H4zcw4SKmC404YqhEjDrPeFytZCblf4aQ==

is-number@^3.0.0:
version "3.0.0"
resolved "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz"
Expand Down Expand Up @@ -4933,11 +4938,6 @@ is-wsl@^2.2.0:
dependencies:
is-docker "^2.0.0"

is_js@^0.9.0:
version "0.9.0"
resolved "https://registry.npmjs.org/is_js/-/is_js-0.9.0.tgz"
integrity sha1-CrlFQFArp6+iTIVqqYVWFmnpxS0=

isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0:
version "1.0.0"
resolved "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz"
Expand Down
Loading