@supernova-studio/model 0.58.21 → 0.58.23

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supernova-studio/model",
3
- "version": "0.58.21",
3
+ "version": "0.58.23",
4
4
  "description": "Supernova Data Models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -66,7 +66,7 @@ export type FeatureFlagsKeepAliases = z.infer<typeof FeatureFlagsKeepAliases>;
66
66
  export const FigmaImportContextWithSourcesState = FigmaImportBaseContext.extend({
67
67
  sourcesWithMissingAccess: z.array(z.string()).default([]),
68
68
  shadowOpacityOptional: z.boolean().default(false),
69
- featureFlagsKeepAliases: FeatureFlagsKeepAliases.default({})
69
+ featureFlagsKeepAliases: FeatureFlagsKeepAliases.default({}),
70
70
  });
71
71
 
72
72
  export type FigmaImportContextWithSourcesState = z.infer<typeof FigmaImportContextWithSourcesState>;
@@ -7,7 +7,7 @@ export const FlaggedFeature = z.enum([
7
7
  "VariablesOrder",
8
8
  "TypographyPropsKeepAliases",
9
9
  "GradientPropsKeepAliases",
10
- "ShadowPropsKeepAliases"
10
+ "ShadowPropsKeepAliases",
11
11
  ]);
12
12
  export const FeatureFlagMap = z.record(FlaggedFeature, z.boolean());
13
13
  export const FeatureFlag = z.object({
@@ -166,6 +166,12 @@ export function chunkedArray<V>(array: V[], chunkSize: number): V[][] {
166
166
  return result;
167
167
  }
168
168
 
169
+ export function recordToMap<V>(record: Record<string, V>): Map<string, V> {
170
+ const map = new Map<string, V>();
171
+ for (const [k, v] of Object.entries(record)) map.set(k, v);
172
+ return map;
173
+ }
174
+
169
175
  export type Pagination = {
170
176
  skip?: number;
171
177
  take?: number;