Socket
Socket
Sign inDemoInstall

@nanostores/i18n

Package Overview
Dependencies
1
Maintainers
3
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.0 to 0.1.1

2

browser/index.d.ts
import { ReadableAtom } from 'nanostores'
type A = Extract<'fr' | 'ru', 'en'>
type AutodetectOpts<Locales extends readonly string[]> = Extract<

@@ -6,0 +4,0 @@ Locales[number],

11

create-i18n/index.js

@@ -19,10 +19,17 @@ import { atom, onMount } from 'nanostores'

define.cache[baseLocale][componentName] = baseTranslation
let t = atom(baseTranslation)
if (process.env.NODE_ENV !== 'production') {
t.component = componentName
t.base = base
if (define.cache[baseLocale][componentName]) {
throw new Error(
`I18n component ${componentName} was defined multiple times. ` +
'It could lead to cache issues. Try to move i18n definition from ' +
'component’s render function.'
)
}
}
define.cache[baseLocale][componentName] = baseTranslation
onMount(t, () => {

@@ -29,0 +36,0 @@ let waiting = false

{
"name": "@nanostores/i18n",
"version": "0.1.0",
"version": "0.1.1",
"description": "A tiny (<500 bytes) i18n library for React/Preact/Vue/Svelte",

@@ -5,0 +5,0 @@ "keywords": [

@@ -22,3 +22,3 @@ # Nano Stores I18n

import { params, count } from '@nanostores/i18n' // You can use own functions
import { useStore } from 'nanostores'
import { useStore } from '@nanostores/react'
import { i18n, format } from '../stores/i18n.js'

@@ -76,3 +76,4 @@

}
}
},
// Translations for all other components
}

@@ -79,0 +80,0 @@ ```

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc