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

@logto/language-kit

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@logto/language-kit - npm Package Compare versions

Comparing version 1.0.0-rc.0 to 1.0.0

4

lib/const.d.ts

@@ -54,3 +54,3 @@ export declare const languages: Readonly<{

it: "Italiano";
'it-IT': "italiano (Italia)";
'it-IT': "Italiano (Italia)";
'iu-CA': "Inuktitut";

@@ -91,3 +91,3 @@ ja: "日本語";

'pt-BR': "Português (Brasil)";
'pt-PT': "português (Portugal)";
'pt-PT': "Português (Portugal)";
'ro-RO': "Română";

@@ -94,0 +94,0 @@ ru: "Русский";

@@ -54,3 +54,3 @@ export const languages = Object.freeze({

it: 'Italiano',
'it-IT': 'italiano (Italia)',
'it-IT': 'Italiano (Italia)',
'iu-CA': 'Inuktitut',

@@ -91,3 +91,3 @@ ja: '日本語',

'pt-BR': 'Português (Brasil)',
'pt-PT': 'português (Portugal)',
'pt-PT': 'Português (Portugal)',
'ro-RO': 'Română',

@@ -94,0 +94,0 @@ ru: 'Русский',

@@ -5,1 +5,12 @@ import { z } from 'zod';

export declare const languageTagGuard: z.ZodType<LanguageTag>;
/**
* https://github.com/colinhacks/zod/issues/316#issuecomment-850906479
* Create a schema matches anything and returns a value. Use it with `or`:
*
* const schema = zod.number();
* const tolerant = schema.or(fallback(-1));
*
* schema.parse('foo') // => ZodError
* tolerant.parse('foo') // -1
*/
export declare function fallback<T>(value: T): z.ZodEffects<z.ZodAny, T, any>;

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

import { z } from 'zod';
import { z, any } from 'zod';
import { languages } from './const.js';

@@ -7,1 +7,14 @@ export const isLanguageTag = (value) => typeof value === 'string' && value in languages;

.refine((value) => isLanguageTag(value));
/**
* https://github.com/colinhacks/zod/issues/316#issuecomment-850906479
* Create a schema matches anything and returns a value. Use it with `or`:
*
* const schema = zod.number();
* const tolerant = schema.or(fallback(-1));
*
* schema.parse('foo') // => ZodError
* tolerant.parse('foo') // -1
*/
export function fallback(value) {
return any().transform(() => value);
}
{
"name": "@logto/language-kit",
"version": "1.0.0-rc.0",
"version": "1.0.0",
"author": "Silverhand Inc. <contact@silverhand.io>",

@@ -30,10 +30,10 @@ "homepage": "https://github.com/logto-io/toolkit#readme",

"@jest/types": "^29.0.3",
"@silverhand/eslint-config": "1.3.0",
"@silverhand/ts-config": "1.2.1",
"@types/jest": "^29.0.3",
"@silverhand/eslint-config": "2.0.1",
"@silverhand/ts-config": "2.0.3",
"@types/jest": "^29.4.0",
"@types/node": "^18.11.18",
"eslint": "^8.21.0",
"jest": "^29.0.3",
"eslint": "^8.34.0",
"jest": "^29.5.0",
"lint-staged": "^13.0.0",
"prettier": "^2.8.1",
"prettier": "^2.8.2",
"tslib": "^2.4.1",

@@ -40,0 +40,0 @@ "typescript": "^4.9.4"

Sorry, the diff of this file is not supported yet

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