@untemps/utils 4.0.0-beta.2 → 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(`../string/isString.cjs`);var t=(t,n={})=>{let r=e.isString(t)?document.querySelector(t):t;for(let
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../string/isString.cjs`);var t=(t,n={})=>{let r=e.isString(t)?document.querySelector(t):t;for(let[e,t]of Object.entries(n))t==null?r?.removeAttribute(e):r?.setAttribute(e,t);return r};exports.modifyElement=t;
|
|
@@ -2,7 +2,7 @@ import { isString as e } from "../string/isString.js";
|
|
|
2
2
|
//#region src/dom/modifyElement.ts
|
|
3
3
|
var t = (t, n = {}) => {
|
|
4
4
|
let r = e(t) ? document.querySelector(t) : t;
|
|
5
|
-
for (let e
|
|
5
|
+
for (let [e, t] of Object.entries(n)) t == null ? r?.removeAttribute(e) : r?.setAttribute(e, t);
|
|
6
6
|
return r;
|
|
7
7
|
};
|
|
8
8
|
//#endregion
|
|
@@ -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,
|
|
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)];
|