Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sketch-hq/sketch-assistant-utils

Package Overview
Dependencies
Maintainers
3
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sketch-hq/sketch-assistant-utils - npm Package Compare versions

Comparing version 2.0.2 to 2.0.3

6

CHANGELOG.md
# @sketch-hq/sketch-assistant-utils
## 2.0.3
### Patch Changes
- ba23962: Support Assistants exported as default exports from an ES Module
## 2.0.2

@@ -4,0 +10,0 @@

4

dist/cjs/assistant/index.d.ts

@@ -1,6 +0,6 @@

import { AssistantDefinition, Assistant, AssistantEnv, Maybe, RuleDefinition } from '../types';
import { AssistantDefinition, Assistant, AssistantEnv, Maybe, RuleDefinition, ESModuleInterop } from '../types';
declare const assign: (...sources: AssistantDefinition[]) => AssistantDefinition;
declare const prepare: (source: import("../types").ValueOrArray<Assistant>, env: AssistantEnv) => Promise<AssistantDefinition>;
declare const prepare: (source: import("../types").ValueOrArray<Assistant | ESModuleInterop<Assistant>>, env: AssistantEnv) => Promise<AssistantDefinition>;
declare const getRuleDefinition: (assistant: AssistantDefinition, ruleName: string) => Maybe<RuleDefinition>;
export { prepare, assign, getRuleDefinition };
//# sourceMappingURL=index.d.ts.map

@@ -27,5 +27,14 @@ "use strict";

const prepare = (source, env) => __awaiter(void 0, void 0, void 0, function* () {
const functions = Array.isArray(source) ? source.flat(Infinity) : [source];
const assistants = yield Promise.all(functions.map(f => f(env)));
return assign(...assistants);
const definitions = yield Promise.all((Array.isArray(source) ? source : [source])
.flat(Infinity)
.map((item) => {
if ('__esModule' in item) {
return item.default;
}
else {
return item;
}
})
.map(f => f(env)));
return assign(...definitions);
});

@@ -32,0 +41,0 @@ exports.prepare = prepare;

@@ -92,3 +92,7 @@ import { FileFormat3 } from '@sketch-hq/sketch-file-format-ts';

export declare type Assistant = (env: AssistantEnv) => Promise<AssistantDefinition>;
export declare type AssistantPackageExport = ValueOrArray<Assistant>;
export declare type ESModuleInterop<DefaultExport> = {
__esModule: true;
default: DefaultExport;
};
export declare type AssistantPackageExport = ValueOrArray<Assistant | ESModuleInterop<Assistant>>;
export declare type AssistantDefinition = {

@@ -95,0 +99,0 @@ rules: RuleDefinition[];

@@ -1,6 +0,6 @@

import { AssistantDefinition, Assistant, AssistantEnv, Maybe, RuleDefinition } from '../types';
import { AssistantDefinition, Assistant, AssistantEnv, Maybe, RuleDefinition, ESModuleInterop } from '../types';
declare const assign: (...sources: AssistantDefinition[]) => AssistantDefinition;
declare const prepare: (source: import("../types").ValueOrArray<Assistant>, env: AssistantEnv) => Promise<AssistantDefinition>;
declare const prepare: (source: import("../types").ValueOrArray<Assistant | ESModuleInterop<Assistant>>, env: AssistantEnv) => Promise<AssistantDefinition>;
declare const getRuleDefinition: (assistant: AssistantDefinition, ruleName: string) => Maybe<RuleDefinition>;
export { prepare, assign, getRuleDefinition };
//# sourceMappingURL=index.d.ts.map

@@ -24,5 +24,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

const prepare = (source, env) => __awaiter(void 0, void 0, void 0, function* () {
const functions = Array.isArray(source) ? source.flat(Infinity) : [source];
const assistants = yield Promise.all(functions.map(f => f(env)));
return assign(...assistants);
const definitions = yield Promise.all((Array.isArray(source) ? source : [source])
.flat(Infinity)
.map((item) => {
if ('__esModule' in item) {
return item.default;
}
else {
return item;
}
})
.map(f => f(env)));
return assign(...definitions);
});

@@ -29,0 +38,0 @@ const getRuleDefinition = (assistant, ruleName) => assistant.rules.find(rule => rule.name === ruleName);

@@ -92,3 +92,7 @@ import { FileFormat3 } from '@sketch-hq/sketch-file-format-ts';

export declare type Assistant = (env: AssistantEnv) => Promise<AssistantDefinition>;
export declare type AssistantPackageExport = ValueOrArray<Assistant>;
export declare type ESModuleInterop<DefaultExport> = {
__esModule: true;
default: DefaultExport;
};
export declare type AssistantPackageExport = ValueOrArray<Assistant | ESModuleInterop<Assistant>>;
export declare type AssistantDefinition = {

@@ -95,0 +99,0 @@ rules: RuleDefinition[];

{
"name": "@sketch-hq/sketch-assistant-utils",
"version": "2.0.2",
"version": "2.0.3",
"module": "dist/esm/index",

@@ -5,0 +5,0 @@ "main": "dist/cjs/index",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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