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

vite-plugin-i18n-helper

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vite-plugin-i18n-helper - npm Package Compare versions

Comparing version 1.0.3-beta.2 to 1.0.3-beta.3

2

dist/index.d.ts

@@ -9,2 +9,4 @@ import type { Plugin } from "vite";

ignoreMark?: string;
ignorePrefix?: RegExp;
ignoreSuffix?: RegExp;
raw?: boolean;

@@ -11,0 +13,0 @@ output?: boolean;

2

package.json
{
"name": "vite-plugin-i18n-helper",
"version": "1.0.3-beta.2",
"version": "1.0.3-beta.3",
"license": "MIT",

@@ -5,0 +5,0 @@ "scripts": {

@@ -46,8 +46,8 @@ # vite-plugin-i18n-helper

const fn = (val) => "(" + val + ")";
const name1 = "一二三";
const name2 = `一二三${name1}`;
const name3 = `${name1}一二三${fn(name1)}`;
const name4 = "1" + "2" + "三";
const name5 = "i18n!:一二三";
const name6 = " 一二三 ";
const name1 = "一二三"; // 普通字符串
const name2 = `一二三${name1}`; // 模板字符串
const name3 = `${`一二三${name1}`}一二三${fn(name1)}`; // 复杂模板字符串
const name4 = "三" + "2" + "一二三"; // 表达式不参与 只针对字符串和模板字符串
const name5 = "i18n!:一二三"; // i18n!: 开头的内容不参与编译
const name6 = " 一二三 "; // 首尾空格不参与编译 可设置ignorePrefix和ignoreSuffix自定义规则
```

@@ -62,4 +62,4 @@ - 无 dictJson 参数时 会 转义所有包含中文的字符

const name2 = i18nHepler("一二三{0}",[name1]);
const name3 = i18nHepler("{0}一二三{1}",[name1,fn(name1)]);
const name4 = "1" + "2" + i18nHepler("三");
const name3 = i18nHepler("{0}一二三{1}",[i18nHepler("一二三{0}",[name1]),fn(name1)]);
const name4 = i18nHepler("三") + "2" + i18nHepler("一二三");
const name5 = "一二三";

@@ -84,6 +84,6 @@ const name6 = ` ${i18nHepler("一二三")} `;

const name2 = i18nHepler("123{0}",[name1],"一二三{0}");
const name3 = i18nHepler("{0}123{1}",[name1,fn(name1)],"{0}一二三{1}");
const name4 = "1" + "2" + "三";
const name3 = i18nHepler("{0}123{1}",[i18nHepler("123{0}",[name1],"一二三{0}"),fn(name1)],"{0}一二三{1}");
const name4 = "三" + "2" + i18nHepler("123",null,"一二三");
const name5 = "一二三";
const name6 = ` ${i18nHepler("123",null,"一二三")} `;
const name6 = ` ${i18nHepler("123",null,"一二三")} `;
```

@@ -101,2 +101,4 @@

| ignoreMark | `string` | i18n!: | 否 | 忽略以该标识开头的内容 |
| ignorePrefix | `RegExp` | `/^\s+/` | 否 | 忽略正则匹配的前缀内容 (默认首尾空格会忽略)|
| ignoreSuffix | `RegExp` | `/\s+$/` | 否 | 忽略正则匹配的后缀内容 (默认首尾空格会忽略) |
| raw | `boolean` | - | 否 | 是否保留 dictJson 匹配前的 原始值 (是 将作为customI18n 第三个参数传入) |

@@ -103,0 +105,0 @@ | output | `boolean` | - | 否 | 是否输出字符串处理的结果 |

Sorry, the diff of this file is not supported yet

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