@tscircuit/checks 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +697 -28
- package/dist/index.cjs.map +1 -1
- package/package.json +3 -1
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
+
};
|
|
6
11
|
var __export = (target, all) => {
|
|
7
12
|
for (var name in all)
|
|
8
13
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -15,8 +20,654 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
20
|
}
|
|
16
21
|
return to;
|
|
17
22
|
};
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
24
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
25
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
26
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
27
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
28
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
29
|
+
mod
|
|
30
|
+
));
|
|
18
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
32
|
|
|
33
|
+
// node_modules/ms/index.js
|
|
34
|
+
var require_ms = __commonJS({
|
|
35
|
+
"node_modules/ms/index.js"(exports2, module2) {
|
|
36
|
+
"use strict";
|
|
37
|
+
var s = 1e3;
|
|
38
|
+
var m = s * 60;
|
|
39
|
+
var h = m * 60;
|
|
40
|
+
var d = h * 24;
|
|
41
|
+
var w = d * 7;
|
|
42
|
+
var y = d * 365.25;
|
|
43
|
+
module2.exports = function(val, options) {
|
|
44
|
+
options = options || {};
|
|
45
|
+
var type = typeof val;
|
|
46
|
+
if (type === "string" && val.length > 0) {
|
|
47
|
+
return parse(val);
|
|
48
|
+
} else if (type === "number" && isFinite(val)) {
|
|
49
|
+
return options.long ? fmtLong(val) : fmtShort(val);
|
|
50
|
+
}
|
|
51
|
+
throw new Error(
|
|
52
|
+
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
function parse(str) {
|
|
56
|
+
str = String(str);
|
|
57
|
+
if (str.length > 100) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
|
|
61
|
+
str
|
|
62
|
+
);
|
|
63
|
+
if (!match) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
var n = parseFloat(match[1]);
|
|
67
|
+
var type = (match[2] || "ms").toLowerCase();
|
|
68
|
+
switch (type) {
|
|
69
|
+
case "years":
|
|
70
|
+
case "year":
|
|
71
|
+
case "yrs":
|
|
72
|
+
case "yr":
|
|
73
|
+
case "y":
|
|
74
|
+
return n * y;
|
|
75
|
+
case "weeks":
|
|
76
|
+
case "week":
|
|
77
|
+
case "w":
|
|
78
|
+
return n * w;
|
|
79
|
+
case "days":
|
|
80
|
+
case "day":
|
|
81
|
+
case "d":
|
|
82
|
+
return n * d;
|
|
83
|
+
case "hours":
|
|
84
|
+
case "hour":
|
|
85
|
+
case "hrs":
|
|
86
|
+
case "hr":
|
|
87
|
+
case "h":
|
|
88
|
+
return n * h;
|
|
89
|
+
case "minutes":
|
|
90
|
+
case "minute":
|
|
91
|
+
case "mins":
|
|
92
|
+
case "min":
|
|
93
|
+
case "m":
|
|
94
|
+
return n * m;
|
|
95
|
+
case "seconds":
|
|
96
|
+
case "second":
|
|
97
|
+
case "secs":
|
|
98
|
+
case "sec":
|
|
99
|
+
case "s":
|
|
100
|
+
return n * s;
|
|
101
|
+
case "milliseconds":
|
|
102
|
+
case "millisecond":
|
|
103
|
+
case "msecs":
|
|
104
|
+
case "msec":
|
|
105
|
+
case "ms":
|
|
106
|
+
return n;
|
|
107
|
+
default:
|
|
108
|
+
return void 0;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function fmtShort(ms) {
|
|
112
|
+
var msAbs = Math.abs(ms);
|
|
113
|
+
if (msAbs >= d) {
|
|
114
|
+
return Math.round(ms / d) + "d";
|
|
115
|
+
}
|
|
116
|
+
if (msAbs >= h) {
|
|
117
|
+
return Math.round(ms / h) + "h";
|
|
118
|
+
}
|
|
119
|
+
if (msAbs >= m) {
|
|
120
|
+
return Math.round(ms / m) + "m";
|
|
121
|
+
}
|
|
122
|
+
if (msAbs >= s) {
|
|
123
|
+
return Math.round(ms / s) + "s";
|
|
124
|
+
}
|
|
125
|
+
return ms + "ms";
|
|
126
|
+
}
|
|
127
|
+
function fmtLong(ms) {
|
|
128
|
+
var msAbs = Math.abs(ms);
|
|
129
|
+
if (msAbs >= d) {
|
|
130
|
+
return plural(ms, msAbs, d, "day");
|
|
131
|
+
}
|
|
132
|
+
if (msAbs >= h) {
|
|
133
|
+
return plural(ms, msAbs, h, "hour");
|
|
134
|
+
}
|
|
135
|
+
if (msAbs >= m) {
|
|
136
|
+
return plural(ms, msAbs, m, "minute");
|
|
137
|
+
}
|
|
138
|
+
if (msAbs >= s) {
|
|
139
|
+
return plural(ms, msAbs, s, "second");
|
|
140
|
+
}
|
|
141
|
+
return ms + " ms";
|
|
142
|
+
}
|
|
143
|
+
function plural(ms, msAbs, n, name) {
|
|
144
|
+
var isPlural = msAbs >= n * 1.5;
|
|
145
|
+
return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
// node_modules/debug/src/common.js
|
|
151
|
+
var require_common = __commonJS({
|
|
152
|
+
"node_modules/debug/src/common.js"(exports2, module2) {
|
|
153
|
+
"use strict";
|
|
154
|
+
function setup(env) {
|
|
155
|
+
createDebug.debug = createDebug;
|
|
156
|
+
createDebug.default = createDebug;
|
|
157
|
+
createDebug.coerce = coerce;
|
|
158
|
+
createDebug.disable = disable;
|
|
159
|
+
createDebug.enable = enable;
|
|
160
|
+
createDebug.enabled = enabled;
|
|
161
|
+
createDebug.humanize = require_ms();
|
|
162
|
+
createDebug.destroy = destroy;
|
|
163
|
+
Object.keys(env).forEach((key) => {
|
|
164
|
+
createDebug[key] = env[key];
|
|
165
|
+
});
|
|
166
|
+
createDebug.names = [];
|
|
167
|
+
createDebug.skips = [];
|
|
168
|
+
createDebug.formatters = {};
|
|
169
|
+
function selectColor(namespace) {
|
|
170
|
+
let hash = 0;
|
|
171
|
+
for (let i = 0; i < namespace.length; i++) {
|
|
172
|
+
hash = (hash << 5) - hash + namespace.charCodeAt(i);
|
|
173
|
+
hash |= 0;
|
|
174
|
+
}
|
|
175
|
+
return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
|
|
176
|
+
}
|
|
177
|
+
createDebug.selectColor = selectColor;
|
|
178
|
+
function createDebug(namespace) {
|
|
179
|
+
let prevTime;
|
|
180
|
+
let enableOverride = null;
|
|
181
|
+
let namespacesCache;
|
|
182
|
+
let enabledCache;
|
|
183
|
+
function debug2(...args) {
|
|
184
|
+
if (!debug2.enabled) {
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
const self = debug2;
|
|
188
|
+
const curr = Number(/* @__PURE__ */ new Date());
|
|
189
|
+
const ms = curr - (prevTime || curr);
|
|
190
|
+
self.diff = ms;
|
|
191
|
+
self.prev = prevTime;
|
|
192
|
+
self.curr = curr;
|
|
193
|
+
prevTime = curr;
|
|
194
|
+
args[0] = createDebug.coerce(args[0]);
|
|
195
|
+
if (typeof args[0] !== "string") {
|
|
196
|
+
args.unshift("%O");
|
|
197
|
+
}
|
|
198
|
+
let index = 0;
|
|
199
|
+
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
|
|
200
|
+
if (match === "%%") {
|
|
201
|
+
return "%";
|
|
202
|
+
}
|
|
203
|
+
index++;
|
|
204
|
+
const formatter = createDebug.formatters[format];
|
|
205
|
+
if (typeof formatter === "function") {
|
|
206
|
+
const val = args[index];
|
|
207
|
+
match = formatter.call(self, val);
|
|
208
|
+
args.splice(index, 1);
|
|
209
|
+
index--;
|
|
210
|
+
}
|
|
211
|
+
return match;
|
|
212
|
+
});
|
|
213
|
+
createDebug.formatArgs.call(self, args);
|
|
214
|
+
const logFn = self.log || createDebug.log;
|
|
215
|
+
logFn.apply(self, args);
|
|
216
|
+
}
|
|
217
|
+
debug2.namespace = namespace;
|
|
218
|
+
debug2.useColors = createDebug.useColors();
|
|
219
|
+
debug2.color = createDebug.selectColor(namespace);
|
|
220
|
+
debug2.extend = extend;
|
|
221
|
+
debug2.destroy = createDebug.destroy;
|
|
222
|
+
Object.defineProperty(debug2, "enabled", {
|
|
223
|
+
enumerable: true,
|
|
224
|
+
configurable: false,
|
|
225
|
+
get: () => {
|
|
226
|
+
if (enableOverride !== null) {
|
|
227
|
+
return enableOverride;
|
|
228
|
+
}
|
|
229
|
+
if (namespacesCache !== createDebug.namespaces) {
|
|
230
|
+
namespacesCache = createDebug.namespaces;
|
|
231
|
+
enabledCache = createDebug.enabled(namespace);
|
|
232
|
+
}
|
|
233
|
+
return enabledCache;
|
|
234
|
+
},
|
|
235
|
+
set: (v) => {
|
|
236
|
+
enableOverride = v;
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
if (typeof createDebug.init === "function") {
|
|
240
|
+
createDebug.init(debug2);
|
|
241
|
+
}
|
|
242
|
+
return debug2;
|
|
243
|
+
}
|
|
244
|
+
function extend(namespace, delimiter) {
|
|
245
|
+
const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
|
|
246
|
+
newDebug.log = this.log;
|
|
247
|
+
return newDebug;
|
|
248
|
+
}
|
|
249
|
+
function enable(namespaces) {
|
|
250
|
+
createDebug.save(namespaces);
|
|
251
|
+
createDebug.namespaces = namespaces;
|
|
252
|
+
createDebug.names = [];
|
|
253
|
+
createDebug.skips = [];
|
|
254
|
+
let i;
|
|
255
|
+
const split = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/);
|
|
256
|
+
const len = split.length;
|
|
257
|
+
for (i = 0; i < len; i++) {
|
|
258
|
+
if (!split[i]) {
|
|
259
|
+
continue;
|
|
260
|
+
}
|
|
261
|
+
namespaces = split[i].replace(/\*/g, ".*?");
|
|
262
|
+
if (namespaces[0] === "-") {
|
|
263
|
+
createDebug.skips.push(new RegExp("^" + namespaces.slice(1) + "$"));
|
|
264
|
+
} else {
|
|
265
|
+
createDebug.names.push(new RegExp("^" + namespaces + "$"));
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
function disable() {
|
|
270
|
+
const namespaces = [
|
|
271
|
+
...createDebug.names.map(toNamespace),
|
|
272
|
+
...createDebug.skips.map(toNamespace).map((namespace) => "-" + namespace)
|
|
273
|
+
].join(",");
|
|
274
|
+
createDebug.enable("");
|
|
275
|
+
return namespaces;
|
|
276
|
+
}
|
|
277
|
+
function enabled(name) {
|
|
278
|
+
if (name[name.length - 1] === "*") {
|
|
279
|
+
return true;
|
|
280
|
+
}
|
|
281
|
+
let i;
|
|
282
|
+
let len;
|
|
283
|
+
for (i = 0, len = createDebug.skips.length; i < len; i++) {
|
|
284
|
+
if (createDebug.skips[i].test(name)) {
|
|
285
|
+
return false;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
for (i = 0, len = createDebug.names.length; i < len; i++) {
|
|
289
|
+
if (createDebug.names[i].test(name)) {
|
|
290
|
+
return true;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
return false;
|
|
294
|
+
}
|
|
295
|
+
function toNamespace(regexp) {
|
|
296
|
+
return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*");
|
|
297
|
+
}
|
|
298
|
+
function coerce(val) {
|
|
299
|
+
if (val instanceof Error) {
|
|
300
|
+
return val.stack || val.message;
|
|
301
|
+
}
|
|
302
|
+
return val;
|
|
303
|
+
}
|
|
304
|
+
function destroy() {
|
|
305
|
+
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
306
|
+
}
|
|
307
|
+
createDebug.enable(createDebug.load());
|
|
308
|
+
return createDebug;
|
|
309
|
+
}
|
|
310
|
+
module2.exports = setup;
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
// node_modules/debug/src/browser.js
|
|
315
|
+
var require_browser = __commonJS({
|
|
316
|
+
"node_modules/debug/src/browser.js"(exports2, module2) {
|
|
317
|
+
"use strict";
|
|
318
|
+
exports2.formatArgs = formatArgs;
|
|
319
|
+
exports2.save = save;
|
|
320
|
+
exports2.load = load;
|
|
321
|
+
exports2.useColors = useColors;
|
|
322
|
+
exports2.storage = localstorage();
|
|
323
|
+
exports2.destroy = /* @__PURE__ */ (() => {
|
|
324
|
+
let warned = false;
|
|
325
|
+
return () => {
|
|
326
|
+
if (!warned) {
|
|
327
|
+
warned = true;
|
|
328
|
+
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
})();
|
|
332
|
+
exports2.colors = [
|
|
333
|
+
"#0000CC",
|
|
334
|
+
"#0000FF",
|
|
335
|
+
"#0033CC",
|
|
336
|
+
"#0033FF",
|
|
337
|
+
"#0066CC",
|
|
338
|
+
"#0066FF",
|
|
339
|
+
"#0099CC",
|
|
340
|
+
"#0099FF",
|
|
341
|
+
"#00CC00",
|
|
342
|
+
"#00CC33",
|
|
343
|
+
"#00CC66",
|
|
344
|
+
"#00CC99",
|
|
345
|
+
"#00CCCC",
|
|
346
|
+
"#00CCFF",
|
|
347
|
+
"#3300CC",
|
|
348
|
+
"#3300FF",
|
|
349
|
+
"#3333CC",
|
|
350
|
+
"#3333FF",
|
|
351
|
+
"#3366CC",
|
|
352
|
+
"#3366FF",
|
|
353
|
+
"#3399CC",
|
|
354
|
+
"#3399FF",
|
|
355
|
+
"#33CC00",
|
|
356
|
+
"#33CC33",
|
|
357
|
+
"#33CC66",
|
|
358
|
+
"#33CC99",
|
|
359
|
+
"#33CCCC",
|
|
360
|
+
"#33CCFF",
|
|
361
|
+
"#6600CC",
|
|
362
|
+
"#6600FF",
|
|
363
|
+
"#6633CC",
|
|
364
|
+
"#6633FF",
|
|
365
|
+
"#66CC00",
|
|
366
|
+
"#66CC33",
|
|
367
|
+
"#9900CC",
|
|
368
|
+
"#9900FF",
|
|
369
|
+
"#9933CC",
|
|
370
|
+
"#9933FF",
|
|
371
|
+
"#99CC00",
|
|
372
|
+
"#99CC33",
|
|
373
|
+
"#CC0000",
|
|
374
|
+
"#CC0033",
|
|
375
|
+
"#CC0066",
|
|
376
|
+
"#CC0099",
|
|
377
|
+
"#CC00CC",
|
|
378
|
+
"#CC00FF",
|
|
379
|
+
"#CC3300",
|
|
380
|
+
"#CC3333",
|
|
381
|
+
"#CC3366",
|
|
382
|
+
"#CC3399",
|
|
383
|
+
"#CC33CC",
|
|
384
|
+
"#CC33FF",
|
|
385
|
+
"#CC6600",
|
|
386
|
+
"#CC6633",
|
|
387
|
+
"#CC9900",
|
|
388
|
+
"#CC9933",
|
|
389
|
+
"#CCCC00",
|
|
390
|
+
"#CCCC33",
|
|
391
|
+
"#FF0000",
|
|
392
|
+
"#FF0033",
|
|
393
|
+
"#FF0066",
|
|
394
|
+
"#FF0099",
|
|
395
|
+
"#FF00CC",
|
|
396
|
+
"#FF00FF",
|
|
397
|
+
"#FF3300",
|
|
398
|
+
"#FF3333",
|
|
399
|
+
"#FF3366",
|
|
400
|
+
"#FF3399",
|
|
401
|
+
"#FF33CC",
|
|
402
|
+
"#FF33FF",
|
|
403
|
+
"#FF6600",
|
|
404
|
+
"#FF6633",
|
|
405
|
+
"#FF9900",
|
|
406
|
+
"#FF9933",
|
|
407
|
+
"#FFCC00",
|
|
408
|
+
"#FFCC33"
|
|
409
|
+
];
|
|
410
|
+
function useColors() {
|
|
411
|
+
if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
|
|
412
|
+
return true;
|
|
413
|
+
}
|
|
414
|
+
if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
|
415
|
+
return false;
|
|
416
|
+
}
|
|
417
|
+
return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
|
|
418
|
+
typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
|
|
419
|
+
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
|
420
|
+
typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
|
|
421
|
+
typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
|
422
|
+
}
|
|
423
|
+
function formatArgs(args) {
|
|
424
|
+
args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff);
|
|
425
|
+
if (!this.useColors) {
|
|
426
|
+
return;
|
|
427
|
+
}
|
|
428
|
+
const c = "color: " + this.color;
|
|
429
|
+
args.splice(1, 0, c, "color: inherit");
|
|
430
|
+
let index = 0;
|
|
431
|
+
let lastC = 0;
|
|
432
|
+
args[0].replace(/%[a-zA-Z%]/g, (match) => {
|
|
433
|
+
if (match === "%%") {
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
436
|
+
index++;
|
|
437
|
+
if (match === "%c") {
|
|
438
|
+
lastC = index;
|
|
439
|
+
}
|
|
440
|
+
});
|
|
441
|
+
args.splice(lastC, 0, c);
|
|
442
|
+
}
|
|
443
|
+
exports2.log = console.debug || console.log || (() => {
|
|
444
|
+
});
|
|
445
|
+
function save(namespaces) {
|
|
446
|
+
try {
|
|
447
|
+
if (namespaces) {
|
|
448
|
+
exports2.storage.setItem("debug", namespaces);
|
|
449
|
+
} else {
|
|
450
|
+
exports2.storage.removeItem("debug");
|
|
451
|
+
}
|
|
452
|
+
} catch (error) {
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
function load() {
|
|
456
|
+
let r;
|
|
457
|
+
try {
|
|
458
|
+
r = exports2.storage.getItem("debug");
|
|
459
|
+
} catch (error) {
|
|
460
|
+
}
|
|
461
|
+
if (!r && typeof process !== "undefined" && "env" in process) {
|
|
462
|
+
r = process.env.DEBUG;
|
|
463
|
+
}
|
|
464
|
+
return r;
|
|
465
|
+
}
|
|
466
|
+
function localstorage() {
|
|
467
|
+
try {
|
|
468
|
+
return localStorage;
|
|
469
|
+
} catch (error) {
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
module2.exports = require_common()(exports2);
|
|
473
|
+
var { formatters } = module2.exports;
|
|
474
|
+
formatters.j = function(v) {
|
|
475
|
+
try {
|
|
476
|
+
return JSON.stringify(v);
|
|
477
|
+
} catch (error) {
|
|
478
|
+
return "[UnexpectedJSONParseError]: " + error.message;
|
|
479
|
+
}
|
|
480
|
+
};
|
|
481
|
+
}
|
|
482
|
+
});
|
|
483
|
+
|
|
484
|
+
// node_modules/debug/src/node.js
|
|
485
|
+
var require_node = __commonJS({
|
|
486
|
+
"node_modules/debug/src/node.js"(exports2, module2) {
|
|
487
|
+
"use strict";
|
|
488
|
+
var tty = require("tty");
|
|
489
|
+
var util = require("util");
|
|
490
|
+
exports2.init = init;
|
|
491
|
+
exports2.log = log;
|
|
492
|
+
exports2.formatArgs = formatArgs;
|
|
493
|
+
exports2.save = save;
|
|
494
|
+
exports2.load = load;
|
|
495
|
+
exports2.useColors = useColors;
|
|
496
|
+
exports2.destroy = util.deprecate(
|
|
497
|
+
() => {
|
|
498
|
+
},
|
|
499
|
+
"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
|
|
500
|
+
);
|
|
501
|
+
exports2.colors = [6, 2, 3, 4, 5, 1];
|
|
502
|
+
try {
|
|
503
|
+
const supportsColor = require("supports-color");
|
|
504
|
+
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
|
|
505
|
+
exports2.colors = [
|
|
506
|
+
20,
|
|
507
|
+
21,
|
|
508
|
+
26,
|
|
509
|
+
27,
|
|
510
|
+
32,
|
|
511
|
+
33,
|
|
512
|
+
38,
|
|
513
|
+
39,
|
|
514
|
+
40,
|
|
515
|
+
41,
|
|
516
|
+
42,
|
|
517
|
+
43,
|
|
518
|
+
44,
|
|
519
|
+
45,
|
|
520
|
+
56,
|
|
521
|
+
57,
|
|
522
|
+
62,
|
|
523
|
+
63,
|
|
524
|
+
68,
|
|
525
|
+
69,
|
|
526
|
+
74,
|
|
527
|
+
75,
|
|
528
|
+
76,
|
|
529
|
+
77,
|
|
530
|
+
78,
|
|
531
|
+
79,
|
|
532
|
+
80,
|
|
533
|
+
81,
|
|
534
|
+
92,
|
|
535
|
+
93,
|
|
536
|
+
98,
|
|
537
|
+
99,
|
|
538
|
+
112,
|
|
539
|
+
113,
|
|
540
|
+
128,
|
|
541
|
+
129,
|
|
542
|
+
134,
|
|
543
|
+
135,
|
|
544
|
+
148,
|
|
545
|
+
149,
|
|
546
|
+
160,
|
|
547
|
+
161,
|
|
548
|
+
162,
|
|
549
|
+
163,
|
|
550
|
+
164,
|
|
551
|
+
165,
|
|
552
|
+
166,
|
|
553
|
+
167,
|
|
554
|
+
168,
|
|
555
|
+
169,
|
|
556
|
+
170,
|
|
557
|
+
171,
|
|
558
|
+
172,
|
|
559
|
+
173,
|
|
560
|
+
178,
|
|
561
|
+
179,
|
|
562
|
+
184,
|
|
563
|
+
185,
|
|
564
|
+
196,
|
|
565
|
+
197,
|
|
566
|
+
198,
|
|
567
|
+
199,
|
|
568
|
+
200,
|
|
569
|
+
201,
|
|
570
|
+
202,
|
|
571
|
+
203,
|
|
572
|
+
204,
|
|
573
|
+
205,
|
|
574
|
+
206,
|
|
575
|
+
207,
|
|
576
|
+
208,
|
|
577
|
+
209,
|
|
578
|
+
214,
|
|
579
|
+
215,
|
|
580
|
+
220,
|
|
581
|
+
221
|
|
582
|
+
];
|
|
583
|
+
}
|
|
584
|
+
} catch (error) {
|
|
585
|
+
}
|
|
586
|
+
exports2.inspectOpts = Object.keys(process.env).filter((key) => {
|
|
587
|
+
return /^debug_/i.test(key);
|
|
588
|
+
}).reduce((obj, key) => {
|
|
589
|
+
const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
|
|
590
|
+
return k.toUpperCase();
|
|
591
|
+
});
|
|
592
|
+
let val = process.env[key];
|
|
593
|
+
if (/^(yes|on|true|enabled)$/i.test(val)) {
|
|
594
|
+
val = true;
|
|
595
|
+
} else if (/^(no|off|false|disabled)$/i.test(val)) {
|
|
596
|
+
val = false;
|
|
597
|
+
} else if (val === "null") {
|
|
598
|
+
val = null;
|
|
599
|
+
} else {
|
|
600
|
+
val = Number(val);
|
|
601
|
+
}
|
|
602
|
+
obj[prop] = val;
|
|
603
|
+
return obj;
|
|
604
|
+
}, {});
|
|
605
|
+
function useColors() {
|
|
606
|
+
return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty.isatty(process.stderr.fd);
|
|
607
|
+
}
|
|
608
|
+
function formatArgs(args) {
|
|
609
|
+
const { namespace: name, useColors: useColors2 } = this;
|
|
610
|
+
if (useColors2) {
|
|
611
|
+
const c = this.color;
|
|
612
|
+
const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
|
|
613
|
+
const prefix = ` ${colorCode};1m${name} \x1B[0m`;
|
|
614
|
+
args[0] = prefix + args[0].split("\n").join("\n" + prefix);
|
|
615
|
+
args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m");
|
|
616
|
+
} else {
|
|
617
|
+
args[0] = getDate() + name + " " + args[0];
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
function getDate() {
|
|
621
|
+
if (exports2.inspectOpts.hideDate) {
|
|
622
|
+
return "";
|
|
623
|
+
}
|
|
624
|
+
return (/* @__PURE__ */ new Date()).toISOString() + " ";
|
|
625
|
+
}
|
|
626
|
+
function log(...args) {
|
|
627
|
+
return process.stderr.write(util.formatWithOptions(exports2.inspectOpts, ...args) + "\n");
|
|
628
|
+
}
|
|
629
|
+
function save(namespaces) {
|
|
630
|
+
if (namespaces) {
|
|
631
|
+
process.env.DEBUG = namespaces;
|
|
632
|
+
} else {
|
|
633
|
+
delete process.env.DEBUG;
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
function load() {
|
|
637
|
+
return process.env.DEBUG;
|
|
638
|
+
}
|
|
639
|
+
function init(debug2) {
|
|
640
|
+
debug2.inspectOpts = {};
|
|
641
|
+
const keys = Object.keys(exports2.inspectOpts);
|
|
642
|
+
for (let i = 0; i < keys.length; i++) {
|
|
643
|
+
debug2.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]];
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
module2.exports = require_common()(exports2);
|
|
647
|
+
var { formatters } = module2.exports;
|
|
648
|
+
formatters.o = function(v) {
|
|
649
|
+
this.inspectOpts.colors = this.useColors;
|
|
650
|
+
return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
|
|
651
|
+
};
|
|
652
|
+
formatters.O = function(v) {
|
|
653
|
+
this.inspectOpts.colors = this.useColors;
|
|
654
|
+
return util.inspect(v, this.inspectOpts);
|
|
655
|
+
};
|
|
656
|
+
}
|
|
657
|
+
});
|
|
658
|
+
|
|
659
|
+
// node_modules/debug/src/index.js
|
|
660
|
+
var require_src = __commonJS({
|
|
661
|
+
"node_modules/debug/src/index.js"(exports2, module2) {
|
|
662
|
+
"use strict";
|
|
663
|
+
if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
|
|
664
|
+
module2.exports = require_browser();
|
|
665
|
+
} else {
|
|
666
|
+
module2.exports = require_node();
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
});
|
|
670
|
+
|
|
20
671
|
// index.ts
|
|
21
672
|
var checks_exports = {};
|
|
22
673
|
__export(checks_exports, {
|
|
@@ -25,19 +676,16 @@ __export(checks_exports, {
|
|
|
25
676
|
});
|
|
26
677
|
module.exports = __toCommonJS(checks_exports);
|
|
27
678
|
|
|
28
|
-
// lib/
|
|
679
|
+
// lib/add-start-and-end-port-ids-if-missing.ts
|
|
29
680
|
function distance(x1, y1, x2, y2) {
|
|
30
|
-
return Math.sqrt(
|
|
681
|
+
return Math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2);
|
|
31
682
|
}
|
|
32
|
-
|
|
683
|
+
var addStartAndEndPortIdsIfMissing = (soup) => {
|
|
33
684
|
const pcbPorts = soup.filter((item) => item.type === "pcb_port");
|
|
34
685
|
const pcbTraces = soup.filter((item) => item.type === "pcb_trace");
|
|
35
|
-
const
|
|
36
|
-
(
|
|
37
|
-
|
|
38
|
-
const errors = [];
|
|
39
|
-
pcbTraces.forEach((trace) => {
|
|
40
|
-
trace.route.forEach((segment, index) => {
|
|
686
|
+
for (const trace of pcbTraces) {
|
|
687
|
+
for (let index = 0; index < trace.route.length; index++) {
|
|
688
|
+
const segment = trace.route[index];
|
|
41
689
|
if (segment.route_type === "wire") {
|
|
42
690
|
if (!segment.start_pcb_port_id && index === 0) {
|
|
43
691
|
const startPort = pcbPorts.find(
|
|
@@ -56,8 +704,19 @@ function checkEachPcbPortConnected(soup) {
|
|
|
56
704
|
}
|
|
57
705
|
}
|
|
58
706
|
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
};
|
|
710
|
+
|
|
711
|
+
// lib/check-each-pcb-port-connected.ts
|
|
712
|
+
function checkEachPcbPortConnected(soup) {
|
|
713
|
+
addStartAndEndPortIdsIfMissing(soup);
|
|
714
|
+
const pcbPorts = soup.filter((item) => item.type === "pcb_port");
|
|
715
|
+
const pcbTraces = soup.filter((item) => item.type === "pcb_trace");
|
|
716
|
+
const sourceTraces = soup.filter(
|
|
717
|
+
(item) => item.type === "source_trace"
|
|
718
|
+
);
|
|
719
|
+
const errors = [];
|
|
61
720
|
for (const port of pcbPorts) {
|
|
62
721
|
const connectedTraces = pcbTraces.filter(
|
|
63
722
|
(trace) => trace.route.some(
|
|
@@ -127,6 +786,8 @@ var NetManager = class {
|
|
|
127
786
|
};
|
|
128
787
|
|
|
129
788
|
// lib/check-each-pcb-trace-non-overlapping.ts
|
|
789
|
+
var import_debug = __toESM(require_src(), 1);
|
|
790
|
+
var debug = (0, import_debug.default)("tscircuit:checks:check-each-pcb-trace-non-overlapping");
|
|
130
791
|
function lineIntersects(x1, y1, x2, y2, x3, y3, x4, y4) {
|
|
131
792
|
const denom = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1);
|
|
132
793
|
if (denom === 0) return false;
|
|
@@ -141,17 +802,18 @@ function tracesOverlap(trace1, trace2) {
|
|
|
141
802
|
const seg2 = trace1.route[i + 1];
|
|
142
803
|
const seg3 = trace2.route[j];
|
|
143
804
|
const seg4 = trace2.route[j + 1];
|
|
144
|
-
if (seg1.route_type === "wire" && seg2.route_type === "wire" && seg3.route_type === "wire" && seg4.route_type === "wire" && seg1.layer === seg3.layer
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
805
|
+
if (seg1.route_type === "wire" && seg2.route_type === "wire" && seg3.route_type === "wire" && seg4.route_type === "wire" && seg1.layer === seg3.layer) {
|
|
806
|
+
const areLinesIntersecting = lineIntersects(
|
|
807
|
+
seg1.x,
|
|
808
|
+
seg1.y,
|
|
809
|
+
seg2.x,
|
|
810
|
+
seg2.y,
|
|
811
|
+
seg3.x,
|
|
812
|
+
seg3.y,
|
|
813
|
+
seg4.x,
|
|
814
|
+
seg4.y
|
|
815
|
+
);
|
|
816
|
+
return areLinesIntersecting;
|
|
155
817
|
}
|
|
156
818
|
}
|
|
157
819
|
}
|
|
@@ -223,13 +885,14 @@ function getPortIdsConnectedToTrace(trace) {
|
|
|
223
885
|
function getPortIdsConnectedToTraces(...traces) {
|
|
224
886
|
const connectedPorts = /* @__PURE__ */ new Set();
|
|
225
887
|
for (const trace of traces) {
|
|
226
|
-
getPortIdsConnectedToTrace(trace)
|
|
227
|
-
|
|
228
|
-
|
|
888
|
+
for (const portId of getPortIdsConnectedToTrace(trace)) {
|
|
889
|
+
connectedPorts.add(portId);
|
|
890
|
+
}
|
|
229
891
|
}
|
|
230
892
|
return Array.from(connectedPorts);
|
|
231
893
|
}
|
|
232
894
|
function checkEachPcbTraceNonOverlapping(soup) {
|
|
895
|
+
addStartAndEndPortIdsIfMissing(soup);
|
|
233
896
|
const pcbTraces = soup.filter(
|
|
234
897
|
(item) => item.type === "pcb_trace"
|
|
235
898
|
);
|
|
@@ -238,11 +901,17 @@ function checkEachPcbTraceNonOverlapping(soup) {
|
|
|
238
901
|
);
|
|
239
902
|
const errors = [];
|
|
240
903
|
const netManager = new NetManager();
|
|
241
|
-
pcbTraces
|
|
242
|
-
|
|
243
|
-
|
|
904
|
+
for (const trace of pcbTraces) {
|
|
905
|
+
netManager.setConnected(getPortIdsConnectedToTrace(trace));
|
|
906
|
+
}
|
|
244
907
|
for (let i = 0; i < pcbTraces.length; i++) {
|
|
245
908
|
for (let j = i + 1; j < pcbTraces.length; j++) {
|
|
909
|
+
debug(
|
|
910
|
+
`Checking overlap for ${pcbTraces[i].pcb_trace_id} and ${pcbTraces[j].pcb_trace_id}`
|
|
911
|
+
);
|
|
912
|
+
debug(
|
|
913
|
+
`Connected ports: ${getPortIdsConnectedToTraces(pcbTraces[i], pcbTraces[j])}`
|
|
914
|
+
);
|
|
246
915
|
if (netManager.isConnected(
|
|
247
916
|
getPortIdsConnectedToTraces(pcbTraces[i], pcbTraces[j])
|
|
248
917
|
)) {
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../index.ts","../lib/check-each-pcb-port-connected.ts","../lib/net-manager.ts","../lib/check-each-pcb-trace-non-overlapping.ts"],"sourcesContent":["export { checkEachPcbPortConnected } from \"./lib/check-each-pcb-port-connected\"\nexport { checkEachPcbTraceNonOverlapping } from \"./lib/check-each-pcb-trace-non-overlapping\"\n","import type {\n PCBPort,\n PCBTrace,\n SourceTrace,\n AnySoupElement,\n PCBTraceError,\n} from \"@tscircuit/soup\"\n\nfunction distance(x1: number, y1: number, x2: number, y2: number): number {\n return Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2))\n}\n\nfunction checkEachPcbPortConnected(soup: AnySoupElement[]): PCBTraceError[] {\n const pcbPorts: PCBPort[] = soup.filter((item) => item.type === \"pcb_port\")\n const pcbTraces: PCBTrace[] = soup.filter((item) => item.type === \"pcb_trace\")\n const sourceTraces: SourceTrace[] = soup.filter(\n (item) => item.type === \"source_trace\",\n )\n const errors: PCBTraceError[] = []\n\n // Add start_pcb_port_id and end_pcb_port_id if not present\n pcbTraces.forEach((trace) => {\n trace.route.forEach((segment, index) => {\n if (segment.route_type === \"wire\") {\n if (!segment.start_pcb_port_id && index === 0) {\n const startPort = pcbPorts.find(\n (port) => distance(port.x, port.y, segment.x, segment.y) < 0.001,\n )\n if (startPort) {\n segment.start_pcb_port_id = startPort.pcb_port_id\n }\n }\n if (!segment.end_pcb_port_id && index === trace.route.length - 1) {\n const endPort = pcbPorts.find(\n (port) => distance(port.x, port.y, segment.x, segment.y) < 0.001,\n )\n if (endPort) {\n segment.end_pcb_port_id = endPort.pcb_port_id\n }\n }\n }\n })\n })\n\n for (const port of pcbPorts) {\n const connectedTraces = pcbTraces.filter((trace) =>\n trace.route.some(\n (segment) =>\n segment.route_type === \"wire\" &&\n (segment.start_pcb_port_id === port.pcb_port_id ||\n segment.end_pcb_port_id === port.pcb_port_id),\n ),\n )\n\n if (connectedTraces.length === 0) {\n const sourceTrace = sourceTraces.find((trace) =>\n trace.connected_source_port_ids.includes(port.source_port_id),\n )\n\n errors.push({\n type: \"pcb_error\",\n message: `pcb_trace_error: PCB port ${port.pcb_port_id} is not connected by a PCB trace`,\n source_trace_id: sourceTrace ? sourceTrace.source_trace_id : \"\",\n error_type: \"pcb_trace_error\",\n pcb_trace_id: \"\",\n pcb_error_id: \"\", // Add appropriate ID generation if necessary\n pcb_component_ids: [],\n pcb_port_ids: [port.pcb_port_id],\n })\n }\n }\n\n return errors\n}\n\nexport { checkEachPcbPortConnected }\n","export class NetManager {\n private networks: Set<Set<string>> = new Set()\n\n setConnected(nodes: string[]): void {\n if (nodes.length < 2) return\n\n let targetNetwork: Set<string> | null = null\n\n // Check if any of the nodes are already in a network\n for (const network of this.networks) {\n for (const node of nodes) {\n if (network.has(node)) {\n if (targetNetwork === null) {\n targetNetwork = network\n } else if (targetNetwork !== network) {\n // Merge networks\n for (const mergeNode of network) {\n targetNetwork.add(mergeNode)\n }\n this.networks.delete(network)\n }\n break\n }\n }\n if (targetNetwork !== null && targetNetwork !== network) break\n }\n\n // If no existing network found, create a new one\n if (targetNetwork === null) {\n targetNetwork = new Set(nodes)\n this.networks.add(targetNetwork)\n } else {\n // Add all nodes to the target network\n for (const node of nodes) {\n targetNetwork.add(node)\n }\n }\n }\n\n isConnected(nodes: string[]): boolean {\n if (nodes.length < 2) return true\n\n for (const network of this.networks) {\n if (nodes.every((node) => network.has(node))) {\n return true\n }\n }\n\n return false\n }\n}\n","import type {\n PCBTrace,\n PCBSMTPad,\n AnySoupElement,\n PCBTraceError,\n} from \"@tscircuit/soup\"\nimport { NetManager } from \"./net-manager\"\n\n/**\n * Checks if lines given by (x1, y1) and (x2, y2) intersect with line\n * given by (x3, y3) and (x4, y4)\n */\nfunction lineIntersects(\n x1: number,\n y1: number,\n x2: number,\n y2: number,\n x3: number,\n y3: number,\n x4: number,\n y4: number,\n): boolean {\n const denom = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1)\n if (denom === 0) return false // parallel lines\n\n const ua = ((x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3)) / denom\n const ub = ((x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3)) / denom\n\n return ua >= 0 && ua <= 1 && ub >= 0 && ub <= 1\n}\n\nfunction tracesOverlap(trace1: PCBTrace, trace2: PCBTrace): boolean {\n for (let i = 0; i < trace1.route.length - 1; i++) {\n for (let j = 0; j < trace2.route.length - 1; j++) {\n const seg1 = trace1.route[i]\n const seg2 = trace1.route[i + 1]\n const seg3 = trace2.route[j]\n const seg4 = trace2.route[j + 1]\n\n if (\n seg1.route_type === \"wire\" &&\n seg2.route_type === \"wire\" &&\n seg3.route_type === \"wire\" &&\n seg4.route_type === \"wire\" &&\n seg1.layer === seg3.layer &&\n lineIntersects(\n seg1.x,\n seg1.y,\n seg2.x,\n seg2.y,\n seg3.x,\n seg3.y,\n seg4.x,\n seg4.y,\n )\n ) {\n return true\n }\n }\n }\n return false\n}\n\nfunction traceOverlapsWithPad(trace: PCBTrace, pad: PCBSMTPad): boolean {\n for (let i = 0; i < trace.route.length - 1; i++) {\n const seg1 = trace.route[i]\n const seg2 = trace.route[i + 1]\n\n if (\n seg1.route_type === \"wire\" &&\n seg2.route_type === \"wire\" &&\n seg1.layer === pad.layer &&\n pad.shape === \"rect\"\n ) {\n const padLeft = pad.x - pad.width / 2\n const padRight = pad.x + pad.width / 2\n const padTop = pad.y - pad.height / 2\n const padBottom = pad.y + pad.height / 2\n\n if (\n lineIntersects(\n seg1.x,\n seg1.y,\n seg2.x,\n seg2.y,\n padLeft,\n padTop,\n padRight,\n padTop,\n ) ||\n lineIntersects(\n seg1.x,\n seg1.y,\n seg2.x,\n seg2.y,\n padRight,\n padTop,\n padRight,\n padBottom,\n ) ||\n lineIntersects(\n seg1.x,\n seg1.y,\n seg2.x,\n seg2.y,\n padRight,\n padBottom,\n padLeft,\n padBottom,\n ) ||\n lineIntersects(\n seg1.x,\n seg1.y,\n seg2.x,\n seg2.y,\n padLeft,\n padBottom,\n padLeft,\n padTop,\n )\n ) {\n return true\n }\n }\n }\n return false\n}\n\nfunction getPortIdsConnectedToTrace(trace: PCBTrace) {\n const connectedPorts = new Set<string>()\n for (const segment of trace.route) {\n if (segment.route_type === \"wire\") {\n if (segment.start_pcb_port_id)\n connectedPorts.add(segment.start_pcb_port_id)\n if (segment.end_pcb_port_id) connectedPorts.add(segment.end_pcb_port_id)\n }\n }\n return Array.from(connectedPorts)\n}\n\nfunction getPortIdsConnectedToTraces(...traces: PCBTrace[]) {\n const connectedPorts = new Set<string>()\n for (const trace of traces) {\n getPortIdsConnectedToTrace(trace).forEach((portId) =>\n connectedPorts.add(portId),\n )\n }\n return Array.from(connectedPorts)\n}\n\nfunction checkEachPcbTraceNonOverlapping(\n soup: AnySoupElement[],\n): PCBTraceError[] {\n const pcbTraces: PCBTrace[] = soup.filter(\n (item): item is PCBTrace => item.type === \"pcb_trace\",\n )\n const pcbSMTPads: PCBSMTPad[] = soup.filter(\n (item): item is PCBSMTPad => item.type === \"pcb_smtpad\",\n )\n const errors: PCBTraceError[] = []\n const netManager = new NetManager()\n\n // TODO use source port ids instead of port ids, parse source ports for connections\n pcbTraces.forEach((trace) =>\n netManager.setConnected(getPortIdsConnectedToTrace(trace)),\n )\n\n for (let i = 0; i < pcbTraces.length; i++) {\n for (let j = i + 1; j < pcbTraces.length; j++) {\n if (\n netManager.isConnected(\n getPortIdsConnectedToTraces(pcbTraces[i], pcbTraces[j]),\n )\n ) {\n continue\n }\n if (tracesOverlap(pcbTraces[i], pcbTraces[j])) {\n errors.push({\n type: \"pcb_error\",\n error_type: \"pcb_trace_error\",\n message: `PCB trace ${pcbTraces[i].pcb_trace_id} overlaps with ${pcbTraces[j].pcb_trace_id}`,\n pcb_trace_id: pcbTraces[i].pcb_trace_id,\n source_trace_id: \"\",\n pcb_error_id: `overlap_${pcbTraces[i].pcb_trace_id}_${pcbTraces[j].pcb_trace_id}`,\n pcb_component_ids: [],\n pcb_port_ids: getPortIdsConnectedToTraces(pcbTraces[i], pcbTraces[j]),\n })\n }\n }\n\n for (const pad of pcbSMTPads) {\n if (\n pad.pcb_port_id &&\n netManager.isConnected(\n getPortIdsConnectedToTrace(pcbTraces[i]).concat([pad.pcb_port_id]),\n )\n ) {\n continue\n }\n if (traceOverlapsWithPad(pcbTraces[i], pad)) {\n errors.push({\n type: \"pcb_error\",\n error_type: \"pcb_trace_error\",\n message: `PCB trace ${pcbTraces[i].pcb_trace_id} overlaps with pcb_smtpad ${pad.pcb_smtpad_id}`,\n pcb_trace_id: pcbTraces[i].pcb_trace_id,\n source_trace_id: \"\",\n pcb_error_id: `overlap_${pcbTraces[i].pcb_trace_id}_${pad.pcb_smtpad_id}`,\n pcb_component_ids: [],\n pcb_port_ids: getPortIdsConnectedToTrace(pcbTraces[i]),\n })\n }\n }\n }\n\n return errors\n}\n\nexport { checkEachPcbTraceNonOverlapping }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACQA,SAAS,SAAS,IAAY,IAAY,IAAY,IAAoB;AACxE,SAAO,KAAK,KAAK,KAAK,IA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,UAAU,CAAC,GAAG,GAAG,GAAG;AAC3C,eAAO,KAAK;AAAA,UACV,MAAM;AAAA,UACN,YAAY;AAAA,UACZ,SAAS,aAAa,UAAU,CAAC,EAAE,YAAY,6BAA6B,IAAI,aAAa;AAAA,UAC7F,cAAc,UAAU,CAAC,EAAE;AAAA,UAC3B,iBAAiB;AAAA,UACjB,cAAc,WAAW,UAAU,CAAC,EAAE,YAAY,IAAI,IAAI,aAAa;AAAA,UACvE,mBAAmB,CAAC;AAAA,UACpB,cAAc,2BAA2B,UAAU,CAAC,CAAC;AAAA,QACvD,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../node_modules/ms/index.js","../node_modules/debug/src/common.js","../node_modules/debug/src/browser.js","../node_modules/debug/src/node.js","../node_modules/debug/src/index.js","../index.ts","../lib/add-start-and-end-port-ids-if-missing.ts","../lib/check-each-pcb-port-connected.ts","../lib/net-manager.ts","../lib/check-each-pcb-trace-non-overlapping.ts"],"sourcesContent":["/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n","/**\n * Module dependencies.\n */\n\nconst tty = require('tty');\nconst util = require('util');\n\n/**\n * This is the Node.js implementation of `debug()`.\n */\n\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.destroy = util.deprecate(\n\t() => {},\n\t'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'\n);\n\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\ntry {\n\t// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)\n\t// eslint-disable-next-line import/no-extraneous-dependencies\n\tconst supportsColor = require('supports-color');\n\n\tif (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {\n\t\texports.colors = [\n\t\t\t20,\n\t\t\t21,\n\t\t\t26,\n\t\t\t27,\n\t\t\t32,\n\t\t\t33,\n\t\t\t38,\n\t\t\t39,\n\t\t\t40,\n\t\t\t41,\n\t\t\t42,\n\t\t\t43,\n\t\t\t44,\n\t\t\t45,\n\t\t\t56,\n\t\t\t57,\n\t\t\t62,\n\t\t\t63,\n\t\t\t68,\n\t\t\t69,\n\t\t\t74,\n\t\t\t75,\n\t\t\t76,\n\t\t\t77,\n\t\t\t78,\n\t\t\t79,\n\t\t\t80,\n\t\t\t81,\n\t\t\t92,\n\t\t\t93,\n\t\t\t98,\n\t\t\t99,\n\t\t\t112,\n\t\t\t113,\n\t\t\t128,\n\t\t\t129,\n\t\t\t134,\n\t\t\t135,\n\t\t\t148,\n\t\t\t149,\n\t\t\t160,\n\t\t\t161,\n\t\t\t162,\n\t\t\t163,\n\t\t\t164,\n\t\t\t165,\n\t\t\t166,\n\t\t\t167,\n\t\t\t168,\n\t\t\t169,\n\t\t\t170,\n\t\t\t171,\n\t\t\t172,\n\t\t\t173,\n\t\t\t178,\n\t\t\t179,\n\t\t\t184,\n\t\t\t185,\n\t\t\t196,\n\t\t\t197,\n\t\t\t198,\n\t\t\t199,\n\t\t\t200,\n\t\t\t201,\n\t\t\t202,\n\t\t\t203,\n\t\t\t204,\n\t\t\t205,\n\t\t\t206,\n\t\t\t207,\n\t\t\t208,\n\t\t\t209,\n\t\t\t214,\n\t\t\t215,\n\t\t\t220,\n\t\t\t221\n\t\t];\n\t}\n} catch (error) {\n\t// Swallow - we only care if `supports-color` is available; it doesn't have to be.\n}\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\nexports.inspectOpts = Object.keys(process.env).filter(key => {\n\treturn /^debug_/i.test(key);\n}).reduce((obj, key) => {\n\t// Camel-case\n\tconst prop = key\n\t\t.substring(6)\n\t\t.toLowerCase()\n\t\t.replace(/_([a-z])/g, (_, k) => {\n\t\t\treturn k.toUpperCase();\n\t\t});\n\n\t// Coerce string value into JS value\n\tlet val = process.env[key];\n\tif (/^(yes|on|true|enabled)$/i.test(val)) {\n\t\tval = true;\n\t} else if (/^(no|off|false|disabled)$/i.test(val)) {\n\t\tval = false;\n\t} else if (val === 'null') {\n\t\tval = null;\n\t} else {\n\t\tval = Number(val);\n\t}\n\n\tobj[prop] = val;\n\treturn obj;\n}, {});\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}\n\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\tconst {namespace: name, useColors} = this;\n\n\tif (useColors) {\n\t\tconst c = this.color;\n\t\tconst colorCode = '\\u001B[3' + (c < 8 ? c : '8;5;' + c);\n\t\tconst prefix = ` ${colorCode};1m${name} \\u001B[0m`;\n\n\t\targs[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n\t\targs.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\\u001B[0m');\n\t} else {\n\t\targs[0] = getDate() + name + ' ' + args[0];\n\t}\n}\n\nfunction getDate() {\n\tif (exports.inspectOpts.hideDate) {\n\t\treturn '';\n\t}\n\treturn new Date().toISOString() + ' ';\n}\n\n/**\n * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.\n */\n\nfunction log(...args) {\n\treturn process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\\n');\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\tif (namespaces) {\n\t\tprocess.env.DEBUG = namespaces;\n\t} else {\n\t\t// If you set a process.env field to null or undefined, it gets cast to the\n\t\t// string 'null' or 'undefined'. Just delete instead.\n\t\tdelete process.env.DEBUG;\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n\treturn process.env.DEBUG;\n}\n\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\nfunction init(debug) {\n\tdebug.inspectOpts = {};\n\n\tconst keys = Object.keys(exports.inspectOpts);\n\tfor (let i = 0; i < keys.length; i++) {\n\t\tdebug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nformatters.o = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts)\n\t\t.split('\\n')\n\t\t.map(str => str.trim())\n\t\t.join(' ');\n};\n\n/**\n * Map %O to `util.inspect()`, allowing multiple lines if needed.\n */\n\nformatters.O = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts);\n};\n","/**\n * Detect Electron renderer / nwjs process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {\n\tmodule.exports = require('./browser.js');\n} else {\n\tmodule.exports = require('./node.js');\n}\n","export { checkEachPcbPortConnected } from \"./lib/check-each-pcb-port-connected\"\nexport { checkEachPcbTraceNonOverlapping } from \"./lib/check-each-pcb-trace-non-overlapping\"\n","import type {\n PCBPort,\n PCBTrace,\n SourceTrace,\n AnySoupElement,\n PCBTraceError,\n} from \"@tscircuit/soup\"\n\nfunction distance(x1: number, y1: number, x2: number, y2: number): number {\n return Math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)\n}\n\nexport const addStartAndEndPortIdsIfMissing = (\n soup: AnySoupElement[],\n): void => {\n const pcbPorts: PCBPort[] = soup.filter((item) => item.type === \"pcb_port\")\n const pcbTraces: PCBTrace[] = soup.filter((item) => item.type === \"pcb_trace\")\n\n // Add start_pcb_port_id and end_pcb_port_id if not present\n for (const trace of pcbTraces) {\n for (let index = 0; index < trace.route.length; index++) {\n const segment = trace.route[index]\n if (segment.route_type === \"wire\") {\n if (!segment.start_pcb_port_id && index === 0) {\n const startPort = pcbPorts.find(\n (port) => distance(port.x, port.y, segment.x, segment.y) < 0.001,\n )\n if (startPort) {\n segment.start_pcb_port_id = startPort.pcb_port_id\n }\n }\n if (!segment.end_pcb_port_id && index === trace.route.length - 1) {\n const endPort = pcbPorts.find(\n (port) => distance(port.x, port.y, segment.x, segment.y) < 0.001,\n )\n if (endPort) {\n segment.end_pcb_port_id = endPort.pcb_port_id\n }\n }\n }\n }\n }\n}\n","import type {\n PCBPort,\n PCBTrace,\n SourceTrace,\n AnySoupElement,\n PCBTraceError,\n} from \"@tscircuit/soup\"\nimport { addStartAndEndPortIdsIfMissing } from \"./add-start-and-end-port-ids-if-missing\"\n\nfunction checkEachPcbPortConnected(soup: AnySoupElement[]): PCBTraceError[] {\n addStartAndEndPortIdsIfMissing(soup)\n const pcbPorts: PCBPort[] = soup.filter((item) => item.type === \"pcb_port\")\n const pcbTraces: PCBTrace[] = soup.filter((item) => item.type === \"pcb_trace\")\n const sourceTraces: SourceTrace[] = soup.filter(\n (item) => item.type === \"source_trace\",\n )\n const errors: PCBTraceError[] = []\n\n for (const port of pcbPorts) {\n const connectedTraces = pcbTraces.filter((trace) =>\n trace.route.some(\n (segment: any) =>\n segment.route_type === \"wire\" &&\n (segment.start_pcb_port_id === port.pcb_port_id ||\n segment.end_pcb_port_id === port.pcb_port_id),\n ),\n )\n\n if (connectedTraces.length === 0) {\n const sourceTrace = sourceTraces.find((trace) =>\n trace.connected_source_port_ids.includes(port.source_port_id),\n )\n\n errors.push({\n type: \"pcb_error\",\n message: `pcb_trace_error: PCB port ${port.pcb_port_id} is not connected by a PCB trace`,\n source_trace_id: sourceTrace ? sourceTrace.source_trace_id : \"\",\n error_type: \"pcb_trace_error\",\n pcb_trace_id: \"\",\n pcb_error_id: \"\", // Add appropriate ID generation if necessary\n pcb_component_ids: [],\n pcb_port_ids: [port.pcb_port_id],\n })\n }\n }\n\n return errors\n}\n\nexport { checkEachPcbPortConnected }\n","export class NetManager {\n private networks: Set<Set<string>> = new Set()\n\n setConnected(nodes: string[]): void {\n if (nodes.length < 2) return\n\n let targetNetwork: Set<string> | null = null\n\n // Check if any of the nodes are already in a network\n for (const network of this.networks) {\n for (const node of nodes) {\n if (network.has(node)) {\n if (targetNetwork === null) {\n targetNetwork = network\n } else if (targetNetwork !== network) {\n // Merge networks\n for (const mergeNode of network) {\n targetNetwork.add(mergeNode)\n }\n this.networks.delete(network)\n }\n break\n }\n }\n if (targetNetwork !== null && targetNetwork !== network) break\n }\n\n // If no existing network found, create a new one\n if (targetNetwork === null) {\n targetNetwork = new Set(nodes)\n this.networks.add(targetNetwork)\n } else {\n // Add all nodes to the target network\n for (const node of nodes) {\n targetNetwork.add(node)\n }\n }\n }\n\n isConnected(nodes: string[]): boolean {\n if (nodes.length < 2) return true\n\n for (const network of this.networks) {\n if (nodes.every((node) => network.has(node))) {\n return true\n }\n }\n\n return false\n }\n}\n","import type {\n PCBTrace,\n PCBSMTPad,\n AnySoupElement,\n PCBTraceError,\n} from \"@tscircuit/soup\"\nimport { NetManager } from \"./net-manager\"\nimport { addStartAndEndPortIdsIfMissing } from \"./add-start-and-end-port-ids-if-missing\"\nimport Debug from \"debug\"\n\nconst debug = Debug(\"tscircuit:checks:check-each-pcb-trace-non-overlapping\")\n\n/**\n * Checks if lines given by (x1, y1) and (x2, y2) intersect with line\n * given by (x3, y3) and (x4, y4)\n */\nfunction lineIntersects(\n x1: number,\n y1: number,\n x2: number,\n y2: number,\n x3: number,\n y3: number,\n x4: number,\n y4: number,\n): boolean {\n const denom = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1)\n if (denom === 0) return false // parallel lines\n\n const ua = ((x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3)) / denom\n const ub = ((x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3)) / denom\n\n return ua >= 0 && ua <= 1 && ub >= 0 && ub <= 1\n}\n\nfunction tracesOverlap(trace1: PCBTrace, trace2: PCBTrace): boolean {\n for (let i = 0; i < trace1.route.length - 1; i++) {\n for (let j = 0; j < trace2.route.length - 1; j++) {\n const seg1 = trace1.route[i]\n const seg2 = trace1.route[i + 1]\n const seg3 = trace2.route[j]\n const seg4 = trace2.route[j + 1]\n\n if (\n seg1.route_type === \"wire\" &&\n seg2.route_type === \"wire\" &&\n seg3.route_type === \"wire\" &&\n seg4.route_type === \"wire\" &&\n seg1.layer === seg3.layer\n ) {\n const areLinesIntersecting = lineIntersects(\n seg1.x,\n seg1.y,\n seg2.x,\n seg2.y,\n seg3.x,\n seg3.y,\n seg4.x,\n seg4.y,\n )\n return areLinesIntersecting\n }\n }\n }\n return false\n}\n\nfunction traceOverlapsWithPad(trace: PCBTrace, pad: PCBSMTPad): boolean {\n for (let i = 0; i < trace.route.length - 1; i++) {\n const seg1 = trace.route[i]\n const seg2 = trace.route[i + 1]\n\n if (\n seg1.route_type === \"wire\" &&\n seg2.route_type === \"wire\" &&\n seg1.layer === pad.layer &&\n pad.shape === \"rect\"\n ) {\n const padLeft = pad.x - pad.width / 2\n const padRight = pad.x + pad.width / 2\n const padTop = pad.y - pad.height / 2\n const padBottom = pad.y + pad.height / 2\n\n if (\n lineIntersects(\n seg1.x,\n seg1.y,\n seg2.x,\n seg2.y,\n padLeft,\n padTop,\n padRight,\n padTop,\n ) ||\n lineIntersects(\n seg1.x,\n seg1.y,\n seg2.x,\n seg2.y,\n padRight,\n padTop,\n padRight,\n padBottom,\n ) ||\n lineIntersects(\n seg1.x,\n seg1.y,\n seg2.x,\n seg2.y,\n padRight,\n padBottom,\n padLeft,\n padBottom,\n ) ||\n lineIntersects(\n seg1.x,\n seg1.y,\n seg2.x,\n seg2.y,\n padLeft,\n padBottom,\n padLeft,\n padTop,\n )\n ) {\n return true\n }\n }\n }\n return false\n}\n\nfunction getPortIdsConnectedToTrace(trace: PCBTrace) {\n const connectedPorts = new Set<string>()\n for (const segment of trace.route) {\n if (segment.route_type === \"wire\") {\n if (segment.start_pcb_port_id)\n connectedPorts.add(segment.start_pcb_port_id)\n if (segment.end_pcb_port_id) connectedPorts.add(segment.end_pcb_port_id)\n }\n }\n return Array.from(connectedPorts)\n}\n\nfunction getPortIdsConnectedToTraces(...traces: PCBTrace[]) {\n const connectedPorts = new Set<string>()\n for (const trace of traces) {\n for (const portId of getPortIdsConnectedToTrace(trace)) {\n connectedPorts.add(portId)\n }\n }\n return Array.from(connectedPorts)\n}\n\nfunction checkEachPcbTraceNonOverlapping(\n soup: AnySoupElement[],\n): PCBTraceError[] {\n addStartAndEndPortIdsIfMissing(soup)\n const pcbTraces: PCBTrace[] = soup.filter(\n (item): item is PCBTrace => item.type === \"pcb_trace\",\n )\n const pcbSMTPads: PCBSMTPad[] = soup.filter(\n (item): item is PCBSMTPad => item.type === \"pcb_smtpad\",\n )\n const errors: PCBTraceError[] = []\n const netManager = new NetManager()\n\n // TODO use source port ids instead of port ids, parse source ports for connections\n for (const trace of pcbTraces) {\n netManager.setConnected(getPortIdsConnectedToTrace(trace))\n }\n\n for (let i = 0; i < pcbTraces.length; i++) {\n for (let j = i + 1; j < pcbTraces.length; j++) {\n debug(\n `Checking overlap for ${pcbTraces[i].pcb_trace_id} and ${pcbTraces[j].pcb_trace_id}`,\n )\n debug(\n `Connected ports: ${getPortIdsConnectedToTraces(pcbTraces[i], pcbTraces[j])}`,\n )\n if (\n netManager.isConnected(\n getPortIdsConnectedToTraces(pcbTraces[i], pcbTraces[j]),\n )\n ) {\n continue\n }\n if (tracesOverlap(pcbTraces[i], pcbTraces[j])) {\n errors.push({\n type: \"pcb_error\",\n error_type: \"pcb_trace_error\",\n message: `PCB trace ${pcbTraces[i].pcb_trace_id} overlaps with ${pcbTraces[j].pcb_trace_id}`,\n pcb_trace_id: pcbTraces[i].pcb_trace_id,\n source_trace_id: \"\",\n pcb_error_id: `overlap_${pcbTraces[i].pcb_trace_id}_${pcbTraces[j].pcb_trace_id}`,\n pcb_component_ids: [],\n pcb_port_ids: getPortIdsConnectedToTraces(pcbTraces[i], pcbTraces[j]),\n })\n }\n }\n\n for (const pad of pcbSMTPads) {\n if (\n pad.pcb_port_id &&\n netManager.isConnected(\n getPortIdsConnectedToTrace(pcbTraces[i]).concat([pad.pcb_port_id]),\n )\n ) {\n continue\n }\n if (traceOverlapsWithPad(pcbTraces[i], pad)) {\n errors.push({\n type: \"pcb_error\",\n error_type: \"pcb_trace_error\",\n message: `PCB trace ${pcbTraces[i].pcb_trace_id} overlaps with pcb_smtpad ${pad.pcb_smtpad_id}`,\n pcb_trace_id: pcbTraces[i].pcb_trace_id,\n source_trace_id: \"\",\n pcb_error_id: `overlap_${pcbTraces[i].pcb_trace_id}_${pad.pcb_smtpad_id}`,\n pcb_component_ids: [],\n pcb_port_ids: getPortIdsConnectedToTrace(pcb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AAEA,SAAO;AACT;","names":["exports","module","exports","module","debug","exports","module","exports","module","useColors","debug","exports","module","Debug"]}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"module": "index.ts",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
|
-
"version": "0.0.
|
|
6
|
+
"version": "0.0.9",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|
|
9
9
|
],
|
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
"@tscircuit/soup": "^0.0.40",
|
|
19
19
|
"@tscircuit/soup-util": "^0.0.13",
|
|
20
20
|
"@types/bun": "latest",
|
|
21
|
+
"@types/debug": "^4.1.12",
|
|
22
|
+
"debug": "^4.3.5",
|
|
21
23
|
"tsup": "^8.2.3"
|
|
22
24
|
},
|
|
23
25
|
"peerDependencies": {
|