@vanilla-extract/private
Advanced tools
Comparing version 0.0.0-vite-plugin-new-20240115025310 to 0.0.0-vite-plugin-new-20240115050437
@@ -6,3 +6,3 @@ 'use strict'; | ||
function getVarName(variable) { | ||
const matches = variable.match(/^var\((.*)\)$/); | ||
var matches = variable.match(/^var\((.*)\)$/); | ||
if (matches) { | ||
@@ -15,6 +15,6 @@ return matches[1]; | ||
function get(obj, path) { | ||
let result = obj; | ||
for (const key of path) { | ||
var result = obj; | ||
for (var key of path) { | ||
if (!(key in result)) { | ||
throw new Error(`Path ${path.join(' -> ')} does not exist in object`); | ||
throw new Error("Path ".concat(path.join(' -> '), " does not exist in object")); | ||
} | ||
@@ -26,13 +26,14 @@ result = result[key]; | ||
function walkObject(obj, fn, path = []) { | ||
const clone = obj.constructor(); | ||
for (let key in obj) { | ||
const value = obj[key]; | ||
const currentPath = [...path, key]; | ||
if (typeof value === 'string' || typeof value === 'number' || value == null) { | ||
clone[key] = fn(value, currentPath); | ||
} else if (typeof value === 'object' && !Array.isArray(value)) { | ||
clone[key] = walkObject(value, fn, currentPath); | ||
function walkObject(obj, fn) { | ||
var path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; | ||
var clone = obj.constructor(); | ||
for (var key in obj) { | ||
var _value = obj[key]; | ||
var currentPath = [...path, key]; | ||
if (typeof _value === 'string' || typeof _value === 'number' || _value == null) { | ||
clone[key] = fn(_value, currentPath); | ||
} else if (typeof _value === 'object' && !Array.isArray(_value)) { | ||
clone[key] = walkObject(_value, fn, currentPath); | ||
} else { | ||
console.warn(`Skipping invalid key "${currentPath.join('.')}". Should be a string, number, null or object. Received: "${Array.isArray(value) ? 'Array' : typeof value}"`); | ||
console.warn("Skipping invalid key \"".concat(currentPath.join('.'), "\". Should be a string, number, null or object. Received: \"").concat(Array.isArray(_value) ? 'Array' : typeof _value, "\"")); | ||
} | ||
@@ -39,0 +40,0 @@ } |
@@ -6,3 +6,3 @@ 'use strict'; | ||
function getVarName(variable) { | ||
const matches = variable.match(/^var\((.*)\)$/); | ||
var matches = variable.match(/^var\((.*)\)$/); | ||
if (matches) { | ||
@@ -15,6 +15,6 @@ return matches[1]; | ||
function get(obj, path) { | ||
let result = obj; | ||
for (const key of path) { | ||
var result = obj; | ||
for (var key of path) { | ||
if (!(key in result)) { | ||
throw new Error(`Path ${path.join(' -> ')} does not exist in object`); | ||
throw new Error("Path ".concat(path.join(' -> '), " does not exist in object")); | ||
} | ||
@@ -26,13 +26,14 @@ result = result[key]; | ||
function walkObject(obj, fn, path = []) { | ||
const clone = obj.constructor(); | ||
for (let key in obj) { | ||
const value = obj[key]; | ||
const currentPath = [...path, key]; | ||
if (typeof value === 'string' || typeof value === 'number' || value == null) { | ||
clone[key] = fn(value, currentPath); | ||
} else if (typeof value === 'object' && !Array.isArray(value)) { | ||
clone[key] = walkObject(value, fn, currentPath); | ||
function walkObject(obj, fn) { | ||
var path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; | ||
var clone = obj.constructor(); | ||
for (var key in obj) { | ||
var _value = obj[key]; | ||
var currentPath = [...path, key]; | ||
if (typeof _value === 'string' || typeof _value === 'number' || _value == null) { | ||
clone[key] = fn(_value, currentPath); | ||
} else if (typeof _value === 'object' && !Array.isArray(_value)) { | ||
clone[key] = walkObject(_value, fn, currentPath); | ||
} else { | ||
console.warn(`Skipping invalid key "${currentPath.join('.')}". Should be a string, number, null or object. Received: "${Array.isArray(value) ? 'Array' : typeof value}"`); | ||
console.warn("Skipping invalid key \"".concat(currentPath.join('.'), "\". Should be a string, number, null or object. Received: \"").concat(Array.isArray(_value) ? 'Array' : typeof _value, "\"")); | ||
} | ||
@@ -39,0 +40,0 @@ } |
function getVarName(variable) { | ||
const matches = variable.match(/^var\((.*)\)$/); | ||
var matches = variable.match(/^var\((.*)\)$/); | ||
if (matches) { | ||
@@ -10,6 +10,6 @@ return matches[1]; | ||
function get(obj, path) { | ||
let result = obj; | ||
for (const key of path) { | ||
var result = obj; | ||
for (var key of path) { | ||
if (!(key in result)) { | ||
throw new Error(`Path ${path.join(' -> ')} does not exist in object`); | ||
throw new Error("Path ".concat(path.join(' -> '), " does not exist in object")); | ||
} | ||
@@ -21,13 +21,14 @@ result = result[key]; | ||
function walkObject(obj, fn, path = []) { | ||
const clone = obj.constructor(); | ||
for (let key in obj) { | ||
const value = obj[key]; | ||
const currentPath = [...path, key]; | ||
if (typeof value === 'string' || typeof value === 'number' || value == null) { | ||
clone[key] = fn(value, currentPath); | ||
} else if (typeof value === 'object' && !Array.isArray(value)) { | ||
clone[key] = walkObject(value, fn, currentPath); | ||
function walkObject(obj, fn) { | ||
var path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; | ||
var clone = obj.constructor(); | ||
for (var key in obj) { | ||
var _value = obj[key]; | ||
var currentPath = [...path, key]; | ||
if (typeof _value === 'string' || typeof _value === 'number' || _value == null) { | ||
clone[key] = fn(_value, currentPath); | ||
} else if (typeof _value === 'object' && !Array.isArray(_value)) { | ||
clone[key] = walkObject(_value, fn, currentPath); | ||
} else { | ||
console.warn(`Skipping invalid key "${currentPath.join('.')}". Should be a string, number, null or object. Received: "${Array.isArray(value) ? 'Array' : typeof value}"`); | ||
console.warn("Skipping invalid key \"".concat(currentPath.join('.'), "\". Should be a string, number, null or object. Received: \"").concat(Array.isArray(_value) ? 'Array' : typeof _value, "\"")); | ||
} | ||
@@ -34,0 +35,0 @@ } |
{ | ||
"name": "@vanilla-extract/private", | ||
"version": "0.0.0-vite-plugin-new-20240115025310", | ||
"version": "0.0.0-vite-plugin-new-20240115050437", | ||
"description": "Zero-runtime Stylesheets-in-TypeScript", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9851
132