MCPcopy Create free account
hub / github.com/CashScript/cashscript / getLowestStartLocation

Function getLowestStartLocation

packages/utils/src/script.ts:441–455  ·  view source on GitHub ↗
(locations: SingleLocationData[])

Source from the content-addressed store, hash-verified

439};
440
441const getLowestStartLocation = (locations: SingleLocationData[]): SingleLocationData => {
442 return locations.reduce((lowest, current) => {
443 if (current.location.start.line < lowest.location.start.line) {
444 return current;
445 }
446
447 if (lowest.location.start.line === current.location.start.line) {
448 if (current.location.start.column < lowest.location.start.column) {
449 return current;
450 }
451 }
452
453 return lowest;
454 }, locations[0]);
455};
456
457const mergeAsm = (asm1: string, asm2: string): string => {
458 // We merge two ASM strings by adding a space between them, and removing any duplicate spaces

Callers 1

replaceOpsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected