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

hokey-runtime

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hokey-runtime - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

2

lib/cjs/hokey.d.ts

@@ -18,3 +18,3 @@ import { HokeyAllMessages, HokeyLocaleMessages } from "./util.js";

localeEmoji(locale: string): string | undefined;
stopWords: (ALL_MESSAGES: HokeyAllMessages) => string[];
stopWords: () => string[];
}
import { isUnknownMessage } from "./util.js";
export class Hokey {
constructor(ALL_MESSAGES, FALLBACK_DEFAULT_LANG) {
this.stopWords = (ALL_MESSAGES) => {
this.stopWords = () => {
if (this.STOP_WORDS != null) {

@@ -9,7 +9,7 @@ return this.STOP_WORDS;

const stops = [];
for (const locale of Object.keys(ALL_MESSAGES)) {
if (ALL_MESSAGES[locale] &&
ALL_MESSAGES[locale].search_stop_words &&
!isUnknownMessage(ALL_MESSAGES[locale].search_stop_words)) {
stops.push(...ALL_MESSAGES[locale].search_stop_words.split(","));
for (const locale of Object.keys(this.ALL_MESSAGES)) {
if (this.ALL_MESSAGES[locale] &&
this.ALL_MESSAGES[locale].search_stop_words &&
!isUnknownMessage(this.ALL_MESSAGES[locale].search_stop_words)) {
stops.push(...this.ALL_MESSAGES[locale].search_stop_words.split(","));
}

@@ -64,3 +64,3 @@ }

// console.log(`findFirstLocaleMatch(${JSON.stringify(locales)}) returning DEFAULT_LOCALE [${DEFAULT_LOCALE}]`)
if (defaultLocale)
if (defaultLocale && this.ALL_MESSAGES[defaultLocale])
return defaultLocale;

@@ -73,3 +73,3 @@ if (this.ALL_MESSAGES[this.FALLBACK_DEFAULT_LANG])

}
throw new Error("findFirstLocaleMatch: no languages defined in MESSAGES!");
throw new Error("findFirstLocaleNameMatch: no languages defined!");
}

@@ -76,0 +76,0 @@ findFirstLocaleMatch(locales) {

@@ -18,3 +18,3 @@ import { HokeyAllMessages, HokeyLocaleMessages } from "./util.js";

localeEmoji(locale: string): string | undefined;
stopWords: (ALL_MESSAGES: HokeyAllMessages) => string[];
stopWords: () => string[];
}
import { isUnknownMessage } from "./util.js";
export class Hokey {
constructor(ALL_MESSAGES, FALLBACK_DEFAULT_LANG) {
this.stopWords = (ALL_MESSAGES) => {
this.stopWords = () => {
if (this.STOP_WORDS != null) {

@@ -9,7 +9,7 @@ return this.STOP_WORDS;

const stops = [];
for (const locale of Object.keys(ALL_MESSAGES)) {
if (ALL_MESSAGES[locale] &&
ALL_MESSAGES[locale].search_stop_words &&
!isUnknownMessage(ALL_MESSAGES[locale].search_stop_words)) {
stops.push(...ALL_MESSAGES[locale].search_stop_words.split(","));
for (const locale of Object.keys(this.ALL_MESSAGES)) {
if (this.ALL_MESSAGES[locale] &&
this.ALL_MESSAGES[locale].search_stop_words &&
!isUnknownMessage(this.ALL_MESSAGES[locale].search_stop_words)) {
stops.push(...this.ALL_MESSAGES[locale].search_stop_words.split(","));
}

@@ -64,3 +64,3 @@ }

// console.log(`findFirstLocaleMatch(${JSON.stringify(locales)}) returning DEFAULT_LOCALE [${DEFAULT_LOCALE}]`)
if (defaultLocale)
if (defaultLocale && this.ALL_MESSAGES[defaultLocale])
return defaultLocale;

@@ -73,3 +73,3 @@ if (this.ALL_MESSAGES[this.FALLBACK_DEFAULT_LANG])

}
throw new Error("findFirstLocaleMatch: no languages defined in MESSAGES!");
throw new Error("findFirstLocaleNameMatch: no languages defined!");
}

@@ -76,0 +76,0 @@ findFirstLocaleMatch(locales) {

{
"name": "hokey-runtime",
"version": "1.0.2",
"version": "1.0.3",
"type": "module",

@@ -5,0 +5,0 @@ "description": "runtime library for hokeylization",

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