Socket
Socket
Sign inDemoInstall

@aurelia/kernel

Package Overview
Dependencies
Maintainers
1
Versions
1114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aurelia/kernel - npm Package Compare versions

Comparing version 2.0.0-beta.9 to 2.0.0-beta.10

13

CHANGELOG.md

@@ -6,2 +6,15 @@ # Change Log

<a name="2.0.0-beta.10"></a>
# 2.0.0-beta.10 (2024-01-26)
### Bug Fixes:
* **au-slot:** properly handle nested projection registration (#1881) ([00e8dee](https://github.com/aurelia/aurelia/commit/00e8dee))
* **kernel:** stack preserving error logging for console (#1884) ([030bfa1](https://github.com/aurelia/aurelia/commit/030bfa1))
### Refactorings:
* **enums:** string literal types in favour of const enums (#1870) ([e21e0c9](https://github.com/aurelia/aurelia/commit/e21e0c9))
<a name="2.0.0-beta.9"></a>

@@ -8,0 +21,0 @@ # 2.0.0-beta.9 (2023-12-12)

@@ -57,2 +57,8 @@ import { Constructable, IDisposable } from './interfaces';

disposeResolvers(): void;
/**
* Register resources from another container, an API for manually registering resources
*
* This is a semi private API, apps should avoid using it directly
*/
useResources(container: IContainer): void;
find<TType extends ResourceType, TDef extends ResourceDefinition>(kind: IResourceKind<TType, TDef>, name: string): TDef | null;

@@ -196,2 +202,9 @@ create<TType extends ResourceType, TDef extends ResourceDefinition>(kind: IResourceKind<TType, TDef>, name: string): InstanceType<TType> | null;

export declare const IServiceLocator: InterfaceSymbol<IServiceLocator>;
export type ICallableResolver<T> = IResolver<T> & ((...args: unknown[]) => any);
/**
* ! Semi private API to avoid repetitive work creating resolvers.
*
* Naming isn't entirely correct, but it's good enough for internal usage.
*/
export declare function createResolver<T extends Key>(getter: (key: T, handler: IContainer, requestor: IContainer) => any): ((key: T) => ICallableResolver<T>);
export declare const inject: (...dependencies: Key[]) => (target: Injectable, key?: string | number, descriptor?: PropertyDescriptor | number) => void;

@@ -198,0 +211,0 @@ declare function transientDecorator<T extends Constructable>(target: T & Partial<RegisterSelf<T>>): T & RegisterSelf<T>;

4

dist/types/index.d.ts
export { IPlatform, } from './platform';
export { all, factory, type IAllResolver, type IFactoryResolver, type IOptionalResolver, type IResolvedFactory, type INewInstanceResolver, DI, IContainer, type IFactory, inject, type IRegistration, type IRegistry, type IResolver, IServiceLocator, type Key, lazy, type ILazyResolver, type IResolvedLazy, optional, ignore, type RegisterSelf, Registration, type ResolveCallback, singleton, transient, type AbstractInjectable, type Injectable, type InterfaceSymbol, InstanceProvider, type Resolved, type Transformer, newInstanceForScope, newInstanceOf, ContainerConfiguration, DefaultResolver, type IContainerConfiguration, } from './di';
export { createResolver, all, factory, type IAllResolver, type IFactoryResolver, type IOptionalResolver, type IResolvedFactory, type INewInstanceResolver, DI, IContainer, type IFactory, inject, type IRegistration, type IRegistry, type IResolver, IServiceLocator, type Key, lazy, type ILazyResolver, type IResolvedLazy, optional, ignore, type RegisterSelf, Registration, type ResolveCallback, singleton, transient, type AbstractInjectable, type Injectable, type InterfaceSymbol, InstanceProvider, type Resolved, type Transformer, newInstanceForScope, newInstanceOf, ContainerConfiguration, DefaultResolver, type IContainerConfiguration, } from './di';
export { resolve, type IResolvedInjection, } from './di.container';
export { type Class, type Constructable, type ConstructableClass, type IDisposable, type IIndexable, type Overwrite, type Primitive, type Writable, } from './interfaces';
export { LogLevel, type IConsoleLike, ColorOptions, ILogConfig, type ILogEvent, ILogEventFactory, ISink, ILogger, LogConfig, DefaultLogEvent, DefaultLogEventFactory, DefaultLogger, ConsoleSink, LoggerConfiguration, format, sink, } from './logger';
export { LogLevel, type IConsoleLike, type ColorOptions, ILogConfig, type ILogEvent, ILogEventFactory, ISink, ILogger, LogConfig, DefaultLogEvent, DefaultLogEventFactory, DefaultLogger, ConsoleSink, LoggerConfiguration, format, sink, } from './logger';
export { type IModule, IModuleLoader, AnalyzedModule, ModuleItem, } from './module-loader';

@@ -7,0 +7,0 @@ export { noop, emptyArray, emptyObject, } from './platform';

import { IContainer, IRegistry } from './di';
import { Class, Constructable } from './interfaces';
import { IPlatform } from './platform';
export declare const enum LogLevel {
export declare const LogLevel: Readonly<{
/**

@@ -10,41 +10,35 @@ * The most detailed information about internal app state.

*/
trace = 0,
readonly trace: 0;
/**
* Information that is useful for debugging during development and has no long-term value.
*/
debug = 1,
readonly debug: 1;
/**
* Information about the general flow of the application that has long-term value.
*/
info = 2,
readonly info: 2;
/**
* Unexpected circumstances that require attention but do not otherwise cause the current flow of execution to stop.
*/
warn = 3,
readonly warn: 3;
/**
* Unexpected circumstances that cause the flow of execution in the current activity to stop but do not cause an app-wide failure.
*/
error = 4,
readonly error: 4;
/**
* Unexpected circumstances that cause an app-wide failure or otherwise require immediate attention.
*/
fatal = 5,
readonly fatal: 5;
/**
* No messages should be written.
*/
none = 6
}
readonly none: 6;
}>;
export type LogLevel = typeof LogLevel[keyof typeof LogLevel];
/**
* Flags to enable/disable color usage in the logging output.
* - `no-colors`: Do not use ASCII color codes in logging output.
* - `colors`: Use ASCII color codes in logging output. By default, timestamps and the TRC and DBG prefix are colored grey. INF white, WRN yellow, and ERR and FTL red.
*/
export declare const enum ColorOptions {
/**
* Do not use ASCII color codes in logging output.
*/
noColors = 0,
/**
* Use ASCII color codes in logging output. By default, timestamps and the TRC and DBG prefix are colored grey. INF white, WRN yellow, and ERR and FTL red.
*/
colors = 1
}
export type ColorOptions = 'no-colors' | 'colors';
/**

@@ -106,3 +100,3 @@ * The global logger configuration.

*/
createLogEvent(logger: ILogger, logLevel: LogLevel, message: string, optionalParams: unknown[]): ILogEvent;
createLogEvent(logger: ILogger, logLevel: LogLevel, message: string | Error, optionalParams: unknown[]): ILogEvent;
}

@@ -159,3 +153,3 @@ /**

interface SinkDefinition {
handles: Exclude<LogLevel, LogLevel.none>[];
handles: Exclude<LogLevel, typeof none>[];
}

@@ -186,4 +180,9 @@ export declare const LoggerSink: Readonly<{

readonly severity: LogLevel;
readonly message: string | Error;
readonly optionalParams?: readonly unknown[];
readonly scope: readonly string[];
readonly colorOptions: ColorOptions;
readonly timestamp: number;
toString(): string;
getFormattedLogInfo(forConsole?: boolean): [string, ...unknown[]];
}

@@ -197,3 +196,3 @@ export declare class LogConfig implements ILogConfig {

readonly severity: LogLevel;
readonly message: string;
readonly message: string | Error;
readonly optionalParams: unknown[];

@@ -203,8 +202,9 @@ readonly scope: readonly string[];

readonly timestamp: number;
constructor(severity: LogLevel, message: string, optionalParams: unknown[], scope: readonly string[], colorOptions: ColorOptions, timestamp: number);
constructor(severity: LogLevel, message: string | Error, optionalParams: unknown[], scope: readonly string[], colorOptions: ColorOptions, timestamp: number);
toString(): string;
getFormattedLogInfo(forConsole?: boolean): [string, ...unknown[]];
}
export declare class DefaultLogEventFactory implements ILogEventFactory {
readonly config: ILogConfig;
createLogEvent(logger: ILogger, level: LogLevel, message: string, optionalParams: unknown[]): ILogEvent;
createLogEvent(logger: ILogger, level: LogLevel, message: string | Error, optionalParams: unknown[]): ILogEvent;
}

@@ -211,0 +211,0 @@ export declare class ConsoleSink implements ISink {

{
"name": "@aurelia/kernel",
"version": "2.0.0-beta.9",
"version": "2.0.0-beta.10",
"main": "dist/cjs/index.cjs",
"module": "dist/esm/index.mjs",
"exports": {
"types": "./dist/types/index.d.ts",
"require": "./dist/cjs/index.cjs",
"import": "./dist/esm/index.mjs",
"development": "./dist/esm/index.dev.mjs"
".": {
"types": "./dist/types/index.d.ts",
"require": "./dist/cjs/index.cjs",
"import": "./dist/esm/index.mjs",
"development": "./dist/esm/index.dev.mjs"
},
"./development": {
"types": "./dist/types/index.d.ts",
"require": "./dist/cjs/index.dev.cjs",
"import": "./dist/esm/index.dev.mjs"
}
},

@@ -48,4 +55,4 @@ "types": "dist/types/index.d.ts",

"dependencies": {
"@aurelia/metadata": "2.0.0-beta.9",
"@aurelia/platform": "2.0.0-beta.9"
"@aurelia/metadata": "2.0.0-beta.10",
"@aurelia/platform": "2.0.0-beta.10"
},

@@ -52,0 +59,0 @@ "devDependencies": {

@@ -80,20 +80,24 @@ /* eslint-disable @typescript-eslint/no-this-alias */

/** @internal */
private readonly _parent: Container | null;
/** @internal */
private readonly config: ContainerConfiguration;
public constructor(
private readonly _parent: Container | null,
private readonly config: ContainerConfiguration
parent: Container | null,
config: ContainerConfiguration
) {
if (_parent === null) {
this._parent = parent;
this.config = config;
this._resolvers = new Map();
this.res = {};
if (parent === null) {
this.root = this;
this._resolvers = new Map();
this._factories = new Map<Constructable, Factory>();
this.res = {};
} else {
this.root = _parent.root;
this.root = parent.root;
this._factories = parent._factories;
this._resolvers = new Map();
this._factories = _parent._factories;
this.res = {};
if (config.inheritParentResources) {

@@ -103,4 +107,4 @@ // todo: when the simplify resource system work is commenced

// with parent resources as the prototype of the child resources
for (const key in _parent.res) {
this.registerResolver(key, _parent.res[key]!);
for (const key in parent.res) {
this.registerResolver(key, parent.res[key]!);
}

@@ -431,2 +435,9 @@ }

public useResources(container: Container): void {
const res = container.res;
for (const key in res) {
this.registerResolver(key, res[key]!);
}
}
public find<TType extends ResourceType, TDef extends ResourceDefinition>(kind: IResourceKind<TType, TDef>, name: string): TDef | null {

@@ -433,0 +444,0 @@ const key = kind.keyFrom(name);

@@ -84,2 +84,8 @@ /* eslint-disable @typescript-eslint/no-explicit-any */

disposeResolvers(): void;
/**
* Register resources from another container, an API for manually registering resources
*
* This is a semi private API, apps should avoid using it directly
*/
useResources(container: IContainer): void;
find<TType extends ResourceType, TDef extends ResourceDefinition>(kind: IResourceKind<TType, TDef>, name: string): TDef | null;

@@ -472,14 +478,21 @@ create<TType extends ResourceType, TDef extends ResourceDefinition>(kind: IResourceKind<TType, TDef>, name: string): InstanceType<TType> | null;

function createResolver(getter: (key: any, handler: IContainer, requestor: IContainer) => any): (key: any) => any {
return function (key: any): ReturnType<typeof DI.inject> {
const resolver = function (target: Injectable, property?: string | number, descriptor?: PropertyDescriptor | number): void {
inject(resolver)(target, property, descriptor);
};
export type ICallableResolver<T> = IResolver<T> & ((...args: unknown[]) => any);
resolver.$isResolver = true;
resolver.resolve = function (handler: IContainer, requestor: IContainer): any {
/**
* ! Semi private API to avoid repetitive work creating resolvers.
*
* Naming isn't entirely correct, but it's good enough for internal usage.
*/
export function createResolver<T extends Key>(getter: (key: T, handler: IContainer, requestor: IContainer) => any): ((key: T) => ICallableResolver<T>) {
return function (key: any) {
function Resolver(target: any, property?: string | number, descriptor?: PropertyDescriptor | number): void {
inject(Resolver)(target, property, descriptor);
}
Resolver.$isResolver = true;
Resolver.resolve = function (handler: IContainer, requestor: IContainer): any {
return getter(key, handler, requestor);
};
return resolver;
return Resolver as ICallableResolver<T>;
};

@@ -486,0 +499,0 @@ }

@@ -6,2 +6,3 @@ export {

export {
createResolver,
all,

@@ -65,3 +66,3 @@ factory,

type IConsoleLike,
ColorOptions,
type ColorOptions,
ILogConfig,

@@ -68,0 +69,0 @@ type ILogEvent,

@@ -8,6 +8,14 @@ import { Metadata } from '@aurelia/metadata';

import { getAnnotationKeyFor } from './resource';
import { createObject, defineMetadata, isFunction } from './utilities';
import { createObject, defineMetadata, isFunction, objectFreeze } from './utilities';
import { resolve } from './di.container';
export const enum LogLevel {
/** @internal */ export const trace = 0;
/** @internal */ export const debug = 1;
/** @internal */ export const info = 2;
/** @internal */ export const warn = 3;
/** @internal */ export const error = 4;
/** @internal */ export const fatal = 5;
/** @internal */ export const none = 6;
export const LogLevel = objectFreeze({
/**

@@ -18,42 +26,36 @@ * The most detailed information about internal app state.

*/
trace = 0,
trace,
/**
* Information that is useful for debugging during development and has no long-term value.
*/
debug = 1,
debug,
/**
* Information about the general flow of the application that has long-term value.
*/
info = 2,
info,
/**
* Unexpected circumstances that require attention but do not otherwise cause the current flow of execution to stop.
*/
warn = 3,
warn,
/**
* Unexpected circumstances that cause the flow of execution in the current activity to stop but do not cause an app-wide failure.
*/
error = 4,
error,
/**
* Unexpected circumstances that cause an app-wide failure or otherwise require immediate attention.
*/
fatal = 5,
fatal,
/**
* No messages should be written.
*/
none = 6,
}
none,
} as const);
export type LogLevel = typeof LogLevel[keyof typeof LogLevel];
/**
* Flags to enable/disable color usage in the logging output.
* - `no-colors`: Do not use ASCII color codes in logging output.
* - `colors`: Use ASCII color codes in logging output. By default, timestamps and the TRC and DBG prefix are colored grey. INF white, WRN yellow, and ERR and FTL red.
*/
export const enum ColorOptions {
/**
* Do not use ASCII color codes in logging output.
*/
noColors = 0,
/**
* Use ASCII color codes in logging output. By default, timestamps and the TRC and DBG prefix are colored grey. INF white, WRN yellow, and ERR and FTL red.
*/
colors = 1,
}
export type ColorOptions = 'no-colors' | 'colors';

@@ -118,3 +120,3 @@ /**

*/
createLogEvent(logger: ILogger, logLevel: LogLevel, message: string, optionalParams: unknown[]): ILogEvent;
createLogEvent(logger: ILogger, logLevel: LogLevel, message: string | Error, optionalParams: unknown[]): ILogEvent;
}

@@ -167,3 +169,3 @@

export const ILogConfig = /*@__PURE__*/createInterface<ILogConfig>('ILogConfig', x => x.instance(new LogConfig(ColorOptions.noColors, LogLevel.warn)));
export const ILogConfig = /*@__PURE__*/createInterface<ILogConfig>('ILogConfig', x => x.instance(new LogConfig('no-colors', warn)));
export const ISink = /*@__PURE__*/createInterface<ISink>('ISink');

@@ -175,6 +177,6 @@ export const ILogEventFactory = /*@__PURE__*/createInterface<ILogEventFactory>('ILogEventFactory', x => x.singleton(DefaultLogEventFactory));

interface SinkDefinition {
handles: Exclude<LogLevel, LogLevel.none>[];
handles: Exclude<LogLevel, typeof none>[];
}
export const LoggerSink = Object.freeze({
export const LoggerSink = /*@__PURE__*/objectFreeze({
key: getAnnotationKeyFor('logger-sink-handles'),

@@ -232,4 +234,9 @@ define<TSink extends ISink>(target: Constructable<TSink>, definition: SinkDefinition) {

readonly severity: LogLevel;
readonly message: string | Error;
readonly optionalParams?: readonly unknown[];
readonly scope: readonly string[];
readonly colorOptions: ColorOptions;
readonly timestamp: number;
toString(): string;
getFormattedLogInfo(forConsole?: boolean): [string, ...unknown[]];
}

@@ -245,4 +252,4 @@

const getLogLevelString = (function () {
const logLevelString = [
toLookup({
const logLevelString = {
'no-colors': toLookup({
TRC: 'TRC',

@@ -256,3 +263,3 @@ DBG: 'DBG',

} as const),
toLookup({
'colors': toLookup({
TRC: format.grey('TRC'),

@@ -266,21 +273,21 @@ DBG: format.grey('DBG'),

} as const),
] as const;
} as const;
return (level: LogLevel, colorOptions: ColorOptions): string => {
if (level <= LogLevel.trace) {
if (level <= trace) {
return logLevelString[colorOptions].TRC;
}
if (level <= LogLevel.debug) {
if (level <= debug) {
return logLevelString[colorOptions].DBG;
}
if (level <= LogLevel.info) {
if (level <= info) {
return logLevelString[colorOptions].INF;
}
if (level <= LogLevel.warn) {
if (level <= warn) {
return logLevelString[colorOptions].WRN;
}
if (level <= LogLevel.error) {
if (level <= error) {
return logLevelString[colorOptions].ERR;
}
if (level <= LogLevel.fatal) {
if (level <= fatal) {
return logLevelString[colorOptions].FTL;

@@ -293,3 +300,3 @@ }

const getScopeString = (scope: readonly string[], colorOptions: ColorOptions): string => {
if (colorOptions === ColorOptions.noColors) {
if (colorOptions === 'no-colors') {
return scope.join('.');

@@ -301,3 +308,3 @@ }

const getIsoString = (timestamp: number, colorOptions: ColorOptions): string => {
if (colorOptions === ColorOptions.noColors) {
if (colorOptions === 'no-colors') {
return new Date(timestamp).toISOString();

@@ -311,3 +318,3 @@ }

public readonly severity: LogLevel,
public readonly message: string,
public readonly message: string | Error,
public readonly optionalParams: unknown[],

@@ -327,2 +334,25 @@ public readonly scope: readonly string[],

}
public getFormattedLogInfo(forConsole: boolean = false): [string, ...unknown[]] {
const { severity, message: messageOrError, scope, colorOptions, timestamp, optionalParams } = this;
let error: Error|null = null;
let message: string = '';
if (forConsole && messageOrError instanceof Error) {
error = messageOrError;
} else {
message = messageOrError as string;
}
const scopeInfo = scope.length === 0 ? '' : ` ${getScopeString(scope, colorOptions)}`;
let msg = `${getIsoString(timestamp, colorOptions)} [${getLogLevelString(severity, colorOptions)}${scopeInfo}] ${message}`;
if (optionalParams === void 0 || optionalParams.length === 0) {
return error === null ? [msg] : [msg, error];
}
let offset = 0;
while (msg.includes('%s')) {
msg = msg.replace('%s', String(optionalParams[offset++]));
}
return error !== null ? [msg, error, ...optionalParams.slice(offset)] : [msg, ...optionalParams.slice(offset)];
}
}

@@ -333,3 +363,3 @@

public createLogEvent(logger: ILogger, level: LogLevel, message: string, optionalParams: unknown[]): ILogEvent {
public createLogEvent(logger: ILogger, level: LogLevel, message: string | Error, optionalParams: unknown[]): ILogEvent {
return new DefaultLogEvent(level, message, optionalParams, logger.scope, this.config.colorOptions, Date.now());

@@ -356,36 +386,14 @@ }

this.handleEvent = function emit(event: ILogEvent): void {
const optionalParams = event.optionalParams;
if (optionalParams === void 0 || optionalParams.length === 0) {
const msg = event.toString();
switch (event.severity) {
case LogLevel.trace:
case LogLevel.debug:
return $console.debug(msg);
case LogLevel.info:
return $console.info(msg);
case LogLevel.warn:
return $console.warn(msg);
case LogLevel.error:
case LogLevel.fatal:
return $console.error(msg);
}
} else {
let msg = event.toString();
let offset = 0;
// console.log in chrome doesn't call .toString() on object inputs (https://bugs.chromium.org/p/chromium/issues/detail?id=1146817)
while (msg.includes('%s')) {
msg = msg.replace('%s', String(optionalParams[offset++]));
}
switch (event.severity) {
case LogLevel.trace:
case LogLevel.debug:
return $console.debug(msg, ...optionalParams.slice(offset));
case LogLevel.info:
return $console.info(msg, ...optionalParams.slice(offset));
case LogLevel.warn:
return $console.warn(msg, ...optionalParams.slice(offset));
case LogLevel.error:
case LogLevel.fatal:
return $console.error(msg, ...optionalParams.slice(offset));
}
const _info = event.getFormattedLogInfo(true);
switch (event.severity) {
case trace:
case debug:
return $console.debug(..._info);
case info:
return $console.info(..._info);
case warn:
return $console.warn(..._info);
case error:
case fatal:
return $console.error(..._info);
}

@@ -468,18 +476,18 @@ };

const handles = LoggerSink.getHandles($sink);
if (handles?.includes(LogLevel.trace) ?? true) {
if (handles?.includes(trace) ?? true) {
traceSinks.push($sink);
}
if (handles?.includes(LogLevel.debug) ?? true) {
if (handles?.includes(debug) ?? true) {
debugSinks.push($sink);
}
if (handles?.includes(LogLevel.info) ?? true) {
if (handles?.includes(info) ?? true) {
infoSinks.push($sink);
}
if (handles?.includes(LogLevel.warn) ?? true) {
if (handles?.includes(warn) ?? true) {
warnSinks.push($sink);
}
if (handles?.includes(LogLevel.error) ?? true) {
if (handles?.includes(error) ?? true) {
errorSinks.push($sink);
}
if (handles?.includes(LogLevel.fatal) ?? true) {
if (handles?.includes(fatal) ?? true) {
fatalSinks.push($sink);

@@ -523,4 +531,4 @@ }

public trace(messageOrGetMessage: unknown, ...optionalParams: unknown[]): void {
if (this.config.level <= LogLevel.trace) {
this._emit(this._traceSinks, LogLevel.trace, messageOrGetMessage, optionalParams);
if (this.config.level <= trace) {
this._emit(this._traceSinks, trace, messageOrGetMessage, optionalParams);
}

@@ -551,4 +559,4 @@ }

public debug(messageOrGetMessage: unknown, ...optionalParams: unknown[]): void {
if (this.config.level <= LogLevel.debug) {
this._emit(this._debugSinks, LogLevel.debug, messageOrGetMessage, optionalParams);
if (this.config.level <= debug) {
this._emit(this._debugSinks, debug, messageOrGetMessage, optionalParams);
}

@@ -579,4 +587,4 @@ }

public info(messageOrGetMessage: unknown, ...optionalParams: unknown[]): void {
if (this.config.level <= LogLevel.info) {
this._emit(this._infoSinks, LogLevel.info, messageOrGetMessage, optionalParams);
if (this.config.level <= info) {
this._emit(this._infoSinks, info, messageOrGetMessage, optionalParams);
}

@@ -607,4 +615,4 @@ }

public warn(messageOrGetMessage: unknown, ...optionalParams: unknown[]): void {
if (this.config.level <= LogLevel.warn) {
this._emit(this._warnSinks, LogLevel.warn, messageOrGetMessage, optionalParams);
if (this.config.level <= warn) {
this._emit(this._warnSinks, warn, messageOrGetMessage, optionalParams);
}

@@ -635,4 +643,4 @@ }

public error(messageOrGetMessage: unknown, ...optionalParams: unknown[]): void {
if (this.config.level <= LogLevel.error) {
this._emit(this._errorSinks, LogLevel.error, messageOrGetMessage, optionalParams);
if (this.config.level <= error) {
this._emit(this._errorSinks, error, messageOrGetMessage, optionalParams);
}

@@ -663,4 +671,4 @@ }

public fatal(messageOrGetMessage: unknown, ...optionalParams: unknown[]): void {
if (this.config.level <= LogLevel.fatal) {
this._emit(this._fatalSinks, LogLevel.fatal, messageOrGetMessage, optionalParams);
if (this.config.level <= fatal) {
this._emit(this._fatalSinks, fatal, messageOrGetMessage, optionalParams);
}

@@ -729,3 +737,3 @@ }

*/
export const LoggerConfiguration = toLookup({
export const LoggerConfiguration = /*@__PURE__*/ toLookup({
/**

@@ -738,4 +746,4 @@ * @param $console - The `console` object to use. Can be the native `window.console` / `global.console`, but can also be a wrapper or mock that implements the same interface.

{
level = LogLevel.warn,
colorOptions = ColorOptions.noColors,
level = warn,
colorOptions = 'no-colors',
sinks = [],

@@ -742,0 +750,0 @@ }: Partial<ILoggingConfigurationOptions> = {}

import { Platform } from '@aurelia/platform';
import { createInterface } from './di';
import { objectFreeze } from './utilities';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const emptyArray: any[] = Object.freeze<any>([]);
export const emptyArray: any[] = objectFreeze<any>([]);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const emptyObject: any = Object.freeze({}) as any;
export const emptyObject: any = objectFreeze({}) as any;
// eslint-disable-next-line @typescript-eslint/no-empty-function

@@ -9,0 +10,0 @@ export function noop(): void {}

import { IContainer } from './di';
import { Constructable } from './interfaces';
import { emptyArray } from './platform';
import { defineMetadata, hasOwnMetadata, getOwnMetadata } from './utilities';
import { defineMetadata, hasOwnMetadata, getOwnMetadata, objectFreeze } from './utilities';

@@ -61,3 +61,3 @@ export type ResourceType<

};
const annotation = Object.freeze({
const annotation = /*@__PURE__*/ objectFreeze({
name: 'au:annotation',

@@ -92,3 +92,3 @@ appendTo: appendAnnotation,

const resource = Object.freeze({
const resource = /*@__PURE__*/ objectFreeze({
name: resBaseName,

@@ -95,0 +95,0 @@ appendTo(target: Constructable, key: string): void {

import { Metadata } from '@aurelia/metadata';
/** @internal */ export const objectFreeze = Object.freeze;
/** @internal */ export const safeString = String;

@@ -4,0 +5,0 @@ /** @internal */ export const getOwnMetadata = Metadata.getOwn;

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