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

vscode-nls

Package Overview
Dependencies
Maintainers
9
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vscode-nls - npm Package Compare versions

Comparing version 3.2.5 to 4.0.0

4

lib/main.d.ts

@@ -16,4 +16,4 @@ export declare enum MessageFormat {

export interface LocalizeFunc {
(info: LocalizeInfo, message: string, ...args: any[]): string;
(key: string, message: string, ...args: any[]): string;
(info: LocalizeInfo, message: string, ...args: (string | number | boolean | undefined | null)[]): string;
(key: string, message: string, ...args: (string | number | boolean | undefined | null)[]): string;
}

@@ -20,0 +20,0 @@ export interface LoadFunc {

@@ -22,2 +22,5 @@ /* --------------------------------------------------------------------------------------------

}
function readJsonFileSync(filename) {
return JSON.parse(fs.readFileSync(filename, 'utf8'));
}
var MessageFormat;

@@ -61,3 +64,3 @@ (function (MessageFormat) {

try {
options.translationsConfig = require(options.translationsConfigFile);
options.translationsConfig = readJsonFileSync(options.translationsConfigFile);
}

@@ -99,3 +102,11 @@ catch (error) {

var index = rest[0];
return typeof args[index] !== 'undefined' ? args[index] : match;
var arg = args[index];
var replaced = match;
if (typeof arg === 'string') {
replaced = arg;
}
else if (typeof arg === 'number' || typeof arg === 'boolean' || arg === void 0 || arg === null) {
replaced = String(arg);
}
return replaced;
});

@@ -218,3 +229,3 @@ }

function createDefaultNlsBundle(folder) {
var metaData = require(path.join(folder, 'nls.metadata.json'));
var metaData = readJsonFileSync(path.join(folder, 'nls.metadata.json'));
var result = Object.create(null);

@@ -232,4 +243,4 @@ for (var module_1 in metaData) {

}
var languagePack = require(languagePackLocation).contents;
var metaData = require(path.join(metaDataPath, 'nls.metadata.json'));
var languagePack = readJsonFileSync(languagePackLocation).contents;
var metaData = readJsonFileSync(path.join(metaDataPath, 'nls.metadata.json'));
var result = Object.create(null);

@@ -343,3 +354,3 @@ for (var module_2 in metaData) {

try {
return require(candidate);
return readJsonFileSync(candidate);
}

@@ -422,3 +433,3 @@ catch (err) {

try {
var json = require(resolveLanguage(file));
var json = readJsonFileSync(resolveLanguage(file));
if (Array.isArray(json)) {

@@ -425,0 +436,0 @@ return createScopedLocalizeFunction(json);

{
"name": "vscode-nls",
"version": "3.2.5",
"version": "4.0.0",
"description": "NPM module to externalize and localize VSCode extensions",

@@ -5,0 +5,0 @@ "author": "Microsoft Corporation",

@@ -41,2 +41,7 @@ # vscode-nls

### 4.0.0
* make vscode-nls webpack friendly (removal of require calls)
* narrow type for var args in `localize` function to `string | number | boolean | null | undefined`
### 3.0.0:

@@ -43,0 +48,0 @@

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