UNPKG

@typecad/typecad

Version:

🤖programmatically 💥create 🛰️hardware

1 lines 2.45 kB
function getCallSite(){const _0x8051a2=new Error()['stack']?.['split']('\x0a')||[];function _0x201242(_0x4fe837,_0x479766){return a17_0x55d9(_0x479766-0x1ea,_0x4fe837);}for(let _0x4d2635=0x2;_0x4d2635<_0x8051a2['length'];_0x4d2635++){const _0x4df9c9=_0x8051a2[_0x4d2635][_0x201242(0x1ea,0x1ea)]();if(_0x4df9c9){const _0x8eb1e8=_0x4df9c9['match'](/at\s+(?:(.+?)\s+\()?(.+):(\d+):(\d+)\)?/);if(_0x8eb1e8){const _0x56dc2d=_0x8eb1e8[0x2];if(!_0x56dc2d['includes']('node_modules')&&!_0x56dc2d['includes']('\x5cdist\x5c')&&!_0x56dc2d['includes']('/dist/')&&!_0x56dc2d['includes']('pcb_routing_helpers.ts'))return{'file':_0x56dc2d,'line':parseInt(_0x8eb1e8[0x3]),'column':parseInt(_0x8eb1e8[0x4]),'function':_0x8eb1e8[0x1]?.['trim']()||'anonymous'};}}}return null;}export function pinToIdentifier(_0x17a8cb){return _0x17a8cb['reference']+'.'+_0x17a8cb['number'];}function a17_0x339d(){const _0xff4232=['trim','object'];a17_0x339d=function(){return _0xff4232;};return a17_0x339d();}export function pinsMatch(_0x3c09cb,_0x36965a){return _0x3c09cb['reference']===_0x36965a['reference']&&String(_0x3c09cb['number'])===String(_0x36965a['number']);}function a17_0x55d9(_0x339d90,_0x55d9ea){const _0x135e16=a17_0x339d();return a17_0x55d9=function(_0x5ef64d,_0x3697de){_0x5ef64d=_0x5ef64d-0x0;let _0x55c0ca=_0x135e16[_0x5ef64d];return _0x55c0ca;},a17_0x55d9(_0x339d90,_0x55d9ea);}export function connectionMatches(_0x52c956,_0x26840c,_0x481251,_0x4e6581){return pinsMatch(_0x52c956,_0x481251)&&pinsMatch(_0x26840c,_0x4e6581)||pinsMatch(_0x52c956,_0x4e6581)&&pinsMatch(_0x26840c,_0x481251);}export function validatePin(_0x3ce699,_0x32a3f1){const _0x4091ed=getCallSite(),_0x5f0bd1=_0x4091ed?'\x20(called\x20from\x20'+_0x4091ed['file']+':'+_0x4091ed['line']+')':'';if(!_0x3ce699)throw new Error(_0x32a3f1+':\x20Pin\x20is\x20null\x20or\x20undefined'+_0x5f0bd1);if(typeof _0x3ce699!==_0x5da36b(-0x244,-0x243))throw new Error(_0x32a3f1+':\x20Expected\x20Pin\x20object,\x20got\x20'+typeof _0x3ce699+_0x5f0bd1);if(!_0x3ce699['reference']||typeof _0x3ce699['reference']!=='string')throw new Error(_0x32a3f1+':\x20Pin\x20has\x20invalid\x20or\x20missing\x20\x27reference\x27\x20property'+_0x5f0bd1);if(_0x3ce699['number']===undefined||_0x3ce699['number']===null)throw new Error(_0x32a3f1+':\x20Pin\x20has\x20invalid\x20or\x20missing\x20\x27number\x27\x20property'+_0x5f0bd1);function _0x5da36b(_0x41b8ca,_0x9a5f8c){return a17_0x55d9(_0x9a5f8c- -0x244,_0x41b8ca);}return!![];}