Socket
Socket
Sign inDemoInstall

@vanilla-extract/css

Package Overview
Dependencies
Maintainers
4
Versions
122
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vanilla-extract/css - npm Package Compare versions

Comparing version 0.0.0-perf-dev-prefix-20240820014053 to 0.0.0-perf-dev-prefix-20240820044103

80

dist/vanilla-extract-css.browser.cjs.js

@@ -61,21 +61,22 @@ 'use strict';

var forwardSlash = 47;
var backSlash = 92;
var getLastSlashBeforeIndex = (path, index) => {
var i = index;
while (i >= 0) {
var codeUnit = path.charCodeAt(i);
if (codeUnit === forwardSlash || codeUnit === backSlash) {
return i;
var forwardSlash = '/'.charCodeAt(0);
var getLastSlashBeforeIndex = (path, startingIndex) => {
var pathIndex = startingIndex;
while (pathIndex >= 0) {
var codeUnit = path.charCodeAt(pathIndex);
if (codeUnit === forwardSlash) {
return pathIndex;
}
// UTF-16 surrogate pair handling
// Check if codeUnit is a low surrogate
if (codeUnit >= 0xdc00 && codeUnit <= 0xdfff) {
// Ensure there's a previous character
if (i > 0) {
var maybeHighSurrogate = path.charCodeAt(i - 1);
if (pathIndex > 0) {
var maybeHighSurrogate = path.charCodeAt(pathIndex - 1);
// Check if the previous code unit is a high surrogate
if (maybeHighSurrogate >= 0xd800 && maybeHighSurrogate <= 0xdbff) {
// Move past the high surrogate and continue
i -= 2;
pathIndex -= 2;
continue;

@@ -85,12 +86,34 @@ }

}
i--;
// At this point, we know we either have a regular character or a lone surrogate, which is
// valid in windows file paths
pathIndex--;
}
return -1;
};
var customSplit3 = path => {
var file = '';
var dir = '';
/**
* Assumptions:
* - The path is always normalized to use posix file separators (see `addFileScope`)
* - The path is always relative to the project root (see `addFileScope`)
* - There's no need to validate the file extension as we know that we only run this function if the
* path was inside a VE file
* */
var _getFileAndDirFromPath = path => {
var file;
var dir;
var lastIndexOfDotCss = path.lastIndexOf('.css');
if (lastIndexOfDotCss === -1) {
return;
}
var i = lastIndexOfDotCss - 1;
var lastSlashIndex = getLastSlashBeforeIndex(path, i);
if (lastSlashIndex === -1) {
return {
file: path.slice(0, lastIndexOfDotCss)
};
}
var secondLastSlashIndex = getLastSlashBeforeIndex(path, lastSlashIndex - 1);
// If secondLastSlashIndex is -1, it means that the path looks like `directory/file.css.ts`,
// in which case dir will still be sliced starting at 0, which is what we want
dir = path.slice(secondLastSlashIndex + 1, lastSlashIndex);

@@ -103,2 +126,15 @@ file = path.slice(lastSlashIndex + 1, lastIndexOfDotCss);

};
var memoizedGetFileAndDirFromPath = () => {
var cache = new Map();
return path => {
if (cache.has(path)) {
return cache.get(path);
}
var result = _getFileAndDirFromPath(path);
cache.set(path, result);
return result;
};
};
var getFileAndDirFromPath = memoizedGetFileAndDirFromPath();
function getDevPrefix(_ref) {

@@ -114,7 +150,11 @@ var {

} = fileScope_dist_vanillaExtractCssFileScope.getFileScope();
var {
dir,
file
} = customSplit3(filePath);
parts.unshift(file && file !== 'index' ? file : dir);
var fileAndDir = getFileAndDirFromPath(filePath);
if (fileAndDir) {
var {
dir,
file
} = fileAndDir;
var part = (file !== 'index' ? file : dir) || file;
parts.unshift(part);
}
}

@@ -121,0 +161,0 @@ return parts.join('_');

@@ -49,21 +49,22 @@ import { injectStyles } from '../injectStyles/dist/vanilla-extract-css-injectStyles.browser.esm.js';

var forwardSlash = 47;
var backSlash = 92;
var getLastSlashBeforeIndex = (path, index) => {
var i = index;
while (i >= 0) {
var codeUnit = path.charCodeAt(i);
if (codeUnit === forwardSlash || codeUnit === backSlash) {
return i;
var forwardSlash = '/'.charCodeAt(0);
var getLastSlashBeforeIndex = (path, startingIndex) => {
var pathIndex = startingIndex;
while (pathIndex >= 0) {
var codeUnit = path.charCodeAt(pathIndex);
if (codeUnit === forwardSlash) {
return pathIndex;
}
// UTF-16 surrogate pair handling
// Check if codeUnit is a low surrogate
if (codeUnit >= 0xdc00 && codeUnit <= 0xdfff) {
// Ensure there's a previous character
if (i > 0) {
var maybeHighSurrogate = path.charCodeAt(i - 1);
if (pathIndex > 0) {
var maybeHighSurrogate = path.charCodeAt(pathIndex - 1);
// Check if the previous code unit is a high surrogate
if (maybeHighSurrogate >= 0xd800 && maybeHighSurrogate <= 0xdbff) {
// Move past the high surrogate and continue
i -= 2;
pathIndex -= 2;
continue;

@@ -73,12 +74,34 @@ }

}
i--;
// At this point, we know we either have a regular character or a lone surrogate, which is
// valid in windows file paths
pathIndex--;
}
return -1;
};
var customSplit3 = path => {
var file = '';
var dir = '';
/**
* Assumptions:
* - The path is always normalized to use posix file separators (see `addFileScope`)
* - The path is always relative to the project root (see `addFileScope`)
* - There's no need to validate the file extension as we know that we only run this function if the
* path was inside a VE file
* */
var _getFileAndDirFromPath = path => {
var file;
var dir;
var lastIndexOfDotCss = path.lastIndexOf('.css');
if (lastIndexOfDotCss === -1) {
return;
}
var i = lastIndexOfDotCss - 1;
var lastSlashIndex = getLastSlashBeforeIndex(path, i);
if (lastSlashIndex === -1) {
return {
file: path.slice(0, lastIndexOfDotCss)
};
}
var secondLastSlashIndex = getLastSlashBeforeIndex(path, lastSlashIndex - 1);
// If secondLastSlashIndex is -1, it means that the path looks like `directory/file.css.ts`,
// in which case dir will still be sliced starting at 0, which is what we want
dir = path.slice(secondLastSlashIndex + 1, lastSlashIndex);

@@ -91,2 +114,15 @@ file = path.slice(lastSlashIndex + 1, lastIndexOfDotCss);

};
var memoizedGetFileAndDirFromPath = () => {
var cache = new Map();
return path => {
if (cache.has(path)) {
return cache.get(path);
}
var result = _getFileAndDirFromPath(path);
cache.set(path, result);
return result;
};
};
var getFileAndDirFromPath = memoizedGetFileAndDirFromPath();
function getDevPrefix(_ref) {

@@ -102,7 +138,11 @@ var {

} = getFileScope();
var {
dir,
file
} = customSplit3(filePath);
parts.unshift(file && file !== 'index' ? file : dir);
var fileAndDir = getFileAndDirFromPath(filePath);
if (fileAndDir) {
var {
dir,
file
} = fileAndDir;
var part = (file !== 'index' ? file : dir) || file;
parts.unshift(part);
}
}

@@ -109,0 +149,0 @@ return parts.join('_');

@@ -61,21 +61,22 @@ 'use strict';

var forwardSlash = 47;
var backSlash = 92;
var getLastSlashBeforeIndex = (path, index) => {
var i = index;
while (i >= 0) {
var codeUnit = path.charCodeAt(i);
if (codeUnit === forwardSlash || codeUnit === backSlash) {
return i;
var forwardSlash = '/'.charCodeAt(0);
var getLastSlashBeforeIndex = (path, startingIndex) => {
var pathIndex = startingIndex;
while (pathIndex >= 0) {
var codeUnit = path.charCodeAt(pathIndex);
if (codeUnit === forwardSlash) {
return pathIndex;
}
// UTF-16 surrogate pair handling
// Check if codeUnit is a low surrogate
if (codeUnit >= 0xdc00 && codeUnit <= 0xdfff) {
// Ensure there's a previous character
if (i > 0) {
var maybeHighSurrogate = path.charCodeAt(i - 1);
if (pathIndex > 0) {
var maybeHighSurrogate = path.charCodeAt(pathIndex - 1);
// Check if the previous code unit is a high surrogate
if (maybeHighSurrogate >= 0xd800 && maybeHighSurrogate <= 0xdbff) {
// Move past the high surrogate and continue
i -= 2;
pathIndex -= 2;
continue;

@@ -85,12 +86,34 @@ }

}
i--;
// At this point, we know we either have a regular character or a lone surrogate, which is
// valid in windows file paths
pathIndex--;
}
return -1;
};
var customSplit3 = path => {
var file = '';
var dir = '';
/**
* Assumptions:
* - The path is always normalized to use posix file separators (see `addFileScope`)
* - The path is always relative to the project root (see `addFileScope`)
* - There's no need to validate the file extension as we know that we only run this function if the
* path was inside a VE file
* */
var _getFileAndDirFromPath = path => {
var file;
var dir;
var lastIndexOfDotCss = path.lastIndexOf('.css');
if (lastIndexOfDotCss === -1) {
return;
}
var i = lastIndexOfDotCss - 1;
var lastSlashIndex = getLastSlashBeforeIndex(path, i);
if (lastSlashIndex === -1) {
return {
file: path.slice(0, lastIndexOfDotCss)
};
}
var secondLastSlashIndex = getLastSlashBeforeIndex(path, lastSlashIndex - 1);
// If secondLastSlashIndex is -1, it means that the path looks like `directory/file.css.ts`,
// in which case dir will still be sliced starting at 0, which is what we want
dir = path.slice(secondLastSlashIndex + 1, lastSlashIndex);

@@ -103,2 +126,15 @@ file = path.slice(lastSlashIndex + 1, lastIndexOfDotCss);

};
var memoizedGetFileAndDirFromPath = () => {
var cache = new Map();
return path => {
if (cache.has(path)) {
return cache.get(path);
}
var result = _getFileAndDirFromPath(path);
cache.set(path, result);
return result;
};
};
var getFileAndDirFromPath = memoizedGetFileAndDirFromPath();
function getDevPrefix(_ref) {

@@ -114,7 +150,11 @@ var {

} = fileScope_dist_vanillaExtractCssFileScope.getFileScope();
var {
dir,
file
} = customSplit3(filePath);
parts.unshift(file && file !== 'index' ? file : dir);
var fileAndDir = getFileAndDirFromPath(filePath);
if (fileAndDir) {
var {
dir,
file
} = fileAndDir;
var part = (file !== 'index' ? file : dir) || file;
parts.unshift(part);
}
}

@@ -121,0 +161,0 @@ return parts.join('_');

@@ -61,21 +61,22 @@ 'use strict';

var forwardSlash = 47;
var backSlash = 92;
var getLastSlashBeforeIndex = (path, index) => {
var i = index;
while (i >= 0) {
var codeUnit = path.charCodeAt(i);
if (codeUnit === forwardSlash || codeUnit === backSlash) {
return i;
var forwardSlash = '/'.charCodeAt(0);
var getLastSlashBeforeIndex = (path, startingIndex) => {
var pathIndex = startingIndex;
while (pathIndex >= 0) {
var codeUnit = path.charCodeAt(pathIndex);
if (codeUnit === forwardSlash) {
return pathIndex;
}
// UTF-16 surrogate pair handling
// Check if codeUnit is a low surrogate
if (codeUnit >= 0xdc00 && codeUnit <= 0xdfff) {
// Ensure there's a previous character
if (i > 0) {
var maybeHighSurrogate = path.charCodeAt(i - 1);
if (pathIndex > 0) {
var maybeHighSurrogate = path.charCodeAt(pathIndex - 1);
// Check if the previous code unit is a high surrogate
if (maybeHighSurrogate >= 0xd800 && maybeHighSurrogate <= 0xdbff) {
// Move past the high surrogate and continue
i -= 2;
pathIndex -= 2;
continue;

@@ -85,12 +86,34 @@ }

}
i--;
// At this point, we know we either have a regular character or a lone surrogate, which is
// valid in windows file paths
pathIndex--;
}
return -1;
};
var customSplit3 = path => {
var file = '';
var dir = '';
/**
* Assumptions:
* - The path is always normalized to use posix file separators (see `addFileScope`)
* - The path is always relative to the project root (see `addFileScope`)
* - There's no need to validate the file extension as we know that we only run this function if the
* path was inside a VE file
* */
var _getFileAndDirFromPath = path => {
var file;
var dir;
var lastIndexOfDotCss = path.lastIndexOf('.css');
if (lastIndexOfDotCss === -1) {
return;
}
var i = lastIndexOfDotCss - 1;
var lastSlashIndex = getLastSlashBeforeIndex(path, i);
if (lastSlashIndex === -1) {
return {
file: path.slice(0, lastIndexOfDotCss)
};
}
var secondLastSlashIndex = getLastSlashBeforeIndex(path, lastSlashIndex - 1);
// If secondLastSlashIndex is -1, it means that the path looks like `directory/file.css.ts`,
// in which case dir will still be sliced starting at 0, which is what we want
dir = path.slice(secondLastSlashIndex + 1, lastSlashIndex);

@@ -103,2 +126,15 @@ file = path.slice(lastSlashIndex + 1, lastIndexOfDotCss);

};
var memoizedGetFileAndDirFromPath = () => {
var cache = new Map();
return path => {
if (cache.has(path)) {
return cache.get(path);
}
var result = _getFileAndDirFromPath(path);
cache.set(path, result);
return result;
};
};
var getFileAndDirFromPath = memoizedGetFileAndDirFromPath();
function getDevPrefix(_ref) {

@@ -114,7 +150,11 @@ var {

} = fileScope_dist_vanillaExtractCssFileScope.getFileScope();
var {
dir,
file
} = customSplit3(filePath);
parts.unshift(file && file !== 'index' ? file : dir);
var fileAndDir = getFileAndDirFromPath(filePath);
if (fileAndDir) {
var {
dir,
file
} = fileAndDir;
var part = (file !== 'index' ? file : dir) || file;
parts.unshift(part);
}
}

@@ -121,0 +161,0 @@ return parts.join('_');

@@ -49,21 +49,22 @@ import { injectStyles } from '../injectStyles/dist/vanilla-extract-css-injectStyles.esm.js';

var forwardSlash = 47;
var backSlash = 92;
var getLastSlashBeforeIndex = (path, index) => {
var i = index;
while (i >= 0) {
var codeUnit = path.charCodeAt(i);
if (codeUnit === forwardSlash || codeUnit === backSlash) {
return i;
var forwardSlash = '/'.charCodeAt(0);
var getLastSlashBeforeIndex = (path, startingIndex) => {
var pathIndex = startingIndex;
while (pathIndex >= 0) {
var codeUnit = path.charCodeAt(pathIndex);
if (codeUnit === forwardSlash) {
return pathIndex;
}
// UTF-16 surrogate pair handling
// Check if codeUnit is a low surrogate
if (codeUnit >= 0xdc00 && codeUnit <= 0xdfff) {
// Ensure there's a previous character
if (i > 0) {
var maybeHighSurrogate = path.charCodeAt(i - 1);
if (pathIndex > 0) {
var maybeHighSurrogate = path.charCodeAt(pathIndex - 1);
// Check if the previous code unit is a high surrogate
if (maybeHighSurrogate >= 0xd800 && maybeHighSurrogate <= 0xdbff) {
// Move past the high surrogate and continue
i -= 2;
pathIndex -= 2;
continue;

@@ -73,12 +74,34 @@ }

}
i--;
// At this point, we know we either have a regular character or a lone surrogate, which is
// valid in windows file paths
pathIndex--;
}
return -1;
};
var customSplit3 = path => {
var file = '';
var dir = '';
/**
* Assumptions:
* - The path is always normalized to use posix file separators (see `addFileScope`)
* - The path is always relative to the project root (see `addFileScope`)
* - There's no need to validate the file extension as we know that we only run this function if the
* path was inside a VE file
* */
var _getFileAndDirFromPath = path => {
var file;
var dir;
var lastIndexOfDotCss = path.lastIndexOf('.css');
if (lastIndexOfDotCss === -1) {
return;
}
var i = lastIndexOfDotCss - 1;
var lastSlashIndex = getLastSlashBeforeIndex(path, i);
if (lastSlashIndex === -1) {
return {
file: path.slice(0, lastIndexOfDotCss)
};
}
var secondLastSlashIndex = getLastSlashBeforeIndex(path, lastSlashIndex - 1);
// If secondLastSlashIndex is -1, it means that the path looks like `directory/file.css.ts`,
// in which case dir will still be sliced starting at 0, which is what we want
dir = path.slice(secondLastSlashIndex + 1, lastSlashIndex);

@@ -91,2 +114,15 @@ file = path.slice(lastSlashIndex + 1, lastIndexOfDotCss);

};
var memoizedGetFileAndDirFromPath = () => {
var cache = new Map();
return path => {
if (cache.has(path)) {
return cache.get(path);
}
var result = _getFileAndDirFromPath(path);
cache.set(path, result);
return result;
};
};
var getFileAndDirFromPath = memoizedGetFileAndDirFromPath();
function getDevPrefix(_ref) {

@@ -102,7 +138,11 @@ var {

} = getFileScope();
var {
dir,
file
} = customSplit3(filePath);
parts.unshift(file && file !== 'index' ? file : dir);
var fileAndDir = getFileAndDirFromPath(filePath);
if (fileAndDir) {
var {
dir,
file
} = fileAndDir;
var part = (file !== 'index' ? file : dir) || file;
parts.unshift(part);
}
}

@@ -109,0 +149,0 @@ return parts.join('_');

{
"name": "@vanilla-extract/css",
"version": "0.0.0-perf-dev-prefix-20240820014053",
"version": "0.0.0-perf-dev-prefix-20240820044103",
"description": "Zero-runtime Stylesheets-in-TypeScript",

@@ -5,0 +5,0 @@ "sideEffects": true,

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc