Socket
Socket
Sign inDemoInstall

lcid

Package Overview
Dependencies
1
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.0.1 to 5.0.0

20

index.d.ts

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

import lcidCodes = require('./lcid.json');
// import lcidCodes from './lcid.json'; // TODO: Use `with` here when TypeScript supports it.

@@ -18,2 +18,15 @@ declare const lcid: {

/**
Get a [standard locale identifier](https://en.wikipedia.org/wiki/Locale_(computer_software)) from a [Windows locale identifier (LCID)](https://en.wikipedia.org/wiki/Locale#Specifics_for_Microsoft_platforms).
@example
```
import lcid from 'lcid';
lcid.from(1044);
//=> 'nb_NO'
```
*/
// from(lcidCode: keyof typeof lcidCodes): string;
/**
Get a [Windows locale identifier (LCID)](https://en.wikipedia.org/wiki/Locale#Specifics_for_Microsoft_platforms) from a [standard locale identifier](https://en.wikipedia.org/wiki/Locale_(computer_software)).

@@ -42,5 +55,6 @@

*/
readonly all: typeof lcidCodes;
readonly all: Record<string, number>;
// TODO: readonly all: typeof lcidCodes;
};
export = lcid;
export default lcid;

15

index.js

@@ -1,8 +0,9 @@

'use strict';
const invertKv = require('invert-kv');
const all = require('./lcid.json');
import invertKv from 'invert-kv';
import all from './lcid.json' with {type: 'json'};
const inverted = invertKv(all);
exports.from = lcidCode => {
const lcid = {};
lcid.from = lcidCode => {
if (typeof lcidCode !== 'number') {

@@ -15,3 +16,3 @@ throw new TypeError('Expected a number');

exports.to = localeId => {
lcid.to = localeId => {
if (typeof localeId !== 'string') {

@@ -27,3 +28,3 @@ throw new TypeError('Expected a string');

exports.all = new Proxy(
lcid.all = new Proxy(
inverted,

@@ -39,1 +40,3 @@ {

);
export default lcid;
{
"name": "lcid",
"version": "4.0.1",
"version": "5.0.0",
"description": "Mapping between standard locale identifiers and Windows locale identifiers (LCID)",

@@ -13,2 +13,3 @@ "license": "MIT",

},
"type": "module",
"exports": {

@@ -18,7 +19,9 @@ "types": "./index.d.ts",

},
"sideEffects": false,
"engines": {
"node": ">=14.16"
"node": ">=18.20"
},
"scripts": {
"test": "xo && ava && tsd"
"//test": "xo && ava && tsc --noEmit index.d.ts",
"test": "ava && tsc --noEmit index.d.ts"
},

@@ -28,4 +31,3 @@ "files": [

"index.d.ts",
"lcid.json",
"lcid.json.d.ts"
"lcid.json"
],

@@ -50,15 +52,9 @@ "keywords": [

"dependencies": {
"invert-kv": "^3.0.0"
"invert-kv": "^4.2.0"
},
"devDependencies": {
"ava": "^1.4.1",
"tsd": "^0.7.2",
"xo": "^0.24.0"
},
"xo": {
"rules": {
"import/extensions": "off",
"import/no-unresolved": "off"
}
"ava": "^6.1.2",
"tsd": "^0.31.0",
"xo": "^0.58.0"
}
}

@@ -10,3 +10,3 @@ # lcid

```sh
$ npm install lcid
npm install lcid
```

@@ -13,0 +13,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