Commit d3e31027 authored by Inphi's avatar Inphi Committed by GitHub

Update packages/contracts-bedrock/scripts/generate-snapshots.ts

Co-authored-by: default avatarcoderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
parent b21fe25f
...@@ -67,7 +67,11 @@ const sortKeys = (obj: any) => { ...@@ -67,7 +67,11 @@ const sortKeys = (obj: any) => {
// ContractName.0.9.8.json -> ContractName.sol // ContractName.0.9.8.json -> ContractName.sol
// ContractName.json -> ContractName.sol // ContractName.json -> ContractName.sol
const parseArtifactName = (artifactVersionFile: string): string => { const parseArtifactName = (artifactVersionFile: string): string => {
return artifactVersionFile.match(/(.*?)\.([0-9]+\.[0-9]+\.[0-9]+)?/)[1] const match = artifactVersionFile.match(/(.*?)\.([0-9]+\.[0-9]+\.[0-9]+)?/);
if (!match) {
throw new Error(`Invalid artifact file name: ${artifactVersionFile}`);
}
return match[1];
} }
const main = async () => { const main = async () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment