wenay-common 1.0.98 → 1.0.99

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.
@@ -50,7 +50,7 @@ export declare const BSearchAsync: typeof ___BSearchAsync;
50
50
  export declare function BSearchDefault<T extends {
51
51
  valueOf(): number;
52
52
  }>(array: ArrayLike<T>, value: T, match?: SearchMatchMode, mode?: SortMode): number;
53
- declare function ___BSearchAsync<T>(length: number, compareIndexToValue: (index: number) => Promise<number>, matchMode?: SearchMatchMode, sortMode?: SortMode): Promise<number>;
53
+ declare function ___BSearchAsync(length: number, compareIndexToValue: (index: number) => Promise<number>, matchMode?: SearchMatchMode, sortMode?: SortMode): Promise<number>;
54
54
  export declare function BSearchNearest(array: ArrayLike<number>, searchValue: number, maxDelta?: number): number;
55
55
  export declare function BSearchNearest<T>(array: ArrayLike<T>, searchValue: number, arrayGetValue: (element: T) => number, maxDelta?: number): number;
56
56
  export declare function _BSearchNearest<T>(array: ArrayLike<T>, searchValue: number, arrayGetValue: (element: T) => number, maxDelta?: number): number;
@@ -605,9 +605,9 @@ class Mutex {
605
605
  }
606
606
  exports.Mutex = Mutex;
607
607
  async function copyToClipboard(textToCopy) {
608
- const moduleName = 'child_process';
608
+ let { navigator, window, document } = globalThis;
609
609
  if (typeof window != "object")
610
- return (await Promise.resolve(`${moduleName}`).then(s => __importStar(require(s)))).spawn('clip').stdin.end(textToCopy);
610
+ return (await Promise.resolve().then(() => __importStar(require('child_process')))).spawn('clip').stdin.end(textToCopy);
611
611
  if (navigator.clipboard && window.isSecureContext) {
612
612
  return navigator.clipboard.writeText(textToCopy);
613
613
  }
@@ -1,5 +1,14 @@
1
- /// <reference lib="dom" />
1
+ declare type HTMLInputElement = {
2
+ min: string;
3
+ max: string;
4
+ step: string;
5
+ value: string;
6
+ onchange: ((ev: any) => void) | null;
7
+ onkeyup: ((ev: any) => void) | null;
8
+ setAttribute(attr: string, val: string): void;
9
+ };
2
10
  export declare function SetAutoStepForElement(element: HTMLInputElement, params?: {
3
11
  minStep?: number | undefined;
4
12
  maxStep?: number;
5
13
  }): void;
14
+ export {};
@@ -1,2 +1,3 @@
1
- /// <reference lib="esnext" />
2
1
  export {};
2
+ export declare function enable(flag?: boolean): void;
3
+ export declare function disable(): void;
@@ -1,35 +1,20 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.disable = exports.enable = void 0;
4
+ let _enabled = false;
5
+ function enable(flag = true) { _enabled = flag; }
6
+ exports.enable = enable;
7
+ function disable() { _enabled = false; }
8
+ exports.disable = disable;
26
9
  if (1)
27
- (async () => {
10
+ (() => {
28
11
  if (typeof self != 'object' && typeof window != "object") {
29
12
  let wrapCallSite;
30
- let moduleName = 'source-map-support';
13
+ let inspector = require('inspector');
14
+ if (inspector.url() != undefined)
15
+ return;
31
16
  try {
32
- let module = await Promise.resolve(`${moduleName}`).then(s => __importStar(require(s)));
17
+ let module = require('source-map-support');
33
18
  module.install();
34
19
  wrapCallSite = module.wrapCallSite;
35
20
  }
@@ -37,9 +22,12 @@ if (1)
37
22
  console.warn(e);
38
23
  return;
39
24
  }
25
+ _enabled = true;
40
26
  for (let methodName of ['debug', 'log', 'warn', 'error']) {
41
27
  const originalLoggingMethod = console[methodName];
42
28
  console[methodName] = ((firstArgument, ...otherArguments) => {
29
+ if (!_enabled)
30
+ return originalLoggingMethod(firstArgument, ...otherArguments);
43
31
  const originalPrepareStackTrace = Error.prepareStackTrace;
44
32
  Error.prepareStackTrace = (_, stack) => stack;
45
33
  let callee = new Error().stack[1];
@@ -55,8 +43,11 @@ if (1)
55
43
  }
56
44
  let fileAndLine = `${fileName}:${callee.getLineNumber()}:${callee.getColumnNumber()} ` + callee.getFunctionName();
57
45
  fileAndLine = fileAndLine.replaceAll("\\", "/");
58
- if (!fileAndLine.toLowerCase().startsWith("file:///"))
59
- fileAndLine = "file:///" + fileAndLine;
46
+ fileAndLine = fileAndLine.replace("webpack:///", "");
47
+ fileAndLine = fileAndLine.replace("?", "");
48
+ if (!fileAndLine.startsWith("./"))
49
+ if (!fileAndLine.toLowerCase().startsWith("file:///"))
50
+ fileAndLine = "file:///" + fileAndLine;
60
51
  if (1)
61
52
  originalLoggingMethod(firstArgument, ...otherArguments, "", fileAndLine);
62
53
  else if (typeof firstArgument === 'string') {
@@ -1,3 +1,4 @@
1
+ /// <reference types="node" />
1
2
  import { tGetAllData } from "../../IHistoryBase";
2
3
  type tFetch = any | ((input: any | URL, init?: any | undefined) => Promise<any>);
3
4
  type tBinanceSymbolsAllObjs = {
@@ -1,3 +1,4 @@
1
+ /// <reference types="node" />
1
2
  import { tSetHistoryData } from "../LoadBase";
2
3
  import { tGetAllData, tSocketInput, tUpDateAllKline } from "../IHistoryBase";
3
4
  export { LoadQuoteBase } from "../LoadBase";
@@ -1,3 +1,4 @@
1
+ /// <reference types="node" />
1
2
  import { TF } from "../Common/Time";
2
3
  import type { CBar } from "./Bars";
3
4
  type RequestInfo = any;
package/lib/index.js CHANGED
@@ -57,6 +57,5 @@ const ListNodeAnd_1 = require("./Common/ListNodeAnd");
57
57
  function test() {
58
58
  const tt = new ListNodeAnd_1.CListNodeAnd();
59
59
  console.log("test");
60
- console.log("lalalal");
61
60
  }
62
61
  exports.test = test;
package/lib/tsconfig.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "module": "commonjs",
4
- "target": "esnext",
3
+ "module": "commonJS",
4
+ "target": "esnext"
5
5
  }
6
6
  }
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "wenay-common",
3
- "version": "1.0.98",
3
+ "version": "1.0.99",
4
4
  "description": "Common library",
5
5
  "strict": true,
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
8
8
  "files": [
9
- "lib/**/*"
9
+ "lib/**/*",
10
+ "!**/*.tsbuildinfo"
10
11
  ],
11
12
  "author": "wenay",
12
13
  "license": "ISC",
13
- "type": "commonjs",
14
14
  "engines": {
15
15
  "node": ">=17.0.0"
16
16
  },
package/lib/minitest.d.ts DELETED
@@ -1 +0,0 @@
1
- declare function f(): void;
package/lib/minitest.js DELETED
@@ -1,3 +0,0 @@
1
- "use strict";
2
- function f() {
3
- }