MCPcopy Create free account
hub / github.com/activejs/activejs / getLocationId

Function getLocationId

packages/core/src/utils/funcs.ts:361–374  ·  view source on GitHub ↗
(source: any)

Source from the content-addressed store, hash-verified

359 * @internal please do not use.
360 */
361export function getLocationId(source: any): string {
362 if (source == null || typeof source !== 'object') {
363 return '';
364 }
365 source = source.constructor.name;
366 const errorTrace = stackTrace();
367 const locationMatch = errorTrace.match(
368 new RegExp(
369 // get two lines beyond ActiveJS scope https://regexr.com/5eb9g
370 `new ${source}\\b.+\\n(?:[\\s\\S]+new (?:AsyncSystem|Cluster)\\b.+\\n)?((?:.+\\n?){1,2})`
371 )
372 );
373 return hashCode(locationMatch?.[1] || errorTrace);
374}

Callers 2

constructorFunction · 0.90
extras.spec.tsFile · 0.90

Calls 2

stackTraceFunction · 0.85
hashCodeFunction · 0.85

Tested by

no test coverage detected