@pi-r/chrome 0.8.3 → 0.8.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.
package/LICENSE CHANGED
@@ -1,7 +1,7 @@
1
- Copyright 2024 An Pham
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
-
5
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
-
1
+ Copyright 2024 An Pham
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
7
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import type { IFileManager } from '@e-mc/types/lib';
2
-
3
- import type { ChromeDocumentConstructor, DocumentAsset } from './types';
4
-
5
- declare const Chrome: ChromeDocumentConstructor<IFileManager<DocumentAsset>>;
6
-
1
+ import type { IFileManager } from '@e-mc/types/lib';
2
+
3
+ import type { ChromeDocumentConstructor, DocumentAsset } from './types';
4
+
5
+ declare const Chrome: ChromeDocumentConstructor<IFileManager<DocumentAsset>>;
6
+
7
7
  export = Chrome;
package/index.js CHANGED
@@ -209,7 +209,7 @@ function hasCondition(data, condition) {
209
209
  if (items.length > 0 && !isSpace(match[0][0])) {
210
210
  return false;
211
211
  }
212
- items.push([match[1], match[2], match[3]]);
212
+ items.push([match[1], trimQuote(match[2]), trimQuote(match[3])]);
213
213
  }
214
214
  REGEXP_TEMPLATECOMPARISON.lastIndex = 0;
215
215
  if (items.length > 1 && !join) {
@@ -3279,7 +3279,8 @@ class ChromeDocument extends Document {
3279
3279
  const row = items[0];
3280
3280
  let condition = NaN;
3281
3281
  for (let seg of template) {
3282
- switch ((seg = seg.trim()).toLowerCase()) {
3282
+ seg = seg.trim();
3283
+ switch (seg.toLowerCase()) {
3283
3284
  case ':is(and)':
3284
3285
  if (condition === 0) {
3285
3286
  remove = false;
@@ -3473,7 +3474,7 @@ class ChromeDocument extends Document {
3473
3474
  const parseSelector = (value) => {
3474
3475
  const items = [];
3475
3476
  const revised = value.replace(useUnsafeCssReplace ? REGEXP_NTHCHILD_UNSAFE : REGEXP_NTHCHILD, (...capture) => {
3476
- return '`%' + (items.push('\\(' + stringSome + (capture[1] === '-' ? '\\x2d' : '\\x2b?') + (capture[2] || '[01]?') + (capture[3] === '0' ? !capture[1] && !capture[2] && !capture[4] && !capture[5] ? '[+-]?0[nN]?' : '0' : '[nN]') + stringSome + (capture[5] ? (capture[4] === '-' ? '\\x2d' : '\\x2b') + stringSome + capture[5] : `(?:[+-]${stringSome}0)?`) + (capture[6] ? stringMany + '[oO][fF]' + stringMany + capture[6].trim() : '') + stringSome + '\\)') - 1) + '`';
3477
+ return '`%' + (items.push('\\(' + stringSome + (capture[1] === '-' ? '\\x2d' : '\\x2b?') + (capture[2] || '[01]?') + (capture[3] === '0' ? !capture[1] && !capture[2] && !capture[4] && !capture[5] ? '[+-]?0[nN]?' : '0' : '[nN]?') + stringSome + (capture[5] ? (capture[4] === '-' ? '\\x2d' : '\\x2b?') + stringSome + capture[5] : `(?:[+-]${stringSome}0)?`) + (capture[6] ? stringMany + '[oO][fF]' + stringMany + capture[6].trim() : '') + stringSome + '\\)') - 1) + '`';
3477
3478
  });
3478
3479
  let selector = '';
3479
3480
  for (let i = 0, length = revised.length, casing = false, attr = false, quote = false; i < length; i++) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-r/chrome",
3
- "version": "0.8.3",
3
+ "version": "0.8.4",
4
4
  "description": "Chrome document constructor for E-mc.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -21,9 +21,9 @@
21
21
  "license": "MIT",
22
22
  "homepage": "https://github.com/anpham6/pi-r#readme",
23
23
  "dependencies": {
24
- "@e-mc/cloud": "^0.10.3",
25
- "@e-mc/core": "^0.10.3",
26
- "@e-mc/document": "^0.10.3",
27
- "@e-mc/types": "^0.10.3"
24
+ "@e-mc/cloud": "^0.10.9",
25
+ "@e-mc/core": "^0.10.9",
26
+ "@e-mc/document": "^0.10.9",
27
+ "@e-mc/types": "^0.10.9"
28
28
  }
29
29
  }