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

atonic

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

atonic - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

2

lib/maps.js

@@ -101,3 +101,3 @@ /*eslint quotes:0*/

'm': "\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F",
'n': "\u24DD\uFF4E\u01F9\u0144\xF1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5\u043B\u0509",
'n': "\u24DD\uFF4E\u01F9\u0144\xF1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5\u0509",
'nj': "\u01CC",

@@ -104,0 +104,0 @@ 'o': "\u24DE\uFF4F\xF2\xF3\xF4\u1ED3\u1ED1\u1ED7\u1ED5\xF5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\xF6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\xF8\u01FF\uA74B\uA74D\u0275\u0254\u1D11",

{
"name": "atonic",
"version": "1.0.3",
"version": "1.0.4",
"description": "remove diacritics from strings",

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

'use strict';
var atonic = require('../lib');
var maps = require('../lib/maps');
var assert = require('chai').assert;
describe('default', function() {
it('atonic("") - all maps', function() {
assert.equal('A,a,A,a,O,oУу У у Ч ч Г г Ы ы Г г Х х Х хЕ Е Ђ Г Є Ѕ І І Ј Љ Њ Ћ К И У Џ', atonic('Å,å,Ä,ä,Ö,öӰӱ Ӳ ӳ Ӵ ӵ Ӷ ӷ Ӹ ӹ Ӻ ӻ Ӽ ӽ Ӿ ӿЀ Ё Ђ Ѓ Є Ѕ І Ї Ј Љ Њ Ћ Ќ Ѝ Ў Џ'));
assert.equal('Internationalizati0n', atonic('Iлtèrnåtïonɑlíƶatï߀ԉ'));
assert.equal('AAAAAAAECEEEEIIII-Internationaliza-ЧчГгЫыГгХхХхЕ', atonic('ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ-Iлtèrnåtïonɑlíƶa-ӴӵӶӷӸӹӺӻӼӽӾӿЀ'));
assert.equal('Приморскии краи', atonic('Примо́рский край'));
//assert.equal('AAAAAAAECEEEEIIII-Internationaliza-ЧчГгЫыГгХхХхЕ', atonic('℀ ℁ ℂ ℃ ℄ ℅ ℆ ℇ ℈ ℉ ℊ ℋ ℌ ℍ ℎ ℏⅈ'));
});
it('atonic.lowerCase("")', function() {
assert.equal('Å,a,Ä,a,Ö,oӰу Ӳ у Ӵ ч Ӷ г', atonic.lowerCase('Å,å,Ä,ä,Ö,öӰӱ Ӳ ӳ Ӵ ӵ Ӷ ӷ'));
assert.equal('ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ-Internationaliza-ӴчӶгӸыӺгӼхӾхЀ', atonic.lowerCase('ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ-Iлtèrnåtïonɑlíƶa-ӴӵӶӷӸӹӺӻӼӽӾӿЀ'));
});
it('atonic.upperCase("")', function() {
assert.equal('A,å,A,ä,O,öУӱ У ӳ Ч ӵ Г ӷ', atonic.upperCase('Å,å,Ä,ä,Ö,öӰӱ Ӳ ӳ Ӵ ӵ Ӷ ӷ'));
assert.equal('AAAAAAAECEEEEIIII-Iлtèrnåtïonɑlíƶa-ЧӵГӷЫӹГӻХӽХӿЕ', atonic.upperCase('ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ-Iлtèrnåtïonɑlíƶa-ӴӵӶӷӸӹӺӻӼӽӾӿЀ'));
});
it('atonic.latin("")', function() {
assert.equal('Internationalizati0n', atonic.latin('Iлtèrnåtïonɑlíƶatï߀ԉ'));
assert.equal('AAAAAAAECEEEEIIII-Internationaliza', atonic.latin('ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ-Iлtèrnåtïonɑlíƶa'));
assert.equal('AAAAAAAECEEEEIIII-Internationaliza-ӴӵӶӷӸӹӺӻӼӽӾӿЀ', atonic.latin('ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ-Iлtèrnåtïonɑlíƶa-ӴӵӶӷӸӹӺӻӼӽӾӿЀ'));
});
it('atonic.latinUpperCase("")', function() {
assert.equal('AAAAAAAECEEEEIIII', atonic.latin('ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ'));
});
it('atonic.cyrillic("")', function() {
assert.equal('ЕЕГГгҔҕЖжЗзкКк', atonic.cyrillic('ЀЁЃҒғҔҕҖҗҘҙҝҞҟ'));
assert.equal('ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ-Iлtèrnåtïonɑlíƶa-ЧчГгЫыГгХхХхЕ', atonic.cyrillic('ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ-Iлtèrnåtïonɑlíƶa-ӴӵӶӷӸӹӺӻӼӽӾӿЀ'));
});
it('atonic("") - all maps', function() {
assert.equal('A,a,A,a,O,oУу У у Ч ч Г г Ы ы Г г Х х Х хЕ Е Ђ Г Є Ѕ І І Ј Љ Њ Ћ К И У Џ', atonic('Å,å,Ä,ä,Ö,öӰӱ Ӳ ӳ Ӵ ӵ Ӷ ӷ Ӹ ӹ Ӻ ӻ Ӽ ӽ Ӿ ӿЀ Ё Ђ Ѓ Є Ѕ І Ї Ј Љ Њ Ћ Ќ Ѝ Ў Џ'));
assert.equal('Internationalizati0n', atonic('Intèrnåtïonɑlíƶatï߀ԉ'));
assert.equal('AAAAAAAECEEEEIIII-Internationaliza-ЧчГгЫыГгХхХхЕ', atonic('ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ-Intèrnåtïonɑlíƶa-ӴӵӶӷӸӹӺӻӼӽӾӿЀ'));
assert.equal('Приморскии краи', atonic('Примо́рский край'));
//assert.equal('AAAAAAAECEEEEIIII-Internationaliza-ЧчГгЫыГгХхХхЕ', atonic('℀ ℁ ℂ ℃ ℄ ℅ ℆ ℇ ℈ ℉ ℊ ℋ ℌ ℍ ℎ ℏⅈ'));
});
it('atonic.lowerCase("")', function() {
assert.equal('Å,a,Ä,a,Ö,oӰу Ӳ у Ӵ ч Ӷ г', atonic.lowerCase('Å,å,Ä,ä,Ö,öӰӱ Ӳ ӳ Ӵ ӵ Ӷ ӷ'));
assert.equal('ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ-Internationaliza-ӴчӶгӸыӺгӼхӾхЀ', atonic.lowerCase('ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ-Intèrnåtïonɑlíƶa-ӴӵӶӷӸӹӺӻӼӽӾӿЀ'));
});
it('atonic.upperCase("")', function() {
assert.equal('A,å,A,ä,O,öУӱ У ӳ Ч ӵ Г ӷ', atonic.upperCase('Å,å,Ä,ä,Ö,öӰӱ Ӳ ӳ Ӵ ӵ Ӷ ӷ'));
assert.equal('AAAAAAAECEEEEIIII-Intèrnåtïonɑlíƶa-ЧӵГӷЫӹГӻХӽХӿЕ', atonic.upperCase('ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ-Intèrnåtïonɑlíƶa-ӴӵӶӷӸӹӺӻӼӽӾӿЀ'));
});
it('atonic.latin("")', function() {
assert.equal('Internationalizati0n', atonic.latin('Intèrnåtïonɑlíƶatï߀ԉ'));
assert.equal('AAAAAAAECEEEEIIII-Internationaliza', atonic.latin('ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ-Intèrnåtïonɑlíƶa'));
assert.equal('AAAAAAAECEEEEIIII-Internationaliza-ӴӵӶӷӸӹӺӻӼӽӾӿЀ', atonic.latin('ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ-Intèrnåtïonɑlíƶa-ӴӵӶӷӸӹӺӻӼӽӾӿЀ'));
});
it('atonic.latinUpperCase("")', function() {
assert.equal('AAAAAAAECEEEEIIII', atonic.latin('ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ'));
});
it('atonic.cyrillic("")', function() {
assert.equal('ЕЕГГгҔҕЖжЗзкКк', atonic.cyrillic('ЀЁЃҒғҔҕҖҗҘҙҝҞҟ'));
assert.equal('ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ-Intèrnåtïonɑlíƶa-ЧчГгЫыГгХхХхЕ', atonic.cyrillic('ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ-Intèrnåtïonɑlíƶa-ӴӵӶӷӸӹӺӻӼӽӾӿЀ'));
});
});
describe('maps', function() {
it('Latin', function() {
var names = ['LATIN', 'latin'];
names.forEach(function(name) {
var map = maps[name];
for (var key in map) {
var codes = map[key];
for (var j = 0; j < codes.length; j++) {
var code = codes[j];
var cd = code.charCodeAt(0);
if (0x0400 <= cd && cd <= 0x04FF) {
throw new Error('Cirilyc char in Latin: ' + code);
}
}
}
});
});
});
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