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

@interslavic/odometer

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@interslavic/odometer - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

4

dist/multireplacer/Intermediate.d.ts

@@ -1,2 +0,2 @@

import { Replacement } from './index';
import { Replacement } from './Replacement';
export declare class Intermediate<ContextClass = unknown> {

@@ -13,3 +13,3 @@ readonly value: string;

absorb(other: Intermediate<ContextClass>): this;
replacements(): IterableIterator<Replacement<ContextClass>>;
chain(): IterableIterator<Intermediate<ContextClass>>;
}

@@ -27,3 +27,3 @@ "use strict";

absorb(other) {
if (this.value !== other.value) {
if (this.equals(other)) {
throw new Error(`Cannot merge different intermediates: ${this.value} and ${other.value}`);

@@ -40,9 +40,7 @@ }

}
*replacements() {
*chain() {
// eslint-disable-next-line @typescript-eslint/no-this-alias
let item = this;
while (item) {
if (item.via) {
yield item.via;
}
yield item;
item = item.parent;

@@ -49,0 +47,0 @@ }

@@ -13,5 +13,6 @@ "use strict";

const intermediatesCache = new IntermediatesCache_1.IntermediatesCache();
let intermediates = values.map((v) => new Intermediate_1.Intermediate(v, record));
let intermediates = values.map((v) => {
return intermediatesCache.resolve(new Intermediate_1.Intermediate(v, record));
});
let nextIntermediates = [];
let applied = false;
let rule;

@@ -22,12 +23,11 @@ let value;

nextIntermediates = [];
applied = false;
for (value of intermediates) {
if (rule.appliesTo(value)) {
rule.apply(value, nextIntermediates);
applied = true;
}
}
if (applied) {
if (nextIntermediates.length > 0) {
intermediates = nextIntermediates;
}
rule.intermediatesCache = null;
}

@@ -34,0 +34,0 @@ return { variants: intermediates };

@@ -29,9 +29,11 @@ "use strict";

: replacerFn(intermediate.value);
let newIntermediate = new Intermediate_1.Intermediate(newValue, intermediate, variant);
if (this.intermediatesCache) {
newIntermediate = this.intermediatesCache.resolve(newIntermediate);
if (newValue !== intermediate.value) {
let newIntermediate = new Intermediate_1.Intermediate(newValue, intermediate, variant);
if (this.intermediatesCache) {
newIntermediate = this.intermediatesCache.resolve(newIntermediate);
}
if (!results.includes(newIntermediate)) {
results.push(newIntermediate);
}
}
if (!results.includes(newIntermediate)) {
results.push(newIntermediate);
}
}

@@ -38,0 +40,0 @@ return results;

{
"name": "@interslavic/odometer",
"version": "1.2.0",
"version": "1.2.1",
"description": "Utilities to flavorize dictionary entries and calculate a smarter distance between languages.",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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