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

arabic-franco

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arabic-franco - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

dist/francoList.d.ts

5

dist/example.js

@@ -6,3 +6,4 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
const arabic_franco_1 = __importDefault(require("arabic-franco"));
console.log((0, arabic_franco_1.default)('محمد'));
// import toFranco from 'arabic-franco';
const index_1 = __importDefault(require("./index"));
console.log((0, index_1.default)('سارة')); // sara

4

dist/index.d.ts

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

declare function toEnName(str: string): string;
export default toEnName;
declare function toFranco(inputStr: string): string;
export default toFranco;

@@ -6,12 +6,7 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
const translate_1 = __importDefault(require("./translate"));
function toEnName(str) {
let finalName = '';
let array = str.split(' ');
for (let index in array) {
let enName = (0, translate_1.default)(array[index]);
finalName += enName + ' ';
}
return finalName;
const francoList_1 = __importDefault(require("./francoList"));
function toFranco(inputStr) {
const convertedString = inputStr.split('').map(char => francoList_1.default[char] || char).join('');
return convertedString;
}
exports.default = toEnName;
exports.default = toFranco;
{
"name": "arabic-franco",
"version": "1.0.3",
"version": "1.0.4",
"description": "📦 package to convert Romanized/franco the arabic names to english ones",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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

# Arabic Name Converter 👳‍♂️
# Arabic Franco 👳‍♂️
![alt text](https://i.ibb.co/ByDkG4P/Kapture-2019-09-09-at-12-10-26.gif)
convert Arabic words/letters to Franco/English ones. (Franco)

@@ -10,30 +10,11 @@ ## How to install 🧐

```
---
## How to use 👨‍💻
The package exports a simple function that you can pass a string of a name of more than one name in one line and it will return the name in EN
<br />
_سارة => Sarah_
## Example Usage
```js
import toEnName from 'arabic-franco';
import toFranco from 'arabic-franco';
console.log(toEnName('سارة')); // Sarah
console.log(toFranco('سارة')); // sara
```
---
## Explanation 🤓
There is no clear Romanization rule to change the Ar name to En one, so this package is me trying to find common cases to convert the names.
<br />
This package is still in the early stage, so please open issues, if there is anything. Also, you may enhance it by depending on DB and making the package script for not-found names.
Here is a [sheet](https://docs.google.com/spreadsheets/d/1quclpaw1QH9jR4FHP1zKjEn4frQ_A1wI8TDNMv9z7Gw/edit?usp=sharing) of names for you to check. it has +2500 random Arabic names.
Please open an issue and write the names that you are not happy about so I can fix it
## Support

@@ -40,0 +21,0 @@ #### This package costs me time to make and maintain every time.

@@ -1,3 +0,3 @@

import toEnName from 'arabic-franco';
import toFranco from 'arabic-franco';
console.log(toEnName('محمد'));
console.log(toFranco('سارة')); // sara

@@ -1,13 +0,9 @@

import trans from './translate';
import arabicToFrancoMap from './francoList';
function toEnName(str: string) {
let finalName = '';
let array = str.split(' ');
for (let index in array) {
let enName = trans(array[index]);
finalName += enName + ' ';
}
return finalName;
function toFranco(inputStr: string) {
const convertedString = inputStr.split('').map(char => arabicToFrancoMap[char] || char).join('');
return convertedString;
}
export default toEnName;
export default toFranco;
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