@tbela99/css-parser 0.5.0 → 0.5.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.
@@ -6371,12 +6371,16 @@
6371
6371
  }
6372
6372
  if (atRule.val == 'import') {
6373
6373
  // @ts-ignore
6374
- if (tokens[0].typ == exports.EnumToken.UrlFunctionTokenType && tokens[1].typ == exports.EnumToken.UrlTokenTokenType) {
6375
- tokens.shift();
6376
- // @ts-ignore
6377
- tokens[0].typ = exports.EnumToken.StringTokenType;
6378
- // @ts-ignore
6379
- tokens[0].val = `"${tokens[0].val}"`;
6374
+ if (tokens[0].typ == exports.EnumToken.UrlFunctionTokenType) {
6375
+ if (tokens[1].typ == exports.EnumToken.UrlTokenTokenType || tokens[1].typ == exports.EnumToken.StringTokenType) {
6376
+ tokens.shift();
6377
+ if (tokens[1].typ == exports.EnumToken.UrlTokenTokenType) {
6378
+ // @ts-ignore
6379
+ tokens[0].typ = exports.EnumToken.StringTokenType;
6380
+ // @ts-ignore
6381
+ tokens[0].val = `"${tokens[0].val}"`;
6382
+ }
6383
+ }
6380
6384
  }
6381
6385
  // @ts-ignore
6382
6386
  if (tokens[0].typ == exports.EnumToken.StringTokenType) {
package/dist/index.cjs CHANGED
@@ -6369,12 +6369,16 @@ async function parseNode(results, context, stats, options, errors, src, map) {
6369
6369
  }
6370
6370
  if (atRule.val == 'import') {
6371
6371
  // @ts-ignore
6372
- if (tokens[0].typ == exports.EnumToken.UrlFunctionTokenType && tokens[1].typ == exports.EnumToken.UrlTokenTokenType) {
6373
- tokens.shift();
6374
- // @ts-ignore
6375
- tokens[0].typ = exports.EnumToken.StringTokenType;
6376
- // @ts-ignore
6377
- tokens[0].val = `"${tokens[0].val}"`;
6372
+ if (tokens[0].typ == exports.EnumToken.UrlFunctionTokenType) {
6373
+ if (tokens[1].typ == exports.EnumToken.UrlTokenTokenType || tokens[1].typ == exports.EnumToken.StringTokenType) {
6374
+ tokens.shift();
6375
+ if (tokens[1].typ == exports.EnumToken.UrlTokenTokenType) {
6376
+ // @ts-ignore
6377
+ tokens[0].typ = exports.EnumToken.StringTokenType;
6378
+ // @ts-ignore
6379
+ tokens[0].val = `"${tokens[0].val}"`;
6380
+ }
6381
+ }
6378
6382
  }
6379
6383
  // @ts-ignore
6380
6384
  if (tokens[0].typ == exports.EnumToken.StringTokenType) {
@@ -346,12 +346,16 @@ async function parseNode(results, context, stats, options, errors, src, map) {
346
346
  }
347
347
  if (atRule.val == 'import') {
348
348
  // @ts-ignore
349
- if (tokens[0].typ == EnumToken.UrlFunctionTokenType && tokens[1].typ == EnumToken.UrlTokenTokenType) {
350
- tokens.shift();
351
- // @ts-ignore
352
- tokens[0].typ = EnumToken.StringTokenType;
353
- // @ts-ignore
354
- tokens[0].val = `"${tokens[0].val}"`;
349
+ if (tokens[0].typ == EnumToken.UrlFunctionTokenType) {
350
+ if (tokens[1].typ == EnumToken.UrlTokenTokenType || tokens[1].typ == EnumToken.StringTokenType) {
351
+ tokens.shift();
352
+ if (tokens[1].typ == EnumToken.UrlTokenTokenType) {
353
+ // @ts-ignore
354
+ tokens[0].typ = EnumToken.StringTokenType;
355
+ // @ts-ignore
356
+ tokens[0].val = `"${tokens[0].val}"`;
357
+ }
358
+ }
355
359
  }
356
360
  // @ts-ignore
357
361
  if (tokens[0].typ == EnumToken.StringTokenType) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tbela99/css-parser",
3
3
  "description": "CSS parser for node and the browser",
4
- "version": "0.5.0",
4
+ "version": "0.5.1",
5
5
  "exports": {
6
6
  ".": "./dist/node/index.js",
7
7
  "./umd": "./dist/index-umd-web.js",