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

@xylabs/object

Package Overview
Dependencies
Maintainers
7
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xylabs/object - npm Package Compare versions

Comparing version 3.0.24 to 3.0.25

dist/browser/globallyUnique.d.cts

1

dist/browser/Base.d.ts

@@ -10,2 +10,3 @@ import { Logger } from '@xylabs/logger';

static defaultLogger?: Logger;
static readonly uniqueName: string;
constructor(params: TParams);

@@ -12,0 +13,0 @@ protected get logger(): Logger | undefined;

@@ -7,2 +7,3 @@ export * from './AnyObject';

export * from './EmptyObject';
export * from './globallyUnique';
export * from './isObject';

@@ -9,0 +10,0 @@ export * from './IsObjectFactory';

@@ -73,2 +73,19 @@ // src/AsTypeFactory.ts

// src/globallyUnique.ts
var globallyUnique = (name, value, domain = "global") => {
const uniqueName = [domain, name].join(":");
const xyo = globalThis.xylabs = globalThis.xylabs ?? {};
const unique = xyo.unique = xyo.unique ?? {};
if (unique[uniqueName] === void 0) {
unique[uniqueName] = value;
} else {
if (unique[uniqueName] !== value) {
throw new Error(
`Global unique item ${uniqueName} already defined. Make sure you are not importing two versions of the package that contains this item`
);
}
}
return uniqueName;
};
// src/Base.ts

@@ -81,2 +98,3 @@ var Base = class _Base {

static defaultLogger;
static uniqueName = globallyUnique(this.name, this, "xyo");
get logger() {

@@ -200,2 +218,3 @@ return this.params?.logger ?? _Base.defaultLogger;

asAnyObject,
globallyUnique,
isJsonArray,

@@ -202,0 +221,0 @@ isJsonObject,

@@ -10,2 +10,3 @@ import { Logger } from '@xylabs/logger';

static defaultLogger?: Logger;
static readonly uniqueName: string;
constructor(params: TParams);

@@ -12,0 +13,0 @@ protected get logger(): Logger | undefined;

@@ -7,2 +7,3 @@ export * from './AnyObject';

export * from './EmptyObject';
export * from './globallyUnique';
export * from './isObject';

@@ -9,0 +10,0 @@ export * from './IsObjectFactory';

@@ -73,2 +73,19 @@ // src/AsTypeFactory.ts

// src/globallyUnique.ts
var globallyUnique = (name, value, domain = "global") => {
const uniqueName = [domain, name].join(":");
const xyo = globalThis.xylabs = globalThis.xylabs ?? {};
const unique = xyo.unique = xyo.unique ?? {};
if (unique[uniqueName] === void 0) {
unique[uniqueName] = value;
} else {
if (unique[uniqueName] !== value) {
throw new Error(
`Global unique item ${uniqueName} already defined. Make sure you are not importing two versions of the package that contains this item`
);
}
}
return uniqueName;
};
// src/Base.ts

@@ -82,2 +99,3 @@ var Base = class _Base {

static defaultLogger;
static uniqueName = globallyUnique(this.name, this, "xyo");
get logger() {

@@ -202,2 +220,3 @@ var _a;

asAnyObject,
globallyUnique,
isJsonArray,

@@ -204,0 +223,0 @@ isJsonObject,

8

package.json

@@ -14,5 +14,5 @@ {

"dependencies": {
"@xylabs/assert": "^3.0.24",
"@xylabs/logger": "^3.0.24",
"@xylabs/promise": "^3.0.24"
"@xylabs/assert": "^3.0.25",
"@xylabs/logger": "^3.0.25",
"@xylabs/promise": "^3.0.25"
},

@@ -62,4 +62,4 @@ "devDependencies": {

"sideEffects": false,
"version": "3.0.24",
"version": "3.0.25",
"type": "module"
}
import { Logger } from '@xylabs/logger'
import { EmptyObject } from './EmptyObject'
import { globallyUnique } from './globallyUnique'

@@ -14,2 +15,3 @@ export type BaseParamsFields = {

static defaultLogger?: Logger
static readonly uniqueName = globallyUnique(this.name, this, 'xyo')

@@ -16,0 +18,0 @@ constructor(readonly params: TParams) {

@@ -7,2 +7,3 @@ export * from './AnyObject'

export * from './EmptyObject'
export * from './globallyUnique'
export * from './isObject'

@@ -9,0 +10,0 @@ export * from './IsObjectFactory'

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

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

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