Skip to content

Commit

Permalink
f181926d2ebcb27e3b8004964235d37891778950 Fix: Safari 9 doesn't suppor…
Browse files Browse the repository at this point in the history
…t `String.prototype.normalize`

Sync to source repo @f181926d2ebcb27e3b8004964235d37891778950
  • Loading branch information
dtbuild committed Sep 16, 2024
1 parent b13c376 commit 1cb130d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion datatables.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
],
"src-repo": "http://github.com/DataTables/DataTablesSrc",
"last-tag": "2.1.6",
"last-sync": "a5ef81cfb42bc16cc1eb504a704e49bf51b3ac50"
"last-sync": "f181926d2ebcb27e3b8004964235d37891778950"
}
7 changes: 5 additions & 2 deletions js/dataTables.js
Original file line number Diff line number Diff line change
Expand Up @@ -1318,8 +1318,11 @@
}

// It is faster to just run `normalize` than it is to check if
// we need to with a regex!
var res = str.normalize("NFD");
// we need to with a regex! (Check as it isn't available in old
// Safari)
var res = str.normalize
? str.normalize("NFD")
: str;

// Equally, here we check if a regex is needed or not
return res.length !== str.length
Expand Down
2 changes: 1 addition & 1 deletion js/dataTables.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/dataTables.min.mjs

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions js/dataTables.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1265,8 +1265,11 @@ var _normalize = function (str, both) {
}

// It is faster to just run `normalize` than it is to check if
// we need to with a regex!
var res = str.normalize("NFD");
// we need to with a regex! (Check as it isn't available in old
// Safari)
var res = str.normalize
? str.normalize("NFD")
: str;

// Equally, here we check if a regex is needed or not
return res.length !== str.length
Expand Down

0 comments on commit 1cb130d

Please sign in to comment.