Skip to content
This repository was archived by the owner on Jun 17, 2021. It is now read-only.

Fix large string copies #269

Merged
merged 2 commits into from
Jul 31, 2020
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 .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- uses: actions/checkout@v1
- uses: actions/checkout@v2
- run: npm install
- run: npm run test

Expand Down
8 changes: 4 additions & 4 deletions src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import * as ethjsUtil from 'ethjs-util'
* @param {string} input string to check hex prefix of
*/
export const assertIsHexString = function(input: string): void {
const msg = `This method only supports 0x-prefixed hex strings but input was: ${input}`
if (!ethjsUtil.isHexString(input)) {
const msg = `This method only supports 0x-prefixed hex strings but input was: ${input}`
throw new Error(msg)
}
}
Expand All @@ -16,8 +16,8 @@ export const assertIsHexString = function(input: string): void {
* @param {Buffer} input value to check
*/
export const assertIsBuffer = function(input: Buffer): void {
const msg = `This method only supports Buffer but input was: ${input}`
if (!Buffer.isBuffer(input)) {
const msg = `This method only supports Buffer but input was: ${input}`
throw new Error(msg)
}
}
Expand All @@ -27,8 +27,8 @@ export const assertIsBuffer = function(input: Buffer): void {
* @param {number[]} input value to check
*/
export const assertIsArray = function(input: number[]): void {
const msg = `This method only supports number arrays but input was: ${input}`
if (!Array.isArray(input)) {
const msg = `This method only supports number arrays but input was: ${input}`
throw new Error(msg)
}
}
Expand All @@ -38,8 +38,8 @@ export const assertIsArray = function(input: number[]): void {
* @param {string} input value to check
*/
export const assertIsString = function(input: string): void {
const msg = `This method only supports strings but input was: ${input}`
if (typeof input !== 'string') {
const msg = `This method only supports strings but input was: ${input}`
throw new Error(msg)
}
}
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy