@truffle/compile-common
Advanced tools
Comparing version 0.8.1 to 0.9.0
@@ -21,4 +21,6 @@ "use strict"; | ||
metadata, | ||
bytecode: forBytecode(bytecode), | ||
deployedBytecode: forBytecode(deployedBytecode), | ||
bytecode: bytecode ? forBytecode(bytecode) : undefined, | ||
deployedBytecode: deployedBytecode | ||
? forBytecode(deployedBytecode) | ||
: undefined, | ||
compiler, | ||
@@ -35,5 +37,2 @@ devdoc, | ||
function forBytecode(bytecode) { | ||
if (!bytecode) { | ||
return undefined; | ||
} | ||
if (typeof bytecode === "object") { | ||
@@ -46,3 +45,8 @@ return bytecode; | ||
.replace(/__[^_]+_*/g, (linkReference, characterOffset) => { | ||
const [, name] = linkReference.match(/__([^_]+)_*/); | ||
const match = linkReference.match(/__([^_]+)_*/); | ||
if (match === null) { | ||
//this can't actually happen, but strictNullChecks requires it | ||
throw new Error("Could not extract link reference name"); | ||
} | ||
const name = match[1]; | ||
const characterLength = linkReference.length; | ||
@@ -49,0 +53,0 @@ const offset = characterOffset / 2; |
@@ -14,3 +14,3 @@ { | ||
}, | ||
"version": "0.8.1", | ||
"version": "0.9.0", | ||
"main": "dist/src/index.js", | ||
@@ -36,3 +36,3 @@ "scripts": { | ||
}, | ||
"gitHead": "04c0b3168075317b4f15ecab2fb69320eab2ae72" | ||
"gitHead": "035a92efc4979550e384acba50436771bba1bccd" | ||
} |
@@ -41,4 +41,6 @@ import type { Bytecode, CompiledContract, LinkReference } from "../types"; | ||
metadata, | ||
bytecode: forBytecode(bytecode), | ||
deployedBytecode: forBytecode(deployedBytecode), | ||
bytecode: bytecode ? forBytecode(bytecode) : undefined, | ||
deployedBytecode: deployedBytecode | ||
? forBytecode(deployedBytecode) | ||
: undefined, | ||
compiler, | ||
@@ -55,5 +57,2 @@ devdoc, | ||
export function forBytecode(bytecode: string): Bytecode { | ||
if (!bytecode) { | ||
return undefined; | ||
} | ||
if (typeof bytecode === "object") { | ||
@@ -68,3 +67,8 @@ return bytecode; | ||
.replace(/__[^_]+_*/g, (linkReference, characterOffset) => { | ||
const [, name] = linkReference.match(/__([^_]+)_*/); | ||
const match = linkReference.match(/__([^_]+)_*/); | ||
if (match === null) { | ||
//this can't actually happen, but strictNullChecks requires it | ||
throw new Error("Could not extract link reference name"); | ||
} | ||
const name = match[1]; | ||
@@ -71,0 +75,0 @@ const characterLength = linkReference.length; |
@@ -8,2 +8,4 @@ { | ||
"noImplicitAny": true, | ||
"skipLibCheck": true, | ||
"strictNullChecks": true, | ||
"moduleResolution": "node", | ||
@@ -10,0 +12,0 @@ "sourceMap": true, |
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
39899
938
1