UNPKG
dsw
Version:
latest (1.12.2)
1.12.2
1.12.1
1.10.2
1.10.1
1.10.0
1.9.6
1.9.5
1.9.4
1.9.3
1.9.2
1.9.0
1.8.0
1.7.2
1.7.0
1.6.0
1.5.1
1.5.0
1.4.1
1.4.0
1.3.2
1.3.1
1.3.0
1.2.0
1.1.0
1.0.4
Dynamic Service Worker, offline Progressive Web Apps much easier
github.com/NascHQ/dsw
NascHQ/dsw
dsw
/
src
/
utils.js
15 lines
(12 loc)
•
344 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
const
utils = {
applyMatch
(matching, text) {
if
(matching && matching.
length
>
1
&& text) {
// we apply the variables
matching.
forEach
(
function
(
cur, idx
){ text = text.
replace
(
new
RegExp
(
'\\$'
+ idx,
'i'
), cur); }); }
return
text; } };
export
default
utils;