Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

format-string-by-pattern

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

format-string-by-pattern - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

2

dist/format-string-by-pattern.js

@@ -1,2 +0,2 @@

module.exports=function(e,r){var l=e.split(/[^\da-zA-Z\n|]/g).filter(Boolean).map(function(e){return e.length}),t=e.split(/[\da-zA-Z\n|]/g).filter(Boolean);if(e.startsWith(t[0])){var a=t.reduce(function(e,r,t){var a=l[t],n=e.value.slice(0,a),u=e.value.slice(a);return{result:e.result.concat(r,n),value:u}},{result:"",value:String(r)}).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,l){var a=t[l]||"",n="$1"+a+"$2",u=r+e.prevSlice+e.prevSeparator.length,i=new RegExp("(.{"+u+"})(.)");return{prevSeparator:a,prevSlice:u,value:e.value.replace(i,n)}},{prevSeparator:"",prevSlice:0,value:String(r)}).value.slice(0,e.length)};
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)}};
//# sourceMappingURL=format-string-by-pattern.js.map

@@ -1,2 +0,2 @@

module.exports=function(e,r){var l=e.split(/[^\da-zA-Z\n|]/g).filter(Boolean).map(function(e){return e.length}),t=e.split(/[\da-zA-Z\n|]/g).filter(Boolean);if(e.startsWith(t[0])){var a=t.reduce(function(e,r,t){var a=l[t],n=e.value.slice(0,a),u=e.value.slice(a);return{result:e.result.concat(r,n),value:u}},{result:"",value:String(r)}).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,l){var a=t[l]||"",n="$1"+a+"$2",u=r+e.prevSlice+e.prevSeparator.length,i=new RegExp("(.{"+u+"})(.)");return{prevSeparator:a,prevSlice:u,value:e.value.replace(i,n)}},{prevSeparator:"",prevSlice:0,value:String(r)}).value.slice(0,e.length)};
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)}};
//# 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(){module.exports=function(e,r){var t=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 l=n.reduce(function(e,r,n){var l=t[n],a=e.value.slice(0,l),u=e.value.slice(l);return{result:e.result.concat(r,a),value:u}},{result:"",value:String(r)}).result.slice(0,e.length);return l.slice(-1)[0].match(/[^\da-zA-Z\n|]/g)?l.slice(0,-1):l}return t.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:String(r)}).value.slice(0,e.length)}});
!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)}}});
//# sourceMappingURL=format-string-by-pattern.umd.js.map
{
"name": "format-string-by-pattern",
"version": "0.2.1",
"version": "0.2.2",
"description": "A module that formats a string based on a pattern",

@@ -15,4 +15,4 @@ "main": "dist/format-string-by-pattern.js",

"scripts": {
"build": "npm run test && microbundle -o dist",
"prepublish": "git push && git push --tags",
"build": "npm run test && microbundle -o dist -i src",
"prepublishOnly": "git push && git push --tags",
"preversion": "npm run build",

@@ -19,0 +19,0 @@ "test": "xo && nyc ava",

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc