UNPKG
better-substring
Version:
latest (1.0.3)
1.0.3
1.0.2
1.0.1
1.0.0
Improved substring method to avoid splitting mid word
better-substring
/
dist
/
index.module.js
3 lines
(2 loc)
•
289 B
JavaScript
View Raw
1
2
3
function
f
(
f,r,i,n,t
){
if
(
void
0
===i&&(i=!
1
),
void
0
===t&&(t=!
0
),r>
0
)
for
(;
o
(f.
charCodeAt
(r));)i?r++:r--;
if
(n)
for
(;
o
(f.
charCodeAt
(n));)t?n++:n--;
return
f.
substring
(r,n).
trim
()}
function
o
(
f
){
return
f>
47
&&f<
58
||f>
64
&&f<
91
||f>
96
&&f<
123
}
export
default
f;
//# sourceMappingURL=index.module.js.map