@untemps/utils 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=["year","learn","key","cook","crosswalk","script","chief","plan","meat","vague","demonstrator","dictionary","visible","bomber","variation","leader","channel","litigation","royalty","impulse","package","oppose","privilege","begin","operation","herd","hemisphere","incongruous","horror","pipe","start","vertical","worry","reform","unlike","exhibition","disagree","allow","patrol","combine","impress","invisible","cage","log","snow","undertake","division","ethics","damage","responsible"];module.exports=function(){for(var
|
|
1
|
+
"use strict";var e=require('../number/normalizeMinMax.cjs'),r=require('../number/getRandomInteger.cjs'),i=["year","learn","key","cook","crosswalk","script","chief","plan","meat","vague","demonstrator","dictionary","visible","bomber","variation","leader","channel","litigation","royalty","impulse","package","oppose","privilege","begin","operation","herd","hemisphere","incongruous","horror","pipe","start","vertical","worry","reform","unlike","exhibition","disagree","allow","patrol","combine","impress","invisible","cage","log","snow","undertake","division","ethics","damage","responsible"],a=function(r,i){var a=e(Math.abs(r),Math.abs(i)),o=a.min,n=a.max,t=Math.max(o,1);return{min:t,max:Math.max(n,t)}};module.exports=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=e.minWords,n=void 0===o?10:o,t=e.maxWords,s=void 0===t?50:t,m=e.dictionary,l=void 0===m?i:m,c="",d=a(n,s),h=d.min,u=d.max,p=r(h,u),v=0;v<p;v++){var g=l[Math.floor(Math.random()*l.length)];c+="".concat(v>0?" ":"").concat(g)}return c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var r=require('./generateText.cjs');require('../number/normalizeMinMax.cjs'),require('../number/getRandomInteger.cjs');module.exports=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=e.token,n=void 0===o?"%token%":o,i=e.minWords,t=void 0===i?10:i,a=e.maxWords,d=void 0===a?50:a,m=e.dictionary,s=void 0===m?void 0:m,u=r({minWords:t,maxWords:d,dictionary:s}),v=!1,l=u.split(" ").map((function(r){var e=Math.random()<.1;return v=!v&&e,e?n:r}));return v||(l[Math.floor(Math.random()*l.length)]=n),l.join(" ")};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
import a from'../number/normalizeMinMax.mjs';import r from'../number/getRandomInteger.mjs';var e=["year","learn","key","cook","crosswalk","script","chief","plan","meat","vague","demonstrator","dictionary","visible","bomber","variation","leader","channel","litigation","royalty","impulse","package","oppose","privilege","begin","operation","herd","hemisphere","incongruous","horror","pipe","start","vertical","worry","reform","unlike","exhibition","disagree","allow","patrol","combine","impress","invisible","cage","log","snow","undertake","division","ethics","damage","responsible"],i=function(r,e){var i=a(Math.abs(r),Math.abs(e)),o=i.min,n=i.max,t=Math.max(o,1);return{min:t,max:Math.max(n,t)}},o=function(){for(var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=a.minWords,n=void 0===o?10:o,t=a.maxWords,m=void 0===t?50:t,s=a.dictionary,l=void 0===s?e:s,c="",d=i(n,m),p=d.min,h=d.max,v=r(p,h),g=0;g<v;g++){var u=l[Math.floor(Math.random()*l.length)];c+="".concat(g>0?" ":"").concat(u)}return c};export{o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import o from'./generateText.mjs';var r=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},
|
|
1
|
+
import o from'./generateText.mjs';import'../number/normalizeMinMax.mjs';import'../number/getRandomInteger.mjs';var r=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=r.token,t=void 0===n?"%token%":n,i=r.minWords,a=void 0===i?10:i,e=r.maxWords,d=void 0===e?50:e,m=r.dictionary,s=void 0===m?void 0:m,v=o({minWords:a,maxWords:d,dictionary:s}),u=!1,l=v.split(" ").map((function(o){var r=Math.random()<.1;return u=!u&&r,r?t:o}));return u||(l[Math.floor(Math.random()*l.length)]=t),l.join(" ")};export{r as default};
|