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

Commit ba3e344

Browse files
Merge pull request #269 from ethereumjs/fix-helper-memcopy
Fix large string copies
2 parents c6e8f3e + fbaf1b8 commit ba3e344

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
with:
2121
node-version: ${{ matrix.node-version }}
2222

23-
- uses: actions/checkout@v1
23+
- uses: actions/checkout@v2
2424
- run: npm install
2525
- run: npm run test
2626

src/helpers.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import * as ethjsUtil from 'ethjs-util'
55
* @param {string} input string to check hex prefix of
66
*/
77
export const assertIsHexString = function(input: string): void {
8-
const msg = `This method only supports 0x-prefixed hex strings but input was: ${input}`
98
if (!ethjsUtil.isHexString(input)) {
9+
const msg = `This method only supports 0x-prefixed hex strings but input was: ${input}`
1010
throw new Error(msg)
1111
}
1212
}
@@ -16,8 +16,8 @@ export const assertIsHexString = function(input: string): void {
1616
* @param {Buffer} input value to check
1717
*/
1818
export const assertIsBuffer = function(input: Buffer): void {
19-
const msg = `This method only supports Buffer but input was: ${input}`
2019
if (!Buffer.isBuffer(input)) {
20+
const msg = `This method only supports Buffer but input was: ${input}`
2121
throw new Error(msg)
2222
}
2323
}
@@ -27,8 +27,8 @@ export const assertIsBuffer = function(input: Buffer): void {
2727
* @param {number[]} input value to check
2828
*/
2929
export const assertIsArray = function(input: number[]): void {
30-
const msg = `This method only supports number arrays but input was: ${input}`
3130
if (!Array.isArray(input)) {
31+
const msg = `This method only supports number arrays but input was: ${input}`
3232
throw new Error(msg)
3333
}
3434
}
@@ -38,8 +38,8 @@ export const assertIsArray = function(input: number[]): void {
3838
* @param {string} input value to check
3939
*/
4040
export const assertIsString = function(input: string): void {
41-
const msg = `This method only supports strings but input was: ${input}`
4241
if (typeof input !== 'string') {
42+
const msg = `This method only supports strings but input was: ${input}`
4343
throw new Error(msg)
4444
}
4545
}

0 commit comments

Comments
 (0)
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