@untemps/utils 3.2.0 → 3.2.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
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=({tag:e=`div`,attributes:t={},content:n=null,textContent:r=null,parent:i=null,parentSelector:a=null,boundingClientRect:o=null}={})=>{let s=document.createElement(e);for(let
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=({tag:e=`div`,attributes:t={},content:n=null,textContent:r=null,parent:i=null,parentSelector:a=null,boundingClientRect:o=null}={})=>{let s=document.createElement(e);if(t)for(let[e,n]of Object.entries(t))s.setAttribute(e,n);n&&s.appendChild(n),r&&!s.hasChildNodes()&&s.appendChild(document.createTextNode(r));let c=i||document.querySelector(a);return c&&c.appendChild(s),o&&(s.getBoundingClientRect=()=>o),s};exports.createElement=e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createElement.d.ts","sourceRoot":"","sources":["../../src/dom/createElement.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACtC,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC,uFAAuF;IACvF,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAA;IAC1C,yEAAyE;IACzE,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G,IAAI,CAAA;IAC9B,iFAAiF;IACjF,kBAAkB,CAAC,EAAE,sBAAsB,GAAG,IAAI,CAAA;CAClD;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,aAAa,GAAI,yFAQ3B,mBAAwB,KAAG,WAqB7B,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
//#region src/dom/createElement.ts
|
|
2
2
|
var e = ({ tag: e = "div", attributes: t = {}, content: n = null, textContent: r = null, parent: i = null, parentSelector: a = null, boundingClientRect: o = null } = {}) => {
|
|
3
3
|
let s = document.createElement(e);
|
|
4
|
-
for (let e
|
|
4
|
+
if (t) for (let [e, n] of Object.entries(t)) s.setAttribute(e, n);
|
|
5
5
|
n && s.appendChild(n), r && !s.hasChildNodes() && s.appendChild(document.createTextNode(r));
|
|
6
6
|
let c = i || document.querySelector(a);
|
|
7
7
|
return c && c.appendChild(s), o && (s.getBoundingClientRect = () => o), s;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* element.className = 'foo'
|
|
11
11
|
* document.body.appendChild(element)
|
|
12
12
|
*
|
|
13
|
-
* removeElement(element) // <div class="foo"></div>
|
|
13
|
+
* removeElement(element) // returns the detached <div class="foo"></div>
|
|
14
14
|
*
|
|
15
15
|
* @param element - The DOM element or the selector of the DOM element to remove.
|
|
16
16
|
* @returns The removed DOM element.
|
|
@@ -26,7 +26,7 @@ export interface GenerateTokenizedTextConfig {
|
|
|
26
26
|
* const minWords = 5
|
|
27
27
|
* const maxWords = 10
|
|
28
28
|
* const dictionary = ['foo', 'bar', 'gag']
|
|
29
|
-
* generateTokenizedText(tokens, divider, minWords, maxWords, dictionary) // {indices: Array(3), text: "foo $pol$ $biz$ bar gag $kuy$ foo gag foo"}
|
|
29
|
+
* generateTokenizedText({ tokens, divider, minWords, maxWords, dictionary }) // {indices: Array(3), text: "foo $pol$ $biz$ bar gag $kuy$ foo gag foo"}
|
|
30
30
|
*
|
|
31
31
|
* @param config - The configuration object for the text generation.
|
|
32
32
|
* @returns An object containing a list of token indices and the generated string.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@untemps/utils",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"description": "Utils for @untemps packages",
|
|
5
5
|
"repository": "git@github.com:untemps/utils.git",
|
|
6
6
|
"keywords": [],
|
|
@@ -34,12 +34,14 @@
|
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@commitlint/cli": "^20.0.0",
|
|
36
36
|
"@commitlint/config-conventional": "^20.0.0",
|
|
37
|
+
"@eslint/js": "^10.0.1",
|
|
37
38
|
"@semantic-release/changelog": "^6.0.3",
|
|
38
39
|
"@semantic-release/git": "^10.0.1",
|
|
39
40
|
"@semantic-release/github": "^12.0.0",
|
|
40
41
|
"@testing-library/jest-dom": "^6.0.0",
|
|
41
42
|
"@types/node": "^25.5.0",
|
|
42
43
|
"@vitest/coverage-v8": "^3.0.0",
|
|
44
|
+
"eslint": "^10.3.0",
|
|
43
45
|
"fast-check": "^4.0.0",
|
|
44
46
|
"husky": "^9.0.0",
|
|
45
47
|
"jsdom": "^26.0.0",
|
|
@@ -47,6 +49,7 @@
|
|
|
47
49
|
"semantic-release": "^25.0.0",
|
|
48
50
|
"typedoc": "^0.28.18",
|
|
49
51
|
"typescript": "^6.0.2",
|
|
52
|
+
"typescript-eslint": "^8.59.3",
|
|
50
53
|
"vite": "^8.0.0",
|
|
51
54
|
"vitest": "^3.0.0"
|
|
52
55
|
},
|
|
@@ -81,9 +84,11 @@
|
|
|
81
84
|
"scripts": {
|
|
82
85
|
"docs": "typedoc && node scripts/open-docs.mjs",
|
|
83
86
|
"test": "vitest",
|
|
84
|
-
"test:ci": "vitest run --coverage",
|
|
87
|
+
"test:ci": "vitest run --coverage && yarn lint",
|
|
85
88
|
"build": "vite build && tsc -p tsconfig.build.json",
|
|
86
|
-
"
|
|
89
|
+
"lint": "eslint \"src/**/*.ts\"",
|
|
90
|
+
"typecheck": "tsc --noEmit",
|
|
91
|
+
"prettier": "prettier \"src/**/*.ts\" --ignore-path ./.prettierignore --write && git add src/**/*.ts && git status",
|
|
87
92
|
"prepare": "husky"
|
|
88
93
|
}
|
|
89
94
|
}
|