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

limax

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

limax - npm Package Compare versions

Comparing version 2.1.0 to 3.0.0

9

lib/limax.js
'use strict';
const speakingurl = require('speakingurl');
const pinyin = require('pinyin');
const hepburn = require('hepburn');
let pinyin, PINYIN_STYLE;
try {
({ pinyin, PINYIN_STYLE } = require('@napi-rs/pinyin'));
} catch (err) {}

@@ -37,3 +40,3 @@ function customCharsAsArray (custom) {

text = text.replace(/([^A-Za-z0-9\- ]+)/g, '');
} else if (lang.toLowerCase().startsWith('zh') || /[\u4e00-\u9fa5]+/.test(text)) {
} else if (pinyin && (lang.toLowerCase().startsWith('zh') || /[\u4e00-\u9fa5]+/.test(text))) {
// Should we use tone numbers? (default is true)

@@ -43,3 +46,3 @@ const tone = (typeof options.tone === 'boolean') ? options.tone : true;

text = pinyin(text, {
style: tone ? pinyin.STYLE_TONE2 : pinyin.STYLE_NORMAL
style: tone ? PINYIN_STYLE.WithToneNumEnd : PINYIN_STYLE.Plain
}).join(' ');

@@ -46,0 +49,0 @@ // Remove punctuation symbols

{
"name": "limax",
"version": "2.1.0",
"version": "3.0.0",
"main": "./lib/limax",

@@ -12,3 +12,3 @@ "types": "index.d.ts",

"engines": {
"node": ">=8"
"node": ">=10"
},

@@ -44,11 +44,11 @@ "scripts": {

"dependencies": {
"hepburn": "^1.1.3",
"pinyin": "^2.9.1",
"@napi-rs/pinyin": "^1.5.0",
"hepburn": "^1.2.0",
"speakingurl": "^14.0.1"
},
"devDependencies": {
"ava": "^2.4.0",
"ava": "^3.15.0",
"nyc": "^15.1.0",
"semistandard": "^14.2.2"
"semistandard": "^16.0.0"
}
}

@@ -95,3 +95,3 @@ # limax

## Test [![Build Status](https://travis-ci.org/lovell/limax.png?branch=master)](https://travis-ci.org/lovell/limax)
## Test ![.github/workflows/ci.yml](https://github.com/lovell/limax/workflows/.github/workflows/ci.yml/badge.svg)

@@ -98,0 +98,0 @@ Run the unit tests with:

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