posthtml-component 2.1.0 → 2.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "posthtml-component",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "Laravel Blade-inspired components for PostHTML with slots, attributes as props, custom tags and more.",
5
5
  "license": "MIT",
6
6
  "repository": "posthtml/posthtml-components",
@@ -39,8 +39,8 @@
39
39
  "style-to-object": "^1.0.6"
40
40
  },
41
41
  "devDependencies": {
42
- "@biomejs/biome": "1.9.4",
43
- "@vitest/coverage-v8": "^2.0.4",
42
+ "@biomejs/biome": "2.0.5",
43
+ "@vitest/coverage-v8": "^3.0.4",
44
44
  "conventional-changelog-cli": "^5.0.0",
45
45
  "highlight.js": "^11.6.0",
46
46
  "markdown-it-anchor": "^9.0.1",
@@ -49,6 +49,6 @@
49
49
  "posthtml-beautify": "^0.7.0",
50
50
  "posthtml-include": "^2.0.1",
51
51
  "posthtml-markdownit": "^3.1.0",
52
- "vitest": "^2.0.4"
52
+ "vitest": "^3.0.4"
53
53
  }
54
54
  }
package/src/find-path.js CHANGED
@@ -1,7 +1,5 @@
1
- 'use strict';
2
-
3
- const path = require('path');
4
- const {existsSync} = require('fs');
1
+ const path = require('node:path');
2
+ const {existsSync} = require('node:fs');
5
3
 
6
4
  const folderSeparator = '.';
7
5
 
package/src/index.d.ts CHANGED
@@ -182,6 +182,7 @@ export type PostHTMLComponents = {
182
182
  *
183
183
  *
184
184
  */
185
+ // biome-ignore lint: using `any` until we can do better
185
186
  mergeCustomizer?: (objValue: any, srcValue: any) => any;
186
187
 
187
188
  /**
package/src/index.js CHANGED
@@ -1,7 +1,5 @@
1
- 'use strict';
2
-
3
- const {readFileSync, existsSync} = require('fs');
4
- const path = require('path');
1
+ const {readFileSync, existsSync} = require('node:fs');
2
+ const path = require('node:path');
5
3
  const {parser} = require('posthtml-parser');
6
4
  const {match, walk} = require('posthtml/lib/api');
7
5
  const expressions = require('posthtml-expressions');
@@ -244,7 +242,7 @@ function processTree(options) {
244
242
  * 'undefined' or 'null'.
245
243
  */
246
244
  walk.call(currentNode, node => {
247
- if (node && node.attrs) {
245
+ if (node?.attrs) {
248
246
  for (const key in node.attrs) {
249
247
  if (node.attrs[key] === 'undefined' || node.attrs[key] === 'null') {
250
248
  delete node.attrs[key];
package/src/log.js CHANGED
@@ -1,4 +1,4 @@
1
- const {inspect} = require('util');
1
+ const {inspect} = require('node:util');
2
2
 
3
3
  const debug = false;
4
4
 
@@ -1,5 +1,3 @@
1
- 'use strict';
2
-
3
1
  const {match} = require('posthtml/lib/api');
4
2
  const parseAttrs = require('posthtml-attrs-parser');
5
3
  const styleToObject = require('style-to-object').default;
@@ -1,5 +1,3 @@
1
- 'use strict';
2
-
3
1
  const pick = require('lodash/pick');
4
2
  const assign = require('lodash/assign');
5
3
  const mergeWith = require('lodash/mergeWith');
@@ -1,7 +1,5 @@
1
- 'use strict';
2
-
3
- const vm = require('vm');
4
- const {existsSync, readFileSync} = require('fs');
1
+ const vm = require('node:vm');
2
+ const {existsSync, readFileSync} = require('node:fs');
5
3
  const {render} = require('posthtml-render');
6
4
  const {match} = require('posthtml/lib/api');
7
5
 
@@ -1,5 +1,3 @@
1
- 'use strict';
2
-
3
1
  const {match} = require('posthtml/lib/api');
4
2
  const {render} = require('posthtml-render');
5
3
  const omit = require('lodash/omit');
@@ -25,7 +23,7 @@ function setFilledSlots(currentNode, filledSlots, {fill, slotSeparator, propsSlo
25
23
 
26
24
  if (props) {
27
25
  for (const key in props) {
28
- if (props.hasOwnProperty(key)) {
26
+ if (Object.hasOwn(props, key)) {
29
27
  try {
30
28
  props[key] = JSON.parse(props[key]);
31
29
  } catch {}
@@ -1,5 +1,3 @@
1
- 'use strict';
2
-
3
1
  const {match} = require('posthtml/lib/api');
4
2
  const {render} = require('posthtml-render');
5
3
  const get = require('lodash/get');