@untemps/utils 4.0.0-beta.3 → 4.0.0-beta.4

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
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../number/normalizeMinMax.cjs`),t=require(`../number/getRandomInteger.cjs`);var n=`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`.split(`.`),r=(t,n)=>{let{min:r,max:i}=e.normalizeMinMax(Math.abs(t),Math.abs(n)),a=Math.max(r,1);return{min:a,max:Math.max(i,a)}},i=({minWords:e=10,maxWords:i=50,dictionary:a=n}={})=>{let o=``,{min:s,max:c}=r(e,i),l=t.getRandomInteger(s,c);for(let e=0;e<l;e++){let t=a[Math.floor(Math.random()*a.length)];o+=`${e>0?` `:``}${t}`}return o};exports.generateText=i;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../number/normalizeMinMax.cjs`),t=require(`../number/getRandomInteger.cjs`);var n=`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`.split(`.`),r=(t,n)=>{let{min:r,max:i}=e.normalizeMinMax(Math.abs(t),Math.abs(n)),a=Math.max(r,1);return{min:a,max:Math.max(i,a)}},i=({minWords:e=10,maxWords:i=50,dictionary:a=n}={})=>{if(!a?.length)throw RangeError(`dictionary must not be empty`);let o=``,{min:s,max:c}=r(e,i),l=t.getRandomInteger(s,c);for(let e=0;e<l;e++){let t=a[Math.floor(Math.random()*a.length)];o+=`${e>0?` `:``}${t}`}return o};exports.generateText=i;
@@ -1 +1 @@
1
- {"version":3,"file":"generateText.d.ts","sourceRoot":"","sources":["../../src/string/generateText.ts"],"names":[],"mappings":"AAAA;;GAEG;AAmEH;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,oDAAoD;IACpD,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;CACrB;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,YAAY,GAAI,qCAAsD,kBAAuB,KAAG,MAS5G,CAAA"}
1
+ {"version":3,"file":"generateText.d.ts","sourceRoot":"","sources":["../../src/string/generateText.ts"],"names":[],"mappings":"AAAA;;GAEG;AAmEH;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,oDAAoD;IACpD,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;CACrB;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,YAAY,GAAI,qCAAsD,kBAAuB,KAAG,MAU5G,CAAA"}
@@ -8,6 +8,7 @@ var n = /* @__PURE__ */ "year.learn.key.cook.crosswalk.script.chief.plan.meat.va
8
8
  max: Math.max(i, a)
9
9
  };
10
10
  }, i = ({ minWords: e = 10, maxWords: i = 50, dictionary: a = n } = {}) => {
11
+ if (!a?.length) throw RangeError("dictionary must not be empty");
11
12
  let o = "", { min: s, max: c } = r(e, i), l = t(s, c);
12
13
  for (let e = 0; e < l; e++) {
13
14
  let t = a[Math.floor(Math.random() * a.length)];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@untemps/utils",
3
- "version": "4.0.0-beta.3",
3
+ "version": "4.0.0-beta.4",
4
4
  "description": "Utils for @untemps packages",
5
5
  "repository": "git@github.com:untemps/utils.git",
6
6
  "keywords": [],