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.modern.js
3 lines
(2 loc)
•
257 B
JavaScript
View Raw
1
2
3
function f(f,n,t=!
1
,o,u=!
0
){
if
(n>
0
)
for
(;r(f.charCodeAt(n));)t?n++
:n--
;
if
(o)
for
(;r(f.charCodeAt(o));)u?o++
:o--
;
return
f.substring(n,o).trim()}function r(f){
return
f>
47
&&f<
58
|
|f>
64
&&f<
91
|
|f>
96
&&f<
123
}export default f;
//
# sourceMappingURL=index.modern.js.map