format-string-by-pattern
Advanced tools
Comparing version 0.2.2 to 0.2.3
@@ -1,2 +0,2 @@ | ||
function e(e,r){var t=String(r).replace(/[^\da-zA-Z\n|]/g,""),l=e.split(/[^\da-zA-Z\n|]/g).filter(Boolean).map(function(e){return e.length}),n=e.split(/[\da-zA-Z\n|]/g).filter(Boolean);if(e.startsWith(n[0])){var a=n.reduce(function(e,r,t){var n=l[t],a=e.value.slice(0,n),u=e.value.slice(n);return{result:e.result.concat(r,a),value:u}},{result:"",value:t}).result.slice(0,e.length);return a.slice(-1)[0].match(/[^\da-zA-Z\n|]/g)?a.slice(0,-1):a}return l.reduce(function(e,r,t){var l=n[t]||"",a="$1"+l+"$2",u=r+e.prevSlice+e.prevSeparator.length,c=new RegExp("(.{"+u+"})(.)");return{prevSeparator:l,prevSlice:u,value:e.value.replace(c,a)}},{prevSeparator:"",prevSlice:0,value:t}).value.slice(0,e.length)}module.exports=function(r,t){return t?e(r,t):function(t){return e(r,t)}}; | ||
function e(e,r){if(!r)return"";var t=String(r).replace(/[^\da-zA-Z\n|]/g,""),l=e.split(/[^\da-zA-Z\n|]/g).filter(Boolean).map(function(e){return e.length}),n=e.split(/[\da-zA-Z\n|]/g).filter(Boolean);if(e.startsWith(n[0])){var a=n.reduce(function(e,r,t){var n=l[t],a=e.value.slice(0,n),u=e.value.slice(n);return{result:e.result.concat(r,a),value:u}},{result:"",value:t}).result.slice(0,e.length);return a.slice(-1)[0].match(/[^\da-zA-Z\n|]/g)?a.slice(0,-1):a}return l.reduce(function(e,r,t){var l=n[t]||"",a="$1"+l+"$2",u=r+e.prevSlice+e.prevSeparator.length,i=new RegExp("(.{"+u+"})(.)");return{prevSeparator:l,prevSlice:u,value:e.value.replace(i,a)}},{prevSeparator:"",prevSlice:0,value:t}).value.slice(0,e.length)}module.exports=function(r,t){return t?e(r,t):function(t){return e(r,t)}}; | ||
//# sourceMappingURL=format-string-by-pattern.js.map |
@@ -1,2 +0,2 @@ | ||
function e(e,r){var t=String(r).replace(/[^\da-zA-Z\n|]/g,""),l=e.split(/[^\da-zA-Z\n|]/g).filter(Boolean).map(function(e){return e.length}),n=e.split(/[\da-zA-Z\n|]/g).filter(Boolean);if(e.startsWith(n[0])){var a=n.reduce(function(e,r,t){var n=l[t],a=e.value.slice(0,n),u=e.value.slice(n);return{result:e.result.concat(r,a),value:u}},{result:"",value:t}).result.slice(0,e.length);return a.slice(-1)[0].match(/[^\da-zA-Z\n|]/g)?a.slice(0,-1):a}return l.reduce(function(e,r,t){var l=n[t]||"",a="$1"+l+"$2",u=r+e.prevSlice+e.prevSeparator.length,c=new RegExp("(.{"+u+"})(.)");return{prevSeparator:l,prevSlice:u,value:e.value.replace(c,a)}},{prevSeparator:"",prevSlice:0,value:t}).value.slice(0,e.length)}module.exports=function(r,t){return t?e(r,t):function(t){return e(r,t)}}; | ||
function e(e,r){if(!r)return"";var t=String(r).replace(/[^\da-zA-Z\n|]/g,""),l=e.split(/[^\da-zA-Z\n|]/g).filter(Boolean).map(function(e){return e.length}),n=e.split(/[\da-zA-Z\n|]/g).filter(Boolean);if(e.startsWith(n[0])){var a=n.reduce(function(e,r,t){var n=l[t],a=e.value.slice(0,n),u=e.value.slice(n);return{result:e.result.concat(r,a),value:u}},{result:"",value:t}).result.slice(0,e.length);return a.slice(-1)[0].match(/[^\da-zA-Z\n|]/g)?a.slice(0,-1):a}return l.reduce(function(e,r,t){var l=n[t]||"",a="$1"+l+"$2",u=r+e.prevSlice+e.prevSeparator.length,i=new RegExp("(.{"+u+"})(.)");return{prevSeparator:l,prevSlice:u,value:e.value.replace(i,a)}},{prevSeparator:"",prevSlice:0,value:t}).value.slice(0,e.length)}module.exports=function(r,t){return t?e(r,t):function(t){return e(r,t)}}; | ||
//# sourceMappingURL=format-string-by-pattern.m.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r():"function"==typeof define&&define.amd?define(r):r()}(0,function(){function e(e,r){var n=String(r).replace(/[^\da-zA-Z\n|]/g,""),t=e.split(/[^\da-zA-Z\n|]/g).filter(Boolean).map(function(e){return e.length}),l=e.split(/[\da-zA-Z\n|]/g).filter(Boolean);if(e.startsWith(l[0])){var u=l.reduce(function(e,r,n){var l=t[n],u=e.value.slice(0,l),a=e.value.slice(l);return{result:e.result.concat(r,u),value:a}},{result:"",value:n}).result.slice(0,e.length);return u.slice(-1)[0].match(/[^\da-zA-Z\n|]/g)?u.slice(0,-1):u}return t.reduce(function(e,r,n){var t=l[n]||"",u="$1"+t+"$2",a=r+e.prevSlice+e.prevSeparator.length,i=new RegExp("(.{"+a+"})(.)");return{prevSeparator:t,prevSlice:a,value:e.value.replace(i,u)}},{prevSeparator:"",prevSlice:0,value:n}).value.slice(0,e.length)}module.exports=function(r,n){return n?e(r,n):function(n){return e(r,n)}}}); | ||
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r():"function"==typeof define&&define.amd?define(r):r()}(0,function(){function e(e,r){if(!r)return"";var n=String(r).replace(/[^\da-zA-Z\n|]/g,""),t=e.split(/[^\da-zA-Z\n|]/g).filter(Boolean).map(function(e){return e.length}),l=e.split(/[\da-zA-Z\n|]/g).filter(Boolean);if(e.startsWith(l[0])){var u=l.reduce(function(e,r,n){var l=t[n],u=e.value.slice(0,l),a=e.value.slice(l);return{result:e.result.concat(r,u),value:a}},{result:"",value:n}).result.slice(0,e.length);return u.slice(-1)[0].match(/[^\da-zA-Z\n|]/g)?u.slice(0,-1):u}return t.reduce(function(e,r,n){var t=l[n]||"",u="$1"+t+"$2",a=r+e.prevSlice+e.prevSeparator.length,i=new RegExp("(.{"+a+"})(.)");return{prevSeparator:t,prevSlice:a,value:e.value.replace(i,u)}},{prevSeparator:"",prevSlice:0,value:n}).value.slice(0,e.length)}module.exports=function(r,n){return n?e(r,n):function(n){return e(r,n)}}}); | ||
//# sourceMappingURL=format-string-by-pattern.umd.js.map |
{ | ||
"name": "format-string-by-pattern", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "A module that formats a string based on a pattern", | ||
@@ -5,0 +5,0 @@ "main": "dist/format-string-by-pattern.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15752
15