Skip to content

Commit 87d1f1f

Browse files
committed
Accented characters are translated to unicode values
1 parent a74d5ad commit 87d1f1f

File tree

7 files changed

+52
-15
lines changed

7 files changed

+52
-15
lines changed

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ parser(item: Any) : Any
6464
<script src="https://unpkg.com/array-sort-by/dist/sort-by.min.js"></script>
6565

6666
<!-- or from rawgit.com -->
67-
<script src="https://cdn.rawgit.com/jherax/array-sort-by/1.1.0/dist/sort-by.min.js"></script>
67+
<script src="https://cdn.rawgit.com/jherax/array-sort-by/1.1.2/dist/sort-by.min.js"></script>
6868
```
6969

7070
In the above case, the function [`sortBy`](#examples) is included as
@@ -101,7 +101,7 @@ require(['array-sort-by'], function(sortBy) {
101101
});
102102
```
103103

104-
See an example with RequireJS here: http://jsfiddle.net/FdKTn/73/
104+
See an example with RequireJS here: http://jsfiddle.net/FdKTn/75/
105105

106106
[&#9751; Back to Index](#content)
107107

@@ -245,8 +245,8 @@ sortBy(arr, item => "DESC:" + item.name);
245245

246246
```javascript
247247
let arr = [
248-
{ a: 4, age: 26, name: "pedro" },
249-
{ a: 6, age: 32, name: "Pedro" },
248+
{ a: 9, age: 26, name: "pedro" },
249+
{ a: 6, age: 21, name: "Pedro" },
250250
{ a: 7, age: 26, name: "Maria" },
251251
{ a: 2, age: 26, name: "maría" }
252252
];
@@ -258,8 +258,8 @@ sortBy(arr, item => [item.name, -item.age, item.a]);
258258
* [
259259
* { a: 2, age: 26, name: "maría" },
260260
* { a: 7, age: 26, name: "Maria" },
261-
* { a: 6, age: 32, name: "Pedro" },
262-
* { a: 4, age: 26, name: "pedro" }
261+
* { a: 9, age: 26, name: "pedro" },
262+
* { a: 6, age: 21, name: "Pedro" }
263263
* ]
264264
*/
265265
```

dist/sort-by.js

+20-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! [email protected].0. Jherax 2017. Visit https://github.com/jherax/array-sort-by */
1+
/*! [email protected].2. Jherax 2017. Visit https://github.com/jherax/array-sort-by */
22
(function webpackUniversalModuleDefinition(root, factory) {
33
if(typeof exports === 'object' && typeof module === 'object')
44
module.exports = factory();
@@ -85,7 +85,25 @@ Object.defineProperty(exports, "__esModule", {
8585
value: true
8686
});
8787
exports.default = ignoreAccent;
88-
var accent = 'ÂâÀàÁáÄäÃãÅåÊêÈèÉéËëÎîÌìÍíÏïÔôÒòÓóÖöÕõÛûÙùÚúÜüÑñÝýÿ';
88+
/*
89+
function generateUnicode() {
90+
const charcodes = [];
91+
const chars = 'ÂâÀàÁáÄäÃãÅåÊêÈèÉéËëÎîÌìÍíÏïÔôÒòÓóÖöÕõÛûÙùÚúÜüÑñÝýÿ';
92+
for (let i = 0; i < chars.length; i += 1) {
93+
charcodes.push(chars.charCodeAt(i));
94+
}
95+
return charcodes;
96+
}
97+
*/
98+
99+
// Unicode values
100+
var accent = String.fromCharCode(194, 226, 192, 224, 193, 225, 196, 228, 195, 227, 197, 229, // ÂâÀàÁáÄäÃãÅå
101+
202, 234, 200, 232, 201, 233, 203, 235, // ÊêÈèÉéËë
102+
206, 238, 204, 236, 205, 237, 207, 239, // ÎîÌìÍíÏï
103+
212, 244, 210, 242, 211, 243, 214, 246, 213, 245, // ÔôÒòÓóÖöÕõ
104+
219, 251, 217, 249, 218, 250, 220, 252, // ÛûÙùÚúÜü
105+
209, 241, 221, 253, 255); // ÑñÝýÿ
106+
89107
var normal = 'AaAaAaAaAaAaEeEeEeEeIiIiIiIiOoOoOoOoOoUuUuUuUuNnYyy';
90108

91109
/**

dist/sort-by.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)