New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@aurelia/runtime

Package Overview
Dependencies
Maintainers
1
Versions
1120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aurelia/runtime - npm Package Compare versions

Comparing version

to
2.1.0-dev.202401061915

dist/cjs/index.cjs.map

2

dist/types/index.d.ts

@@ -5,3 +5,3 @@ export { ExpressionKind, CallFunctionExpression, CustomExpression, BindingBehaviorExpression, ValueConverterExpression, AssignExpression, ConditionalExpression, AccessThisExpression, AccessGlobalExpression, AccessScopeExpression, AccessMemberExpression, AccessKeyedExpression, CallScopeExpression, CallMemberExpression, BinaryExpression, UnaryExpression, PrimitiveLiteralExpression, ArrayLiteralExpression, ObjectLiteralExpression, TemplateExpression, TaggedTemplateExpression, ArrayBindingPattern, ObjectBindingPattern, BindingIdentifier, ForOfStatement, Interpolation, DestructuringAssignmentExpression, DestructuringAssignmentSingleExpression, DestructuringAssignmentRestExpression, ArrowFunction, astVisit, Unparser, type AnyBindingExpression, type BindingBehaviorInstance, type IsPrimary, type IsLiteral, type IsLeftHandSide, type IsUnary, type IsBinary, type IsConditional, type IsAssign, type IsValueConverter, type IsBindingBehavior, type IsAssignable, type IsExpression, type IsExpressionOrStatement, type IVisitor, type BinaryOperator, type BindingIdentifierOrPattern, type UnaryOperator, type IAstEvaluator, type ValueConverterInstance, } from './binding/ast';

export { IExpressionParser, ExpressionType, parseExpression, } from './binding/expression-parser';
export { ArrayObserver, ArrayIndexObserver, enableArrayObservation, disableArrayObservation, applyMutationsToIndices, synchronizeIndices, type IArrayIndexObserver, } from './observation/array-observer';
export { ArrayObserver, ArrayIndexObserver, enableArrayObservation, disableArrayObservation, type IArrayIndexObserver, } from './observation/array-observer';
export { MapObserver, enableMapObservation, disableMapObservation, } from './observation/map-observer';

@@ -8,0 +8,0 @@ export { SetObserver, enableSetObservation, disableSetObservation } from './observation/set-observer';

@@ -37,15 +37,2 @@ import { AccessorType, type ISubscriberCollection, type ICollectionSubscriberCollection, type IObserver, type CollectionKind, type ICollectionObserver, type IndexMap, type ISubscriber } from '../observation';

export declare function getArrayObserver(array: unknown[]): ArrayObserver;
/**
* Applies offsets to the non-negative indices in the IndexMap
* based on added and deleted items relative to those indices.
*
* e.g. turn `[-2, 0, 1]` into `[-2, 1, 2]`, allowing the values at the indices to be
* used for sorting/reordering items if needed
*/
export declare function applyMutationsToIndices(indexMap: IndexMap): IndexMap;
/**
* After `applyMutationsToIndices`, this function can be used to reorder items in a derived
* array (e.g. the items in the `views` in the repeater are derived from the `items` property)
*/
export declare function synchronizeIndices<T>(items: T[], indexMap: IndexMap): void;
//# sourceMappingURL=array-observer.d.ts.map

@@ -13,3 +13,3 @@ import { IObserverLocator } from './observer-locator';

*/
watch<T, R>(obj: T, getter: (obj: T, watcher: IConnectable) => R, callback: (value: R, oldValue: R | undefined) => unknown | void, options?: IWatchOptions): IEffect;
watch<T, R>(obj: T, getter: (obj: T, watcher: IConnectable) => R, callback: (value: R, oldValue: R | undefined) => unknown, options?: IWatchOptions): IEffect;
}

@@ -28,3 +28,3 @@ export declare const IObservation: import("@aurelia/kernel").InterfaceSymbol<IObservation>;

run(fn: EffectRunFunc): IEffect;
watch<T, R>(obj: T, getter: (obj: T, watcher: IConnectable) => R, callback: (value: R, oldValue: R | undefined) => unknown | void, options?: IWatchOptions): IEffect;
watch<T, R>(obj: T, getter: (obj: T, watcher: IConnectable) => R, callback: (value: R, oldValue: R | undefined) => unknown, options?: IWatchOptions): IEffect;
}

@@ -31,0 +31,0 @@ export type EffectRunFunc = (this: IConnectable, runner: IConnectable) => void;

{
"name": "@aurelia/runtime",
"version": "2.1.0-dev.202307101053",
"version": "2.1.0-dev.202401061915",
"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"
}
},

@@ -27,7 +34,3 @@ "types": "dist/types/index.d.ts",

"files": [
"dist/**/*.cjs",
"dist/**/*.dev.cjs.map",
"dist/**/*.mjs",
"dist/**/*.dev.mjs.map",
"dist/**/*.d.ts",
"dist",
"src/**/*.ts",

@@ -41,3 +44,3 @@ "README.md",

"lint": "eslint --cache --ext .js,.ts src/",
"lint:ci": "eslint --cache --ext .js,.ts --quiet --report-unused-disable-directives src/",
"lint:ci": "eslint --ext .js,.ts --quiet --report-unused-disable-directives src/",
"build": "rollup -c",

@@ -55,8 +58,8 @@ "dev": "rollup -c -w",

"dependencies": {
"@aurelia/kernel": "2.1.0-dev.202307101053",
"@aurelia/metadata": "2.1.0-dev.202307101053",
"@aurelia/platform": "2.1.0-dev.202307101053"
"@aurelia/kernel": "2.1.0-dev.202401061915",
"@aurelia/metadata": "2.1.0-dev.202401061915",
"@aurelia/platform": "2.1.0-dev.202401061915"
},
"devDependencies": {
"typescript": "5.0.2"
"typescript": "5.2.2"
},

@@ -63,0 +66,0 @@ "engines": {

@@ -79,4 +79,4 @@ /* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */

if (expression.length === 0) {
// only allow function to be empty
if ((expressionType & (ExpressionType.IsFunction | ExpressionType.IsProperty)) > 0) {
// this is an intermediate code before converting the ExpressionType enum to a string literal type as part of the issue #1736
if (expressionType === ExpressionType.IsFunction || expressionType === ExpressionType.IsProperty) {
return PrimitiveLiteralExpression.$empty;

@@ -274,3 +274,3 @@ }

IdentifierName = 0b0000000001100_0000_000000,
Keyword = 0b0000000001000_0000_000000,
// Keyword = 0b0000000001000_0000_000000,
Identifier = 0b0000000000100_0000_000000,

@@ -349,3 +349,2 @@ Contextual = 0b0000000000010_0000_000000,

}
/* eslint-enable @typescript-eslint/indent */

@@ -1142,4 +1141,3 @@ let $input: string = '';

// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
switch ($currentToken as Token) {
switch ($currentToken) {
case Token.Comma:

@@ -1496,2 +1494,3 @@ nextToken();

const token: Token|undefined = KeywordLookup[$tokenValue = $tokenRaw()];
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
return token === undefined ? Token.Identifier : token;

@@ -1498,0 +1497,0 @@ }

@@ -162,3 +162,2 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */

}
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
cooked = cooked.slice(0, matches.index) + value + cooked.slice(regex.lastIndex);

@@ -165,0 +164,0 @@ matches = regex.exec(cooked);

@@ -81,4 +81,2 @@ export {

disableArrayObservation,
applyMutationsToIndices,
synchronizeIndices,
type IArrayIndexObserver,

@@ -85,0 +83,0 @@ } from './observation/array-observer';

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

type ICollectionSubscriberCollection,
cloneIndexMap,
type IObserver,

@@ -348,3 +347,3 @@ type CollectionKind,

}
if (shouldNotify) {
if (shouldNotify || batching) {
o.notify();

@@ -513,60 +512,1 @@ }

}
/**
* A compare function to pass to `Array.prototype.sort` for sorting numbers.
* This is needed for numeric sort, since the default sorts them as strings.
*/
const compareNumber = (a: number, b: number): number => a - b;
/**
* Applies offsets to the non-negative indices in the IndexMap
* based on added and deleted items relative to those indices.
*
* e.g. turn `[-2, 0, 1]` into `[-2, 1, 2]`, allowing the values at the indices to be
* used for sorting/reordering items if needed
*/
export function applyMutationsToIndices(indexMap: IndexMap): IndexMap {
let offset = 0;
let j = 0;
let i = 0;
const $indexMap = cloneIndexMap(indexMap);
// during a batch, items could be deleted in a non-linear order with multiple splices
if ($indexMap.deletedIndices.length > 1) {
// TODO: also synchronize deletedItems when we need them
$indexMap.deletedIndices.sort(compareNumber);
}
const len = $indexMap.length;
for (; i < len; ++i) {
while ($indexMap.deletedIndices[j] <= i - offset) {
++j;
--offset;
}
if ($indexMap[i] === -2) {
++offset;
} else {
$indexMap[i] += offset;
}
}
return $indexMap;
}
/**
* After `applyMutationsToIndices`, this function can be used to reorder items in a derived
* array (e.g. the items in the `views` in the repeater are derived from the `items` property)
*/
export function synchronizeIndices<T>(items: T[], indexMap: IndexMap): void {
const copy = items.slice();
const len = indexMap.length;
let to = 0;
let from = 0;
while (to < len) {
from = indexMap[to];
if (from !== -2) {
items[to] = copy[from];
}
++to;
}
}

@@ -23,3 +23,3 @@ import { connectable } from '../binding/connectable';

getter: (obj: T, watcher: IConnectable) => R,
callback: (value: R, oldValue: R | undefined) => unknown | void,
callback: (value: R, oldValue: R | undefined) => unknown,
options?: IWatchOptions,

@@ -58,3 +58,3 @@ ): IEffect;

getter: (obj: T, watcher: IConnectable) => R,
callback: (value: R, oldValue: R | undefined) => unknown | void,
callback: (value: R, oldValue: R | undefined) => unknown,
options: IWatchOptions = this._defaultWatchOptions

@@ -61,0 +61,0 @@ ): IEffect {

@@ -24,3 +24,3 @@ import { Constructable } from '@aurelia/kernel';

// returning any just for TS, as it is unable to selectively choose whether it's a class decorator or prop decorator
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-redundant-type-constituents
export function nowrap(): ClassDecorator | PropertyDecorator | any; // (target: Constructable | object, key: PropertyKey, descriptor?: PropertyDescriptor) => void;

@@ -27,0 +27,0 @@

@@ -84,2 +84,4 @@ import {

currBatch!.set(subs, [2, collection, indexMap]);
} else {
currBatch!.get(subs)![2] = indexMap;
}

@@ -86,0 +88,0 @@ }

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