@mlightcad/libredwg-web 0.7.3 → 0.7.4

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/lib/debug.js DELETED
@@ -1,48 +0,0 @@
1
- const defaultOptions = {
2
- enabled: false,
3
- proxyEntity: false
4
- };
5
- let options = { ...defaultOptions };
6
- export function getLibreDwgDebugOptions() {
7
- return options;
8
- }
9
- export function setLibreDwgDebugOptions(partial) {
10
- options = { ...options, ...partial };
11
- return options;
12
- }
13
- export function resetLibreDwgDebugOptions() {
14
- options = { ...defaultOptions };
15
- }
16
- export function isLibreDwgDebugEnabled(scope) {
17
- if (!options.enabled) {
18
- return false;
19
- }
20
- if (!scope) {
21
- return true;
22
- }
23
- return options[scope];
24
- }
25
- export function libreDwgDebugLog(scope, message, data) {
26
- if (!isLibreDwgDebugEnabled(scope)) {
27
- return;
28
- }
29
- if (data === undefined) {
30
- console.log(`[libredwg:${scope}] ${message}`);
31
- }
32
- else {
33
- console.log(`[libredwg:${scope}] ${message}`, data);
34
- }
35
- }
36
- export function hexPreview(bytes, maxBytes = 16) {
37
- if (!bytes || bytes.length === 0) {
38
- return '(empty)';
39
- }
40
- const slice = Array.from(bytes).slice(0, maxBytes);
41
- const hex = slice
42
- .map(b => b.toString(16).toUpperCase().padStart(2, '0'))
43
- .join('');
44
- return bytes.length > maxBytes
45
- ? `${hex}... (${bytes.length} bytes total)`
46
- : hex;
47
- }
48
- //# sourceMappingURL=debug.js.map
@@ -1,3 +0,0 @@
1
- export default createModule;
2
- declare function createModule(moduleArg?: {}): Promise<{}>;
3
- //# sourceMappingURL=libredwg-web.d.ts.map