Skip to content

Commit efcc128

Browse files
committed
Added section for Polyfills in the README
1 parent 0026bc0 commit efcc128

File tree

4 files changed

+51
-4
lines changed

4 files changed

+51
-4
lines changed

README.md

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@
55
The motivation for creating this utility was to provide a mechanism to organize elements,
66
with the ability to specify multiple ordering criteria.
77

8+
## Content
9+
10+
1. [Getting started](#getting-started)
11+
1. [Including the library](#including-the-library)
12+
1. [Examples](#examples)
13+
1. [Shimming-polyfills](#shimming-polyfills)
14+
1. [Running the project](#running-the-project)
15+
816
## Getting started
917

1018
To include this library into your package manager with `npm` or `yarn`
@@ -203,6 +211,42 @@ sortBy(arr, (o) => [o.name.toUpperCase(), -o.age, o.a]);
203211
*/
204212
```
205213

214+
## Shimming-polyfills
215+
216+
This library is written using some of the new ES5/ES6 features. If you have
217+
to support Non-standard-compliant browsers like Internet Explorer, you can
218+
polyfill some of the missing features with the following alternatives:
219+
220+
**Using [es6-shim](https://github.com/paulmillr/es6-shim)**
221+
222+
```html
223+
<!-- put this script FIRST, before all other scripts -->
224+
<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.35.3/es6-shim.min.js"></script>
225+
```
226+
227+
**Using [polyfill.io](https://polyfill.io/v2/docs/)**
228+
229+
```html
230+
<!-- put this script FIRST, before all other scripts -->
231+
<script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script>
232+
```
233+
234+
[Polyfill.io](https://polyfill.io/v2/docs/examples) reads the `User-Agent`
235+
header of each request and returns the polyfills that are suitable for the
236+
requesting browser.
237+
238+
If you want to request specific polyfills, you can pass a query parameter
239+
to the url, for example:
240+
241+
```html
242+
<!--[if IE]>
243+
<script src="https://polyfill.io/v2/polyfill.min.js?features=default-3.3&flags=always"></script>
244+
<![endif]-->
245+
```
246+
247+
Read the list of available features:
248+
[Features and Browsers Supported](https://polyfill.io/v2/docs/features/).
249+
206250
## Running the project
207251

208252
If you want to fork or build your own, you must run this project.
@@ -272,7 +316,7 @@ Given a version number MAJOR.MINOR.PATCH, increment the:
272316

273317
To report an issue and keep traceability of bug-fixes, please report to:
274318

275-
* https://github.com/jherax/array-sort-by/issues
319+
- https://github.com/jherax/array-sort-by/issues
276320

277321
## License
278322

dist/sort-by.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! [email protected].3. Jherax 2017. Visit https://github.com/jherax/array-sort-by */
1+
/*! [email protected].3a. 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();
@@ -100,6 +100,9 @@ return /******/ (function(modules) { // webpackBootstrap
100100
*/
101101
function comparer(prev, next) {
102102
var asc = 1;
103+
// TODO: Add support for accented characters
104+
// See http://ow.ly/UvDD309zozK
105+
// e.g. return a.localeCompare(b);
103106
if (prev === next) return 0;
104107
if (isDesc(prev)) asc = -1;
105108
return (prev > next ? 1 : -1) * asc;

dist/sort-by.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)