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

@waiting/shared-core

Package Overview
Dependencies
Maintainers
1
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.6.1 to 23.7.0

dist/lib/shell/index.shell.d.ts

1

dist/lib/utils.d.ts

@@ -62,2 +62,3 @@ /// <reference types="node" resolution-mode="require"/>

export declare function sleep(timeout?: number): Promise<void>;
export declare function genRandomString(length?: number): string;
//# sourceMappingURL=utils.d.ts.map
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
/* eslint-disable @typescript-eslint/no-explicit-any */
import assert from 'node:assert';
import crypto from 'node:crypto';
import { access, } from 'node:fs';

@@ -126,3 +128,3 @@ import { mkdir, stat, writeFile, } from 'node:fs/promises';

if (!path) {
throw new Error('File path empth ');
throw new Error('File path empty ');
}

@@ -192,2 +194,10 @@ // only filename. can be loaded by search path such as %system%

}
export function genRandomString(length = 32) {
assert(length > 0, 'length must be greater than 0');
// 生成随机字节
const randomBytes = crypto.randomBytes(Math.ceil(length / 2));
// 将字节转换为十六进制字符串
const randomString = randomBytes.toString('hex').slice(0, length);
return randomString;
}
//# sourceMappingURL=utils.js.map

9

package.json
{
"name": "@waiting/shared-core",
"author": "waiting",
"version": "23.6.1",
"version": "23.7.0",
"description": "node core function re export with Promise or Observable",

@@ -21,2 +21,3 @@ "keywords": [

".": "./dist/index.js",
"./shell": "./dist/lib/shell/index.shell.js",
"./package.json": "./package.json"

@@ -37,7 +38,7 @@ },

"minimist": "^1.2.8",
"semver": "^7.6.0",
"semver": "^7.6.1",
"zx": "^8.0.2"
},
"devDependencies": {
"undici": "^6.13.0"
"undici": "^6.16.0"
},

@@ -81,3 +82,3 @@ "engines": {

},
"gitHead": "3d8ec3c261774680c5b62e87fd31965e9314026e"
"gitHead": "0d4d29c322da460c4052d3aa2abbe9f974e08f9a"
}
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
/* eslint-disable @typescript-eslint/no-explicit-any */
import assert from 'node:assert'
import crypto from 'node:crypto'
import {

@@ -163,3 +165,3 @@ access,

if (! path) {
throw new Error('File path empth ')
throw new Error('File path empty ')
}

@@ -244,1 +246,10 @@ // only filename. can be loaded by search path such as %system%

export function genRandomString(length = 32): string {
assert(length > 0, 'length must be greater than 0')
// 生成随机字节
const randomBytes = crypto.randomBytes(Math.ceil(length / 2))
// 将字节转换为十六进制字符串
const randomString = randomBytes.toString('hex').slice(0, length)
return randomString
}

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