@aurelia/runtime
Advanced tools
Comparing version 2.1.0-dev.202405130849 to 2.1.0-dev.202405280947
@@ -1,20 +0,20 @@ | ||
export { type IObserverLocatorBasedConnectable, type IObserverRecord, connectable, } from './observation/connectable'; | ||
export { ArrayObserver, ArrayIndexObserver, enableArrayObservation, disableArrayObservation, type IArrayIndexObserver, } from './observation/array-observer'; | ||
export { MapObserver, enableMapObservation, disableMapObservation, } from './observation/map-observer'; | ||
export { SetObserver, enableSetObservation, disableSetObservation } from './observation/set-observer'; | ||
export { CollectionLengthObserver, CollectionSizeObserver, } from './observation/collection-length-observer'; | ||
export { ComputedObserver, type ComputedGetterFn, } from './observation/computed-observer'; | ||
export { IDirtyChecker, DirtyChecker, DirtyCheckProperty, DirtyCheckSettings, } from './observation/dirty-checker'; | ||
export { type IEffect, IObservation, Observation, type EffectRunFunc, } from './observation/effect-runner'; | ||
export { type IObservableDefinition, observable, } from './observation/observable'; | ||
export { type IObjectObservationAdapter, IObserverLocator, INodeObserverLocator, IComputedObserverLocator, getCollectionObserver, ObserverLocator, getObserverLookup, type ObservableGetter, } from './observation/observer-locator'; | ||
export { PrimitiveObserver, } from './observation/primitive-observer'; | ||
export { PropertyAccessor, } from './observation/property-accessor'; | ||
export { ProxyObservable, } from './observation/proxy-observation'; | ||
export { nowrap, } from './observation/proxy-decorators'; | ||
export { SetterObserver, } from './observation/setter-observer'; | ||
export { subscriberCollection, } from './observation/subscriber-collection'; | ||
export { batch, } from './observation/subscriber-batch'; | ||
export { ConnectableSwitcher, } from './observation/connectable-switcher'; | ||
export { type AccessorOrObserver, AccessorType, type Collection, type CollectionKind, type IAccessor, type ICollectionChangeTracker, type ICollectionObserver, type IConnectable, type ICollectionSubscriber, type IndexMap, type IObserver, type IObservable, type InterceptorFunc, type ISubscribable, type ISubscriberCollection, type CollectionObserver, type ICollectionSubscriberCollection, type ICollectionSubscribable, type ISubscriber, type ISubscriberRecord, isIndexMap, copyIndexMap, cloneIndexMap, createIndexMap, ICoercionConfiguration, } from './observation'; | ||
export { type IObserverLocatorBasedConnectable, type IObserverRecord, connectable, } from './connectable'; | ||
export { type ArrayObserver, type ArrayIndexObserver, } from './array-observer'; | ||
export { type MapObserver, } from './map-observer'; | ||
export { type SetObserver, } from './set-observer'; | ||
export { CollectionLengthObserver, CollectionSizeObserver, } from './collection-length-observer'; | ||
export { ComputedObserver, type ComputedGetterFn, } from './computed-observer'; | ||
export { IDirtyChecker, DirtyChecker, DirtyCheckProperty, DirtyCheckSettings, } from './dirty-checker'; | ||
export { type IEffect, IObservation, Observation, type EffectRunFunc, } from './effect-runner'; | ||
export { type IObservableDefinition, observable, } from './observable'; | ||
export { type IObjectObservationAdapter, IObserverLocator, INodeObserverLocator, IComputedObserverLocator, getCollectionObserver, ObserverLocator, getObserverLookup, type ObservableGetter, } from './observer-locator'; | ||
export { PrimitiveObserver, } from './primitive-observer'; | ||
export { PropertyAccessor, } from './property-accessor'; | ||
export { ProxyObservable, } from './proxy-observation'; | ||
export { nowrap, } from './proxy-decorators'; | ||
export { SetterObserver, } from './setter-observer'; | ||
export { subscriberCollection, } from './subscriber-collection'; | ||
export { batch, } from './subscriber-batch'; | ||
export { ConnectableSwitcher, } from './connectable-switcher'; | ||
export { type AccessorOrObserver, AccessorType, type Collection, type CollectionKind, type IAccessor, type ICollectionChangeTracker, type ICollectionObserver, type IConnectable, type ICollectionSubscriber, type IndexMap, type IObserver, type IObservable, type InterceptorFunc, type ISubscribable, type ISubscriberCollection, type CollectionObserver, type ICollectionSubscriberCollection, type ICollectionSubscribable, type ISubscriber, type ISubscriberRecord, isIndexMap, copyIndexMap, cloneIndexMap, createIndexMap, ICoercionConfiguration, } from './interfaces'; | ||
//# sourceMappingURL=index.d.ts.map |
{ | ||
"name": "@aurelia/runtime", | ||
"version": "2.1.0-dev.202405130849", | ||
"version": "2.1.0-dev.202405280947", | ||
"main": "dist/cjs/index.cjs", | ||
@@ -57,6 +57,6 @@ "module": "dist/esm/index.mjs", | ||
"dependencies": { | ||
"@aurelia/kernel": "2.1.0-dev.202405130849", | ||
"@aurelia/expression-parser": "2.1.0-dev.202405130849", | ||
"@aurelia/metadata": "2.1.0-dev.202405130849", | ||
"@aurelia/platform": "2.1.0-dev.202405130849" | ||
"@aurelia/kernel": "2.1.0-dev.202405280947", | ||
"@aurelia/expression-parser": "2.1.0-dev.202405280947", | ||
"@aurelia/metadata": "2.1.0-dev.202405280947", | ||
"@aurelia/platform": "2.1.0-dev.202405280947" | ||
}, | ||
@@ -63,0 +63,0 @@ "devDependencies": { |
/* eslint-disable @typescript-eslint/no-unsafe-member-access */ | ||
/* eslint-disable prefer-template */ | ||
import { safeString } from './utilities'; | ||
import { rtSafeString } from './utilities'; | ||
/** @internal */ | ||
export const createMappedError: CreateError = __DEV__ | ||
? (code: ErrorNames, ...details: unknown[]) => new Error(`AUR${safeString(code).padStart(4, '0')}: ${getMessageByCode(code, ...details)}`) | ||
: (code: ErrorNames, ...details: unknown[]) => new Error(`AUR${safeString(code).padStart(4, '0')}:${details.map(safeString)}`); | ||
? (code: ErrorNames, ...details: unknown[]) => new Error(`AUR${rtSafeString(code).padStart(4, '0')}: ${getMessageByCode(code, ...details)}`) | ||
: (code: ErrorNames, ...details: unknown[]) => new Error(`AUR${rtSafeString(code).padStart(4, '0')}:${details.map(rtSafeString)}`); | ||
@@ -35,2 +35,5 @@ _START_CONST_ENUM(); | ||
non_recognisable_collection_type = 210, | ||
dirty_check_no_handler = 217, | ||
dirty_check_not_allowed = 218, | ||
dirty_check_setter_not_allowed = 219, | ||
assign_readonly_size = 220, | ||
@@ -125,2 +128,7 @@ assign_readonly_readonly_property_from_computed = 221, | ||
[ErrorNames.non_recognisable_collection_type]: `Unrecognised collection type {{0:toString}}.`, | ||
[ErrorNames.dirty_check_no_handler]: 'There is no registration for IDirtyChecker interface. If you want to use your own dirty checker, make sure you register it.', | ||
[ErrorNames.dirty_check_not_allowed]: `Dirty checked is not permitted in this application. Property key {{0}} is being dirty checked.`, | ||
[ErrorNames.dirty_check_setter_not_allowed]: `Trying to set value for property {{0}} in dirty checker`, | ||
[ErrorNames.assign_readonly_size]: `Map/Set "size" is a readonly property`, | ||
@@ -144,11 +152,5 @@ [ErrorNames.assign_readonly_readonly_property_from_computed]: `Trying to assign value to readonly property "{{0}}" through computed observer.`, | ||
switch (method) { | ||
case 'nodeName': value = (value as Node).nodeName.toLowerCase(); break; | ||
case 'name': value = (value as { name: string }).name; break; | ||
case 'typeof': value = typeof value; break; | ||
case 'ctor': value = (value as object).constructor.name; break; | ||
case 'controller': value = value.controller.name; break; | ||
case 'target@property': value = `${value.target}@${value.targetProperty}`; break; | ||
case 'toString': value = Object.prototype.toString.call(value); break; | ||
case 'join(!=)': value = (value as unknown[]).join('!='); break; | ||
case 'bindingCommandHelp': value = getBindingCommandHelp(value); break; | ||
case 'element': value = value === '*' ? 'all elements' : `<${value} />`; break; | ||
@@ -158,5 +160,5 @@ default: { | ||
if (method?.startsWith('.')) { | ||
value = safeString(value[method.slice(1)]); | ||
value = rtSafeString(value[method.slice(1)]); | ||
} else { | ||
value = safeString(value); | ||
value = rtSafeString(value); | ||
} | ||
@@ -181,17 +183,1 @@ } | ||
} | ||
function getBindingCommandHelp(name: string) { | ||
switch (name) { | ||
case 'delegate': | ||
return `\nThe ".delegate" binding command has been removed in v2.` | ||
+ ` Binding command ".trigger" should be used instead.` | ||
+ ` If you are migrating v1 application, install compat package` | ||
+ ` to add back the ".delegate" binding command for ease of migration.`; | ||
case 'call': | ||
return `\nThe ".call" binding command has been removed in v2.` | ||
+ ` If you want to pass a callback that preserves the context of the function call,` | ||
+ ` you can use lambda instead. Refer to lambda expression doc for more details.`; | ||
default: | ||
return ''; | ||
} | ||
} |
@@ -5,29 +5,22 @@ export { | ||
connectable, | ||
} from './observation/connectable'; | ||
} from './connectable'; | ||
export { | ||
ArrayObserver, | ||
ArrayIndexObserver, | ||
enableArrayObservation, | ||
disableArrayObservation, | ||
type IArrayIndexObserver, | ||
} from './observation/array-observer'; | ||
type ArrayObserver, | ||
type ArrayIndexObserver, | ||
} from './array-observer'; | ||
export { | ||
MapObserver, | ||
enableMapObservation, | ||
disableMapObservation, | ||
} from './observation/map-observer'; | ||
type MapObserver, | ||
} from './map-observer'; | ||
export { | ||
SetObserver, | ||
enableSetObservation, | ||
disableSetObservation | ||
} from './observation/set-observer'; | ||
type SetObserver, | ||
} from './set-observer'; | ||
export { | ||
CollectionLengthObserver, | ||
CollectionSizeObserver, | ||
} from './observation/collection-length-observer'; | ||
} from './collection-length-observer'; | ||
export { | ||
ComputedObserver, | ||
type ComputedGetterFn, | ||
} from './observation/computed-observer'; | ||
} from './computed-observer'; | ||
export { | ||
@@ -38,3 +31,3 @@ IDirtyChecker, | ||
DirtyCheckSettings, | ||
} from './observation/dirty-checker'; | ||
} from './dirty-checker'; | ||
export { | ||
@@ -45,7 +38,7 @@ type IEffect, | ||
type EffectRunFunc, | ||
} from './observation/effect-runner'; | ||
} from './effect-runner'; | ||
export { | ||
type IObservableDefinition, | ||
observable, | ||
} from './observation/observable'; | ||
} from './observable'; | ||
export { | ||
@@ -61,27 +54,27 @@ type IObjectObservationAdapter, | ||
// type ObservableSetter, | ||
} from './observation/observer-locator'; | ||
} from './observer-locator'; | ||
export { | ||
PrimitiveObserver, | ||
} from './observation/primitive-observer'; | ||
} from './primitive-observer'; | ||
export { | ||
PropertyAccessor, | ||
} from './observation/property-accessor'; | ||
} from './property-accessor'; | ||
export { | ||
ProxyObservable, | ||
} from './observation/proxy-observation'; | ||
} from './proxy-observation'; | ||
export { | ||
nowrap, | ||
} from './observation/proxy-decorators'; | ||
} from './proxy-decorators'; | ||
export { | ||
SetterObserver, | ||
} from './observation/setter-observer'; | ||
} from './setter-observer'; | ||
export { | ||
subscriberCollection, | ||
} from './observation/subscriber-collection'; | ||
} from './subscriber-collection'; | ||
export { | ||
batch, | ||
} from './observation/subscriber-batch'; | ||
} from './subscriber-batch'; | ||
export { | ||
ConnectableSwitcher, | ||
} from './observation/connectable-switcher'; | ||
} from './connectable-switcher'; | ||
@@ -114,2 +107,2 @@ export { | ||
ICoercionConfiguration, | ||
} from './observation'; | ||
} from './interfaces'; |
import { Metadata } from '@aurelia/metadata'; | ||
import { DI } from '@aurelia/kernel'; | ||
const O = Object; | ||
/** | ||
@@ -12,3 +10,3 @@ * A shortcut to Object.prototype.hasOwnProperty | ||
*/ | ||
export const hasOwnProp = O.prototype.hasOwnProperty; | ||
export const hasOwnProp = Object.prototype.hasOwnProperty; | ||
@@ -20,32 +18,7 @@ /** | ||
*/ | ||
export const def = Reflect.defineProperty; | ||
export const rtDef = Reflect.defineProperty; | ||
/** @internal */ | ||
export const createError = (message: string) => new Error(message); | ||
/** @internal */ | ||
// eslint-disable-next-line @typescript-eslint/ban-types | ||
export const isFunction = <K extends Function>(v: unknown): v is K => typeof v === 'function'; | ||
/** @internal */ | ||
export const isString = (v: unknown): v is string => typeof v === 'string'; | ||
/** @internal */ | ||
export const isObject = (v: unknown): v is object => v instanceof O; | ||
/** @internal */ | ||
export const isArray = <T>(v: unknown): v is T[] => v instanceof Array; | ||
/** @internal */ | ||
export const isSet = <T>(v: unknown): v is Set<T> => v instanceof Set; | ||
/** @internal */ | ||
export const isMap = <T, K>(v: unknown): v is Map<T, K> => v instanceof Map; | ||
/** @internal */ | ||
export const areEqual = O.is; | ||
/** @internal */ | ||
export function defineHiddenProp<T>(obj: object, key: PropertyKey, value: T): T { | ||
def(obj, key, { | ||
export function rtDefineHiddenProp<T>(obj: object, key: PropertyKey, value: T): T { | ||
rtDef(obj, key, { | ||
enumerable: false, | ||
@@ -66,15 +39,13 @@ configurable: true, | ||
if (!(key in proto)) { | ||
defineHiddenProp(proto, key, defaultValue); | ||
rtDefineHiddenProp(proto, key, defaultValue); | ||
} | ||
} | ||
/** @internal */ export const objectAssign = Object.assign; | ||
/** @internal */ export const objectFreeze = Object.freeze; | ||
/** @internal */ export const rtObjectAssign = Object.assign; | ||
/** @internal */ export const rtObjectFreeze = Object.freeze; | ||
// this is used inside template literal, since TS errs without String(...value) | ||
/** @internal */ export const safeString = String; | ||
/** @internal */ export const createInterface = DI.createInterface; | ||
/** @internal */ export const rtSafeString = String; | ||
/** @internal */ export const rtCreateInterface = DI.createInterface; | ||
/** @internal */ export const createLookup = <T>(): Record<string, T> => O.create(null) as Record<string, T>; | ||
/** @internal */ export const getMetadata = Metadata.get; | ||
/** @internal */ export const defineMetadata = Metadata.define; | ||
/** @internal */ export const rtGetMetadata = Metadata.get; | ||
/** @internal */ export const rtDefineMetadata = Metadata.define; |
Sorry, the diff of this file is too big to display
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
92
1121267
19166
+ Added@aurelia/expression-parser@2.1.0-dev.202405280947(transitive)
+ Added@aurelia/kernel@2.1.0-dev.202405280947(transitive)
+ Added@aurelia/metadata@2.1.0-dev.202405280947(transitive)
+ Added@aurelia/platform@2.1.0-dev.202405280947(transitive)
- Removed@aurelia/expression-parser@2.1.0-dev.202405130849(transitive)
- Removed@aurelia/kernel@2.1.0-dev.202405130849(transitive)
- Removed@aurelia/metadata@2.1.0-dev.202405130849(transitive)
- Removed@aurelia/platform@2.1.0-dev.202405130849(transitive)