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

@sindresorhus/transliterate

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sindresorhus/transliterate - npm Package Compare versions

Comparing version 0.1.2 to 1.0.0

47

index.d.ts

@@ -1,26 +0,24 @@

declare namespace transliterate {
interface Options {
/**
Add your own custom replacements.
export interface Options {
/**
Add your own custom replacements.
The replacements are run on the original string before any other transformations.
The replacements are run on the original string before any other transformations.
This only overrides a default replacement if you set an item with the same key.
This only overrides a default replacement if you set an item with the same key.
@default []
@default []
@example
```
import transliterate = require('@sindresorhus/transliterate');
@example
```
import transliterate from '@sindresorhus/transliterate';
transliterate('Я люблю единорогов', {
customReplacements: [
['единорогов', '🦄']
]
})
//=> 'Ya lyublyu 🦄'
```
*/
readonly customReplacements?: ReadonlyArray<[string, string]>;
}
transliterate('Я люблю единорогов', {
customReplacements: [
['единорогов', '🦄']
]
})
//=> 'Ya lyublyu 🦄'
```
*/
readonly customReplacements?: ReadonlyArray<[string, string]>;
}

@@ -35,3 +33,3 @@

```
import transliterate = require('@sindresorhus/transliterate');
import transliterate from '@sindresorhus/transliterate';

@@ -51,7 +49,2 @@ transliterate('Fußgängerübergänge');

*/
declare function transliterate(
string: string,
options?: transliterate.Options
): string;
export = transliterate;
export default function transliterate(string: string, options?: Options): string;

@@ -1,5 +0,4 @@

'use strict';
const deburr = require('lodash.deburr');
const escapeStringRegexp = require('escape-string-regexp');
const builtinReplacements = require('./replacements');
import deburr from 'lodash.deburr';
import escapeStringRegexp from 'escape-string-regexp';
import builtinReplacements from './replacements.js';

@@ -15,3 +14,3 @@ const doCustomReplacements = (string, replacements) => {

module.exports = (string, options) => {
export default function transliterate(string, options) {
if (typeof string !== 'string') {

@@ -36,2 +35,2 @@ throw new TypeError(`Expected a string, got \`${typeof string}\``);

return string;
};
}
{
"name": "@sindresorhus/transliterate",
"version": "0.1.2",
"version": "1.0.0",
"description": "Convert Unicode characters to Latin characters using transliteration",

@@ -13,4 +13,6 @@ "license": "MIT",

},
"type": "module",
"exports": "./index.js",
"engines": {
"node": ">=10"
"node": ">=12"
},

@@ -39,10 +41,10 @@ "scripts": {

"dependencies": {
"escape-string-regexp": "^2.0.0",
"escape-string-regexp": "^5.0.0",
"lodash.deburr": "^4.1.0"
},
"devDependencies": {
"ava": "^2.4.0",
"tsd": "^0.11.0",
"xo": "^0.26.1"
"ava": "^3.15.0",
"tsd": "^0.14.0",
"xo": "^0.38.2"
}
}

@@ -16,3 +16,3 @@ # transliterate

```js
const transliterate = require('@sindresorhus/transliterate');
import transliterate from '@sindresorhus/transliterate';

@@ -58,3 +58,3 @@ transliterate('Fußgängerübergänge');

```js
const transliterate = require('@sindresorhus/transliterate');
import transliterate from '@sindresorhus/transliterate';

@@ -61,0 +61,0 @@ transliterate('Я люблю единорогов', {

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

'use strict';
module.exports = [
const replacements = [
// German umlauts

@@ -798,1 +796,3 @@ ['ß', 'ss'],

];
export default replacements;
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