mirror of
https://github.com/pezkuwichain/pezkuwi-common.git
synced 2026-04-22 02:07:56 +00:00
chore: update to version 14.0.11 and align website URLs
This commit is contained in:
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
export { packageInfo } from './packageInfo.js';
|
||||
type GlobalThis = typeof globalThis & {
|
||||
process?: {
|
||||
env?: Record<string, string>;
|
||||
};
|
||||
[key: string]: unknown;
|
||||
};
|
||||
type GlobalNames = keyof typeof globalThis;
|
||||
type GlobalType<N extends GlobalNames> = typeof globalThis[N];
|
||||
/**
|
||||
* A cross-environment implementation for globalThis
|
||||
*/
|
||||
export declare const xglobal: GlobalThis;
|
||||
/**
|
||||
* Extracts a known global from the environment, applying a fallback if not found
|
||||
*/
|
||||
export declare function extractGlobal<N extends GlobalNames, T extends GlobalType<N>>(name: N, fallback: unknown): T;
|
||||
/**
|
||||
* Expose a value as a known global, if not already defined
|
||||
*/
|
||||
export declare function exposeGlobal<N extends GlobalNames, T extends GlobalType<N>>(name: N, fallback: unknown): void;
|
||||
@@ -0,0 +1,43 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.xglobal = exports.packageInfo = void 0;
|
||||
exports.extractGlobal = extractGlobal;
|
||||
exports.exposeGlobal = exposeGlobal;
|
||||
var packageInfo_js_1 = require("./packageInfo.js");
|
||||
Object.defineProperty(exports, "packageInfo", { enumerable: true, get: function () { return packageInfo_js_1.packageInfo; } });
|
||||
/** @internal Last-resort "this", if it gets here it probably would fail anyway */
|
||||
function evaluateThis(fn) {
|
||||
return fn('return this');
|
||||
}
|
||||
/**
|
||||
* A cross-environment implementation for globalThis
|
||||
*/
|
||||
exports.xglobal = (typeof globalThis !== 'undefined'
|
||||
? globalThis
|
||||
: typeof global !== 'undefined'
|
||||
? global
|
||||
: typeof self !== 'undefined'
|
||||
? self
|
||||
: typeof window !== 'undefined'
|
||||
? window
|
||||
: evaluateThis(Function));
|
||||
/**
|
||||
* Extracts a known global from the environment, applying a fallback if not found
|
||||
*/
|
||||
function extractGlobal(name, fallback) {
|
||||
// Not quite sure why this is here - snuck in with TS 4.7.2 with no real idea
|
||||
// (as of now) as to why this looks like an "any" when we do cast it to a T
|
||||
//
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
||||
return typeof exports.xglobal[name] === 'undefined'
|
||||
? fallback
|
||||
: exports.xglobal[name];
|
||||
}
|
||||
/**
|
||||
* Expose a value as a known global, if not already defined
|
||||
*/
|
||||
function exposeGlobal(name, fallback) {
|
||||
if (typeof exports.xglobal[name] === 'undefined') {
|
||||
exports.xglobal[name] = fallback;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"type": "commonjs"
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
export declare const packageInfo: {
|
||||
name: string;
|
||||
path: string;
|
||||
type: string;
|
||||
version: string;
|
||||
};
|
||||
@@ -0,0 +1,4 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.packageInfo = void 0;
|
||||
exports.packageInfo = { name: '@pezkuwi/x-global', path: typeof __dirname === 'string' ? __dirname : 'auto', type: 'cjs', version: '14.0.10' };
|
||||
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
export { packageInfo } from './packageInfo.js';
|
||||
type GlobalThis = typeof globalThis & {
|
||||
process?: {
|
||||
env?: Record<string, string>;
|
||||
};
|
||||
[key: string]: unknown;
|
||||
};
|
||||
type GlobalNames = keyof typeof globalThis;
|
||||
type GlobalType<N extends GlobalNames> = typeof globalThis[N];
|
||||
/**
|
||||
* A cross-environment implementation for globalThis
|
||||
*/
|
||||
export declare const xglobal: GlobalThis;
|
||||
/**
|
||||
* Extracts a known global from the environment, applying a fallback if not found
|
||||
*/
|
||||
export declare function extractGlobal<N extends GlobalNames, T extends GlobalType<N>>(name: N, fallback: unknown): T;
|
||||
/**
|
||||
* Expose a value as a known global, if not already defined
|
||||
*/
|
||||
export declare function exposeGlobal<N extends GlobalNames, T extends GlobalType<N>>(name: N, fallback: unknown): void;
|
||||
@@ -0,0 +1,37 @@
|
||||
export { packageInfo } from './packageInfo.js';
|
||||
/** @internal Last-resort "this", if it gets here it probably would fail anyway */
|
||||
function evaluateThis(fn) {
|
||||
return fn('return this');
|
||||
}
|
||||
/**
|
||||
* A cross-environment implementation for globalThis
|
||||
*/
|
||||
export const xglobal = /*#__PURE__*/ (typeof globalThis !== 'undefined'
|
||||
? globalThis
|
||||
: typeof global !== 'undefined'
|
||||
? global
|
||||
: typeof self !== 'undefined'
|
||||
? self
|
||||
: typeof window !== 'undefined'
|
||||
? window
|
||||
: evaluateThis(Function));
|
||||
/**
|
||||
* Extracts a known global from the environment, applying a fallback if not found
|
||||
*/
|
||||
export function extractGlobal(name, fallback) {
|
||||
// Not quite sure why this is here - snuck in with TS 4.7.2 with no real idea
|
||||
// (as of now) as to why this looks like an "any" when we do cast it to a T
|
||||
//
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
||||
return typeof xglobal[name] === 'undefined'
|
||||
? fallback
|
||||
: xglobal[name];
|
||||
}
|
||||
/**
|
||||
* Expose a value as a known global, if not already defined
|
||||
*/
|
||||
export function exposeGlobal(name, fallback) {
|
||||
if (typeof xglobal[name] === 'undefined') {
|
||||
xglobal[name] = fallback;
|
||||
}
|
||||
}
|
||||
@@ -15,8 +15,60 @@
|
||||
},
|
||||
"sideEffects": false,
|
||||
"type": "module",
|
||||
"version": "14.0.10",
|
||||
"main": "index.js",
|
||||
"version": "14.0.11",
|
||||
"main": "./cjs/index.js",
|
||||
"module": "./index.js",
|
||||
"types": "./index.d.ts",
|
||||
"exports": {
|
||||
"./cjs/package.json": "./cjs/package.json",
|
||||
"./cjs/*": "./cjs/*.js",
|
||||
".": {
|
||||
"module": {
|
||||
"types": "./index.d.ts",
|
||||
"default": "./index.js"
|
||||
},
|
||||
"require": {
|
||||
"types": "./cjs/index.d.ts",
|
||||
"default": "./cjs/index.js"
|
||||
},
|
||||
"default": {
|
||||
"types": "./index.d.ts",
|
||||
"default": "./index.js"
|
||||
}
|
||||
},
|
||||
"./package.json": {
|
||||
"require": "./cjs/package.json",
|
||||
"default": "./package.json"
|
||||
},
|
||||
"./packageInfo.js": {
|
||||
"module": {
|
||||
"types": "./packageInfo.d.ts",
|
||||
"default": "./packageInfo.js"
|
||||
},
|
||||
"require": {
|
||||
"types": "./cjs/packageInfo.d.ts",
|
||||
"default": "./cjs/packageInfo.js"
|
||||
},
|
||||
"default": {
|
||||
"types": "./packageInfo.d.ts",
|
||||
"default": "./packageInfo.js"
|
||||
}
|
||||
},
|
||||
"./packageInfo": {
|
||||
"module": {
|
||||
"types": "./packageInfo.d.ts",
|
||||
"default": "./packageInfo.js"
|
||||
},
|
||||
"require": {
|
||||
"types": "./cjs/packageInfo.d.ts",
|
||||
"default": "./cjs/packageInfo.js"
|
||||
},
|
||||
"default": {
|
||||
"types": "./packageInfo.d.ts",
|
||||
"default": "./packageInfo.js"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"tslib": "^2.8.0"
|
||||
}
|
||||
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
export declare const packageInfo: {
|
||||
name: string;
|
||||
path: string;
|
||||
type: string;
|
||||
version: string;
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
export const packageInfo = { name: '@pezkuwi/x-global', path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '14.0.10' };
|
||||
Reference in New Issue
Block a user