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.21.0 to 23.22.0

13

dist/lib/helper.d.ts
export declare const appDir: string;
/**
* Generate __filename for ESM
* @example retrieveFilename(import.meta)
* @link https://nodejs.org/docs/latest/api/esm.html#importmetafilename
*/
export declare function retrieveFilename(importMeta: ImportMeta): string;
/**
*
* Generate __dirname for ESM
* @example retrieveDirname(import.meta)
* @link https://nodejs.org/docs/latest/api/esm.html#importmetadirname
*/
export declare function retrieveDirname(importMeta: ImportMeta): string;
export declare function fileShortPath(importUrl: string, separator?: string): string;

@@ -3,0 +16,0 @@ /**

import { dirname, relative, sep } from 'node:path';
import { fileURLToPath } from 'node:url';
export const appDir = process.cwd();
/**
* Generate __filename for ESM
* @example retrieveFilename(import.meta)
* @link https://nodejs.org/docs/latest/api/esm.html#importmetafilename
*/
export function retrieveFilename(importMeta) {
if (typeof importMeta.filename === 'string') {
return importMeta.filename;
}
return genCurrentFilename(importMeta.url);
}
/**
*
* Generate __dirname for ESM
* @example retrieveDirname(import.meta)
* @link https://nodejs.org/docs/latest/api/esm.html#importmetadirname
*/
export function retrieveDirname(importMeta) {
if (typeof importMeta.dirname === 'string') {
return importMeta.dirname;
}
return genCurrentDirname(importMeta.url);
}
export function fileShortPath(importUrl, separator = '/') {

@@ -5,0 +28,0 @@ let path = relative(appDir, genCurrentFilename(importUrl));

6

package.json
{
"name": "@waiting/shared-core",
"author": "waiting",
"version": "23.21.0",
"version": "23.22.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.21.0",
"@waiting/shared-types": "^23.22.0",
"minimist": "^1.2.8",

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

},
"gitHead": "34e3a649e3ce27f8ceaa681e0a0a0da1c33fd606"
"gitHead": "704e9cc57d1468cd7e094cbf8aa963d88f3ad0bc"
}

@@ -7,2 +7,28 @@ import { dirname, relative, sep } from 'node:path'

/**
* Generate __filename for ESM
* @example retrieveFilename(import.meta)
* @link https://nodejs.org/docs/latest/api/esm.html#importmetafilename
*/
export function retrieveFilename(importMeta: ImportMeta): string {
if (typeof importMeta.filename === 'string') {
return importMeta.filename
}
return genCurrentFilename(importMeta.url)
}
/**
*
* Generate __dirname for ESM
* @example retrieveDirname(import.meta)
* @link https://nodejs.org/docs/latest/api/esm.html#importmetadirname
*/
export function retrieveDirname(importMeta: ImportMeta): string {
if (typeof importMeta.dirname === 'string') {
return importMeta.dirname
}
return genCurrentDirname(importMeta.url)
}
export function fileShortPath(importUrl: string, separator = '/'): string {

@@ -49,7 +75,7 @@ let path = relative(appDir, genCurrentFilename(importUrl))

interface Formater {
interface Formatter {
value: number
symbol: string
}
const lookup: Formater[] = [
const lookup: Formatter[] = [
{ value: 1, symbol: '' },

@@ -56,0 +82,0 @@ { value: 1e3, symbol: 'k' },

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