Skip to content

Commit

Permalink
Accented characters are translated to unicode values
Browse files Browse the repository at this point in the history
  • Loading branch information
jherax committed Jun 24, 2017
1 parent a74d5ad commit 87d1f1f
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 15 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ parser(item: Any) : Any
<script src="https://unpkg.com/array-sort-by/dist/sort-by.min.js"></script>

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

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

See an example with RequireJS here: http://jsfiddle.net/FdKTn/73/
See an example with RequireJS here: http://jsfiddle.net/FdKTn/75/

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

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

```javascript
let arr = [
{ a: 4, age: 26, name: "pedro" },
{ a: 6, age: 32, name: "Pedro" },
{ a: 9, age: 26, name: "pedro" },
{ a: 6, age: 21, name: "Pedro" },
{ a: 7, age: 26, name: "Maria" },
{ a: 2, age: 26, name: "maría" }
];
Expand All @@ -258,8 +258,8 @@ sortBy(arr, item => [item.name, -item.age, item.a]);
* [
* { a: 2, age: 26, name: "maría" },
* { a: 7, age: 26, name: "Maria" },
* { a: 6, age: 32, name: "Pedro" },
* { a: 4, age: 26, name: "pedro" }
* { a: 9, age: 26, name: "pedro" },
* { a: 6, age: 21, name: "Pedro" }
* ]
*/
```
Expand Down
22 changes: 20 additions & 2 deletions dist/sort-by.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! [email protected].0. Jherax 2017. Visit https://github.com/jherax/array-sort-by */
/*! [email protected].2. Jherax 2017. Visit https://github.com/jherax/array-sort-by */
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
Expand Down Expand Up @@ -85,7 +85,25 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = ignoreAccent;
var accent = 'ÂâÀàÁáÄäÃãÅåÊêÈèÉéËëÎîÌìÍíÏïÔôÒòÓóÖöÕõÛûÙùÚúÜüÑñÝýÿ';
/*
function generateUnicode() {
const charcodes = [];
const chars = 'ÂâÀàÁáÄäÃãÅåÊêÈèÉéËëÎîÌìÍíÏïÔôÒòÓóÖöÕõÛûÙùÚúÜüÑñÝýÿ';
for (let i = 0; i < chars.length; i += 1) {
charcodes.push(chars.charCodeAt(i));
}
return charcodes;
}
*/

// Unicode values
var accent = String.fromCharCode(194, 226, 192, 224, 193, 225, 196, 228, 195, 227, 197, 229, // ÂâÀàÁáÄäÃãÅå
202, 234, 200, 232, 201, 233, 203, 235, // ÊêÈèÉéËë
206, 238, 204, 236, 205, 237, 207, 239, // ÎîÌìÍíÏï
212, 244, 210, 242, 211, 243, 214, 246, 213, 245, // ÔôÒòÓóÖöÕõ
219, 251, 217, 249, 218, 250, 220, 252, // ÛûÙùÚúÜü
209, 241, 221, 253, 255); // ÑñÝýÿ

var normal = 'AaAaAaAaAaAaEeEeEeEeIiIiIiIiOoOoOoOoOoUuUuUuUuNnYyy';

/**
Expand Down
4 changes: 2 additions & 2 deletions dist/sort-by.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 87d1f1f

Please sign in to comment.