Launch Week Day 3: Introducing Organization Notifications in Socket.Learn More
Socket
Book a DemoSign in
Socket

@aidc/utils

Package Overview
Dependencies
Maintainers
4
Versions
195
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aidc/utils - npm Package Compare versions

Comparing version
0.1.0
to
0.2.0
+0
-1
dist/debug/index.d.ts

@@ -6,2 +6,1 @@ import _debug from 'debug';

export declare const debug: _debug.Debugger;
//# sourceMappingURL=index.d.ts.map

@@ -5,2 +5,1 @@ import { ReactElement } from 'react';

export declare function injectStyle(url: string): void;
//# sourceMappingURL=index.d.ts.map

@@ -9,2 +9,1 @@ export declare const isWindow: boolean;

export declare const isChromeBackground: boolean;
//# sourceMappingURL=index.d.ts.map
+4
-1
export declare function getClassName(object: any): any;
//# sourceMappingURL=index.d.ts.map
export declare function openWindow(url: string, size?: {
width: number;
height: number;
}): void;

@@ -0,1 +1,3 @@

import { debug } from "../debug";
// 获取一个 JS 实例或类的 “类的名称”

@@ -10,2 +12,17 @@ export function getClassName(object) {

return 'Unknown';
}
// 打开一个新的浏览器窗口
export function openWindow(url, size) {
debug('[debug] openWindow url:', url);
if (size) {
// 如果设置了尺寸,就使其屏幕居中显示
var left = (window.screen.width - size.width) / 2;
var top = (window.screen.height - size.height) / 2;
var features = "width=".concat(size.width, ",height=").concat(size.height, ",left=").concat(left, ",top=").concat(top);
window.open(url, '_blank', features);
debug('[debug] openWindow features:', features);
} else {
window.open(url, '_blank');
}
}
export declare function checkWebp(): boolean;
//# sourceMappingURL=check-webp.d.ts.map

@@ -15,2 +15,1 @@ interface CompressInfoProps {

export {};
//# sourceMappingURL=compress-image.d.ts.map

@@ -19,2 +19,1 @@ export * from './check-webp';

export declare function onlyWebp(imgUrl: string): string;
//# sourceMappingURL=index.d.ts.map

@@ -9,2 +9,1 @@ export * from './debug';

export * from './time';
//# sourceMappingURL=index.d.ts.map

@@ -1,3 +0,2 @@

export declare function pingAlibabaAvatarImage(): Promise<unknown>;
export declare function pingAlibabaAvatarImage(): Promise<void>;
export declare function pingAlibabaNetwork(): Promise<boolean>;
//# sourceMappingURL=index.d.ts.map

@@ -7,4 +7,7 @@ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";

img.onload = function () {
// @ts-ignore
if (this.width === 200 && this.height === 200) resolve();else reject();
if (img.width === 200 && img.height === 200) {
resolve();
} else {
reject();
}
};

@@ -11,0 +14,0 @@ img.onerror = reject;

@@ -23,2 +23,1 @@ export interface RequestOptions {

export declare function request<T extends RequestResponse>(url: string, options?: RequestOptions): Promise<T["data"]>;
//# sourceMappingURL=index.d.ts.map
export declare function delay(ms: number): Promise<unknown>;
//# sourceMappingURL=index.d.ts.map
{
"name": "@aidc/utils",
"version": "0.1.0",
"version": "0.2.0",
"repository": "git@gitlab.alibaba-inc.com:aidc-innovation/aidc-fe.git",

@@ -5,0 +5,0 @@ "module": "dist/index.js",

{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,OAAO,CAAC;AAM3B,eAAO,MAAM,eAAe,aAAa,CAAC;AAE1C,eAAO,MAAM,WAAW,YAAuC,CAAC;AAEhE,wBAAgB,WAAW,CAAC,SAAS,SAAkB,mBAUtD;AAED,eAAO,MAAM,KAAK,iBAA+B,CAAC"}
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAGrC,wBAAgB,YAAY,CAAC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,QAIzE;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,QAKvC;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,QAKtC"}
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,SAAgC,CAAC;AAEtD,eAAO,MAAM,OAAO,SAAuD,CAAC;AAE5E,eAAO,MAAM,KAAK,SAAyC,CAAC;AAE5D,eAAO,MAAM,MAAM,SAAwC,CAAC;AAE5D,eAAO,MAAM,IAAI,SAA0C,CAAC;AAE5D,eAAO,MAAM,QAAQ,SAAwC,CAAC;AAE9D,eAAO,MAAM,cAAc,SAC6C,CAAC;AAEzE,eAAO,MAAM,kBAAkB,SAA8B,CAAC"}
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AACA,wBAAgB,YAAY,CAAC,MAAM,EAAE,GAAG,OAQvC"}
{"version":3,"file":"check-webp.d.ts","sourceRoot":"","sources":["check-webp.ts"],"names":[],"mappings":"AA8BA,wBAAgB,SAAS,YAexB"}
{"version":3,"file":"compress-image.d.ts","sourceRoot":"","sources":["compress-image.ts"],"names":[],"mappings":"AAeA,UAAU,iBAAiB;IACzB,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAAC;IAClC,eAAe,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;IACzB,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,eAAe,EAAE,OAAO,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;CAClB;AAkDD;;GAEG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,iBAAiB,UA8EzE"}
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AAEjC;;GAEG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,WAIzC;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,WAI1C;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,8BAO1C;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,UAOtC"}
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,OAAO,CAAC;AACtB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC"}
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,wBAAgB,sBAAsB,qBAYrC;AAED,wBAAsB,kBAAkB,qBAOvC"}
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,MAAM,WAAW,eAAe,CAAC,CAAC,GAAG,GAAG;IACtC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,qBAAa,YAAa,SAAQ,KAAK;IAC9B,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;gBAClB,OAAO,SAAK,EAAE,IAAI,GAAE,MAAM,GAAG,MAAW;CAMrD;AAED,wBAAsB,OAAO,CAAC,CAAC,SAAS,eAAe,EACrD,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,cAAmB,sBA4B7B"}
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,oBAI/B"}