Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@waiting/shared-core

Package Overview
Dependencies
Maintainers
0
Versions
199
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@waiting/shared-core - npm Package Compare versions

Comparing version 23.23.0 to 23.24.0

1

dist/index.d.ts
export * from './lib/index.js';
export { $ } from 'zx';
//# sourceMappingURL=index.d.ts.map

@@ -5,2 +5,1 @@ export declare function assertNever(x: never): never;

*/
//# sourceMappingURL=asset.d.ts.map

3

dist/lib/callstack/index.d.ts

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

export * from './types.js';
export type * from './types.js';
export * from './util.js';
//# sourceMappingURL=index.d.ts.map

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

export * from './types.js';
export * from './util.js';
//# sourceMappingURL=index.js.map

@@ -19,2 +19,1 @@ export interface CallerInfo extends CallerInfoBase {

}
//# sourceMappingURL=types.d.ts.map

@@ -9,5 +9,2 @@ import type { CallerInfo } from './types.js';

export declare function isExecWithEnableSourceMaps(): boolean;
/**
* the dep "source-map-support" should be installed
*/
export declare function getCallerStack(callerDistance?: number,

@@ -19,3 +16,7 @@ /**

/**
* Get stack string, line/colum number transformed with source-map
* Get stack string, line/column number not transformed with source-map
*/
export declare function getCallerInfo(callerDistance?: number): CallerInfo;
/**
* Get stack string, line/column number transformed with source-map
* @see https://stackoverflow.com/a/13227808

@@ -25,2 +26,1 @@ */

export declare function getStackCallerSites(stackTraceLimit?: number): NodeJS.CallSite[];
//# sourceMappingURL=util.d.ts.map

@@ -54,5 +54,2 @@ /* eslint-disable @typescript-eslint/no-unsafe-call */

}
/**
* the dep "source-map-support" should be installed
*/
export function getCallerStack(callerDistance = 0,

@@ -63,3 +60,3 @@ /**

retrievePosition = false) {
const info = getCallerStackSimpleInfo(callerDistance + 1);
const info = getCallerInfo(callerDistance + 1);
if (!retrievePosition) {

@@ -97,5 +94,5 @@ return info;

/**
* Get stack string, line/colum number not transformed with source-map
* Get stack string, line/column number not transformed with source-map
*/
function getCallerStackSimpleInfo(callerDistance = 0) {
export function getCallerInfo(callerDistance = 0) {
const depth = callerDistance + 1;

@@ -106,3 +103,2 @@ // @link https://github.com/nodejs/node/releases/tag/v22.9.0

// @ts-ignore
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
const callSites = util.getCallSite(depth + 1);

@@ -116,3 +112,3 @@ const site = callSites[depth];

className: '',
funcName: '',
funcName: site.functionName,
methodName: '',

@@ -140,3 +136,2 @@ lineNumber: site.lineNumber,

const typeName = site.getTypeName() ?? '';
// eslint-disable-next-line @typescript-eslint/no-base-to-string
const line = site.toString();

@@ -146,7 +141,7 @@ let className = typeName;

className = methodName
? line.match(new RegExp(`\\b\\S+(?=\\.${methodName})`, 'u'))?.[0] ?? ''
? new RegExp(`\\b\\S+(?=\\.${methodName})`, 'u').exec(line)?.[0] ?? ''
: '';
if (!className && methodName !== funcName) {
className = funcName
? line.match(new RegExp(`\\b\\S+(?=\\.${funcName})`, 'u'))?.[0] ?? ''
? new RegExp(`\\b\\S+(?=\\.${funcName})`, 'u').exec(line)?.[0] ?? ''
: '';

@@ -171,3 +166,3 @@ }

/**
* Get stack string, line/colum number transformed with source-map
* Get stack string, line/column number transformed with source-map
* @see https://stackoverflow.com/a/13227808

@@ -174,0 +169,0 @@ */

import minimist from 'minimist';
export declare function retrieveArgsFromProcess<T extends minimist.ParsedArgs = minimist.ParsedArgs>(processArgv?: string[]): T;
//# sourceMappingURL=cli.d.ts.map
import minimist from 'minimist';
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
export function retrieveArgsFromProcess(processArgv = process.argv) {

@@ -3,0 +4,0 @@ const ps = processArgv.slice(2);

export declare const isWin32: boolean;
export declare const userHome: string;
export declare const defaultPropDescriptor: PropertyDescriptor;
//# sourceMappingURL=consts.d.ts.map

@@ -12,2 +12,1 @@ import type { ISO8601String } from '@waiting/shared-types';

export declare function formatDateTime(input: number | string | Date, locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;
//# sourceMappingURL=date.d.ts.map

@@ -6,2 +6,1 @@ /**

export declare function getKeyByEnumValue<T extends Record<string, unknown>>(enumType: T, enumValue: string | number): keyof T | undefined;
//# sourceMappingURL=enum.d.ts.map

@@ -19,2 +19,1 @@ export interface GenErrorOptions {

export declare function genError(options: GenErrorOptions): Error;
//# sourceMappingURL=error.d.ts.map

@@ -5,2 +5,1 @@ export type FnCallParam = string | string[] | readonly string[];

export declare function expandFFIParamArray(input: FnCallParams): FnParamsExpand;
//# sourceMappingURL=ffi.d.ts.map

@@ -15,3 +15,2 @@ export function expandFFIParamArray(input) {

const len = item.length;
// eslint-disable-next-line @typescript-eslint/prefer-for-of
for (let i = 0; i < len; i += 1) {

@@ -18,0 +17,0 @@ const tmp = item[i] ?? [];

@@ -7,2 +7,1 @@ /**

export declare function genAbsolutePath(path: string, fileUrlPrefix?: boolean): string;
//# sourceMappingURL=file.d.ts.map

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

/* eslint-disable @typescript-eslint/no-explicit-any */
import assert from 'node:assert';

@@ -3,0 +2,0 @@ import { isAbsolute, resolve } from 'node:path';

import type { MethodTypeUnknown } from '@waiting/shared-types';
export declare function isArrowFunction(fn: MethodTypeUnknown): boolean;
//# sourceMappingURL=function.d.ts.map

@@ -33,2 +33,1 @@ export declare const appDir: string;

export declare function nFormatter(positiveNum: number, digits?: number, separator?: string): string;
//# sourceMappingURL=helper.d.ts.map
import type { IncomingHttpHeaders } from 'node:http';
import type { Headers as UndiciHeaders } from 'undici';
export declare function retrieveHeadersItem(headers: IncomingHttpHeaders | HeadersInit | UndiciHeaders | undefined, name: string): string | undefined;
//# sourceMappingURL=http.d.ts.map

@@ -22,2 +22,1 @@ export * from './asset.js';

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

@@ -11,2 +11,1 @@ /**

export declare function bigIntMax(...args: bigint[]): bigint;
//# sourceMappingURL=math.d.ts.map

@@ -6,2 +6,3 @@ /**

export function bigIntMin(...args) {
// eslint-disable-next-line unicorn/prefer-math-min-max
return args.reduce((acc, curr) => curr < acc ? curr : acc);

@@ -14,4 +15,5 @@ }

export function bigIntMax(...args) {
// eslint-disable-next-line unicorn/prefer-math-min-max
return args.reduce((acc, curr) => curr > acc ? curr : acc);
}
//# sourceMappingURL=math.js.map

@@ -5,2 +5,1 @@ /**

export declare function saveHeapSnapshot(path: string): Promise<void>;
//# sourceMappingURL=memory.d.ts.map

@@ -5,2 +5,1 @@ /**

export declare function genModuleAbsolutePathIfExists(projectDir: string, modulePath: string): Promise<string | undefined>;
//# sourceMappingURL=module.d.ts.map

@@ -10,2 +10,1 @@ import type { NetworkInterfaceInfo } from 'node:os';

export declare function retrieveExternalNetWorkInfo(): NetworkInterfaceInfo[];
//# sourceMappingURL=net.d.ts.map

@@ -9,2 +9,1 @@ import type { NpmPkgView } from '@waiting/shared-types';

export declare function compareVersions(version1: string, version2: string): number;
//# sourceMappingURL=npm-pkg.d.ts.map
export * from './ssh.shell.js';
export * from './user.shell.js';
export * from './user.types.js';
//# sourceMappingURL=index.shell.d.ts.map
#!/usr/bin/env tsx
export declare function updateSshAllowUser(userName: string): Promise<void>;
//# sourceMappingURL=ssh.shell.d.ts.map

@@ -9,2 +9,1 @@ #!/usr/bin/env tsx

export declare function userExists(userName: string): Promise<boolean>;
//# sourceMappingURL=user.shell.d.ts.map
#!/usr/bin/env tsx
/* eslint-disable no-await-in-loop */
import assert from 'node:assert';

@@ -4,0 +3,0 @@ import { $ } from 'zx';

@@ -38,2 +38,1 @@ export interface CreateUserOptions {

}
//# sourceMappingURL=user.types.d.ts.map

@@ -19,2 +19,1 @@ import type { ProcInfo } from '@waiting/shared-types';

export declare function retrieveProcInfo(items?: ProcInfoItem[]): Promise<Partial<ProcInfo>>;
//# sourceMappingURL=stats.d.ts.map

@@ -33,3 +33,3 @@ import { readFile } from 'node:fs/promises';

const path = `/proc/${name}`;
const pm = readFile(path, 'utf-8')
const pm = readFile(path, 'utf8')
.catch(() => '')

@@ -36,0 +36,0 @@ .then((str) => {

@@ -59,2 +59,1 @@ import type { CamelKeys, CamelToSnake, SnakeKeys, SnakeToCamel, SnakeToPascal } from '@waiting/shared-types';

delimiter?: D, recursive?: Recursive): SnakeKeys<T, D, Recursive>;
//# sourceMappingURL=string.d.ts.map

@@ -172,3 +172,2 @@ import assert from 'node:assert';

writable: true,
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
value: camelKeys(value, delimiter, recursive),

@@ -202,3 +201,2 @@ });

writable: true,
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
value: snakeKeys(value, delimiter, recursive),

@@ -205,0 +203,0 @@ });

@@ -59,2 +59,1 @@ import type { WriteFileOptions } from 'node:fs';

export declare function genRandomString(length?: number): string;
//# sourceMappingURL=utils.d.ts.map

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

/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
/* eslint-disable @typescript-eslint/no-explicit-any */
import assert from 'node:assert';

@@ -4,0 +2,0 @@ import crypto from 'node:crypto';

import type { MiddlewarePathPattern } from '@waiting/shared-types';
export declare function isPathMatchRules(path: string, rules?: MiddlewarePathPattern): boolean;
//# sourceMappingURL=web.d.ts.map
export declare function patchZxQuote(): void;
export declare function _patchZxQuote(): void;
//# sourceMappingURL=zx.d.ts.map
{
"name": "@waiting/shared-core",
"author": "waiting",
"version": "23.23.0",
"version": "23.24.0",
"description": "node core function re export with Promise or Observable",

@@ -35,3 +35,3 @@ "keywords": [

"@types/minimist": "^1.2.5",
"@waiting/shared-types": "^23.22.0",
"@waiting/shared-types": "^23.24.0",
"minimist": "^1.2.8",

@@ -84,3 +84,3 @@ "semver": "^7.6.2",

},
"gitHead": "a729be1370b4b92fb935db2c55a2173058a6f4b4"
"gitHead": "d86a7d66119b632f35d263edb2d16f3b8bdf47bc"
}
export * from './types.js'
export type * from './types.js'
export * from './util.js'

@@ -68,5 +68,2 @@ /* eslint-disable @typescript-eslint/no-unsafe-call */

/**
* the dep "source-map-support" should be installed
*/
export function getCallerStack(

@@ -80,3 +77,3 @@ callerDistance = 0,

const info = getCallerStackSimpleInfo(callerDistance + 1)
const info = getCallerInfo(callerDistance + 1)

@@ -129,5 +126,5 @@ if (! retrievePosition) {

/**
* Get stack string, line/colum number not transformed with source-map
* Get stack string, line/column number not transformed with source-map
*/
function getCallerStackSimpleInfo(callerDistance = 0): CallerInfo {
export function getCallerInfo(callerDistance = 0): CallerInfo {
const depth = callerDistance + 1

@@ -139,3 +136,2 @@

// @ts-ignore
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
const callSites: CallerInfoOrigin[] = util.getCallSite(depth + 1)

@@ -150,3 +146,3 @@ const site = callSites[depth]

className: '',
funcName: '',
funcName: site.functionName,
methodName: '',

@@ -179,3 +175,3 @@ lineNumber: site.lineNumber,

// eslint-disable-next-line @typescript-eslint/no-base-to-string
const line = site.toString()

@@ -186,7 +182,7 @@

className = methodName
? line.match(new RegExp(`\\b\\S+(?=\\.${methodName})`, 'u'))?.[0] ?? ''
? new RegExp(`\\b\\S+(?=\\.${methodName})`, 'u').exec(line)?.[0] ?? ''
: ''
if (! className && methodName !== funcName) {
className = funcName
? line.match(new RegExp(`\\b\\S+(?=\\.${funcName})`, 'u'))?.[0] ?? ''
? new RegExp(`\\b\\S+(?=\\.${funcName})`, 'u').exec(line)?.[0] ?? ''
: ''

@@ -216,3 +212,3 @@ }

/**
* Get stack string, line/colum number transformed with source-map
* Get stack string, line/column number transformed with source-map
* @see https://stackoverflow.com/a/13227808

@@ -219,0 +215,0 @@ */

import minimist from 'minimist'
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
export function retrieveArgsFromProcess<T extends minimist.ParsedArgs = minimist.ParsedArgs>(processArgv: string[] = process.argv): T {

@@ -5,0 +6,0 @@ const ps = processArgv.slice(2)

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

/* eslint-disable @typescript-eslint/no-explicit-any */
import type { ISO8601String } from '@waiting/shared-types'

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

@@ -23,3 +23,3 @@

const len = item.length
// eslint-disable-next-line @typescript-eslint/prefer-for-of
for (let i = 0; i < len; i += 1) {

@@ -26,0 +26,0 @@ const tmp = item[i] ?? []

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

/* eslint-disable @typescript-eslint/no-explicit-any */
import assert from 'node:assert'

@@ -3,0 +3,0 @@ import { isAbsolute, resolve } from 'node:path'

@@ -7,2 +7,3 @@

export function bigIntMin(...args: bigint[]): bigint {
// eslint-disable-next-line unicorn/prefer-math-min-max
return args.reduce((acc, curr) => curr < acc ? curr : acc)

@@ -16,4 +17,5 @@ }

export function bigIntMax(...args: bigint[]): bigint {
// eslint-disable-next-line unicorn/prefer-math-min-max
return args.reduce((acc, curr) => curr > acc ? curr : acc)
}
#!/usr/bin/env tsx
/* eslint-disable no-await-in-loop */
import assert from 'node:assert'

@@ -4,0 +4,0 @@

@@ -5,5 +5,5 @@ import { readFile } from 'node:fs/promises'

ProcCpuinfo,
ProcDiskstats,
ProcInfo,
ProcMeminfo,
ProcDiskstats,
ProcStat,

@@ -61,3 +61,3 @@ } from '@waiting/shared-types'

const path = `/proc/${name}`
const pm = readFile(path, 'utf-8')
const pm = readFile(path, 'utf8')
.catch(() => '')

@@ -64,0 +64,0 @@ .then((str) => {

@@ -236,3 +236,3 @@ import assert from 'node:assert'

writable: true,
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
value: camelKeys(value, delimiter, recursive),

@@ -278,3 +278,3 @@ })

writable: true,
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
value: snakeKeys(value, delimiter, recursive),

@@ -281,0 +281,0 @@ })

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

/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
/* eslint-disable @typescript-eslint/no-explicit-any */
import assert from 'node:assert'

@@ -4,0 +3,0 @@ import crypto from 'node:crypto'

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc