@lingo.dev/_spec 0.41.1 → 0.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.cjs CHANGED
@@ -1,5 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/locales.ts
2
2
  var _zod = require('zod'); var _zod2 = _interopRequireDefault(_zod);
3
+ var __locales = require('@lingo.dev/_locales');
3
4
  var localeMap = {
4
5
  // Urdu (Pakistan)
5
6
  ur: ["ur-PK"],
@@ -299,7 +300,10 @@ var localeCodes = [
299
300
  ...localeCodesFullExplicitRegion
300
301
  ];
301
302
  var localeCodeSchema = _zod2.default.string().refine(
302
- (value) => localeCodes.includes(value),
303
+ (value) => {
304
+ const normalized = normalizeLocale(value);
305
+ return __locales.isValidLocale.call(void 0, normalized);
306
+ },
303
307
  {
304
308
  message: "Invalid locale code"
305
309
  }
package/build/index.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  // src/locales.ts
2
2
  import Z from "zod";
3
+ import { isValidLocale } from "@lingo.dev/_locales";
3
4
  var localeMap = {
4
5
  // Urdu (Pakistan)
5
6
  ur: ["ur-PK"],
@@ -299,7 +300,10 @@ var localeCodes = [
299
300
  ...localeCodesFullExplicitRegion
300
301
  ];
301
302
  var localeCodeSchema = Z.string().refine(
302
- (value) => localeCodes.includes(value),
303
+ (value) => {
304
+ const normalized = normalizeLocale(value);
305
+ return isValidLocale(normalized);
306
+ },
303
307
  {
304
308
  message: "Invalid locale code"
305
309
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingo.dev/_spec",
3
- "version": "0.41.1",
3
+ "version": "0.43.0",
4
4
  "description": "Lingo.dev open specification",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -19,7 +19,8 @@
19
19
  "license": "Apache-2.0",
20
20
  "dependencies": {
21
21
  "zod": "^3.25.76",
22
- "zod-to-json-schema": "^3.24.5"
22
+ "zod-to-json-schema": "^3.24.5",
23
+ "@lingo.dev/_locales": "0.1.0"
23
24
  },
24
25
  "devDependencies": {
25
26
  "@types/node": "^22.13.5",