@pandacss/shared
Advanced tools
Comparing version 0.0.0-dev-20230106112845 to 0.0.0-dev-20230106183338
@@ -49,2 +49,6 @@ import { W as WalkObjectStopFn, M as MappedObject, C as CreateCssContext } from './walk-styles-87886790.js'; | ||
type Dict = Record<string, unknown>; | ||
type PickFn = (key: string) => boolean; | ||
declare function splitObject(obj: Dict, pickFn: PickFn): Dict[]; | ||
type MapToRecord<K extends Map<string, any>> = { | ||
@@ -57,2 +61,2 @@ [P in keyof K]: K[P] extends Map<string, infer V> ? Record<string, V> : never; | ||
export { CssVar, CssVarOptions, calc, capitalize, cssVar, dashCase, esc, flatten, getDotPath, getNegativePath, getUnit, isFunction, isObject, isString, mapToJson, memo, normalizeStyleObject, splitBy, splitDotPath, toEm, toPx, toRem, uncapitalize, unionType }; | ||
export { CssVar, CssVarOptions, calc, capitalize, cssVar, dashCase, esc, flatten, getDotPath, getNegativePath, getUnit, isFunction, isObject, isString, mapToJson, memo, normalizeStyleObject, splitBy, splitDotPath, splitObject, toEm, toPx, toRem, uncapitalize, unionType }; |
@@ -46,2 +46,3 @@ "use strict"; | ||
splitDotPath: () => splitDotPath, | ||
splitObject: () => splitObject, | ||
toEm: () => toEm, | ||
@@ -404,2 +405,16 @@ toHash: () => toHash, | ||
// src/split-object.ts | ||
function splitObject(obj, pickFn) { | ||
const omitted = {}; | ||
const picked = {}; | ||
for (const [key, value] of Object.entries(obj)) { | ||
if (pickFn(key)) { | ||
picked[key] = value; | ||
} else { | ||
omitted[key] = value; | ||
} | ||
} | ||
return [picked, omitted]; | ||
} | ||
// src/to-json.ts | ||
@@ -447,2 +462,3 @@ function mapToJson(map) { | ||
splitDotPath, | ||
splitObject, | ||
toEm, | ||
@@ -449,0 +465,0 @@ toHash, |
@@ -35,8 +35,2 @@ "use strict"; | ||
// src/condition.ts | ||
var isBaseCondition = (c) => /^(base|_)$/.test(c); | ||
function filterBaseConditions(c) { | ||
return c.slice().filter((v) => !isBaseCondition(v)); | ||
} | ||
// src/css-important.ts | ||
@@ -53,2 +47,8 @@ function isImportant(value) { | ||
// src/condition.ts | ||
var isBaseCondition = (c) => /^(base|_)$/.test(c); | ||
function filterBaseConditions(c) { | ||
return c.slice().filter((v) => !isBaseCondition(v)); | ||
} | ||
// src/hash.ts | ||
@@ -55,0 +55,0 @@ function toChar(code) { |
{ | ||
"name": "@pandacss/shared", | ||
"version": "0.0.0-dev-20230106112845", | ||
"version": "0.0.0-dev-20230106183338", | ||
"description": "Shared utilities for css panda", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
42382
1294