Repository URL to install this package:
|
Version:
5.1.0-rc.0 ▾
|
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/import.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="../index.html">All files</a> / <a href="index.html">src</a> import.js
</h1>
<div class='clearfix'>
</div>
</div>
<div class='status-line low'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21</td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import { normalizeLocale } from './utils';
export function <span class="fstat-no" title="function not covered" >extractIntlLocaleData(</span>reactIntlLocaleData, locale) {
const normalizedLocale = <span class="cstat-no" title="statement not covered" >normalizeLocale(locale);</span>
const [language] = <span class="cstat-no" title="statement not covered" >normalizedLocale.split('-');</span>
// react-intl's locale data provides additional specific locales, i.e. `en-GB`: we'll pick the base locale data
const [specificLocaleData] = <span class="cstat-no" title="statement not covered" >reactIntlLocaleData.default.filter(<span class="fstat-no" title="function not covered" >lo</span>caleData => <span class="cstat-no" title="statement not covered" >localeData.locale === normalizedLocale)</span>;</span>
const defaultLocaleData = <span class="cstat-no" title="statement not covered" >reactIntlLocaleData.default.filter(<span class="fstat-no" title="function not covered" >lo</span>caleData => <span class="cstat-no" title="statement not covered" >localeData.locale === language)</span>;</span>
<span class="cstat-no" title="statement not covered" > return specificLocaleData || defaultLocaleData;</span>
}
/**
* Dynamic import of the `Intl` polyfill, but only if there is no support
*/
export async function <span class="fstat-no" title="function not covered" >importIntl(</span>) {
<span class="cstat-no" title="statement not covered" > if (!global.Intl) {</span>
<span class="cstat-no" title="statement not covered" > await import('intl');</span>
}
}
</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Mon Mar 08 2021 14:04:33 GMT+0100 (Central European Standard Time)
</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../sorter.js"></script>
</body>
</html>