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

@inlang/core

Package Overview
Dependencies
Maintainers
2
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@inlang/core - npm Package Compare versions

Comparing version 0.9.0 to 0.9.1

2

dist/plugin/createPlugin.d.ts
import type { InlangEnvironment } from "../environment/types.js";
import type { PluginSetupFunction, Plugin } from "./types.js";
export declare function createPlugin<PluginSettings extends Record<string, unknown> | undefined = undefined>(callback: (args: {
settings?: PluginSettings;
settings: PluginSettings;
env: InlangEnvironment;
}) => Plugin): PluginSettings extends undefined ? () => PluginSetupFunction : (settings?: PluginSettings) => PluginSetupFunction;
//# sourceMappingURL=createPlugin.d.ts.map
{
"name": "@inlang/core",
"type": "module",
"version": "0.9.0",
"version": "0.9.1",
"publishConfig": {

@@ -6,0 +6,0 @@ "access": "public"

import { it, expect } from "vitest"
import { createPlugin } from "./createPlugin.js"
import type { InlangEnvironment } from "../environment/types.js"
import { expectType } from "tsd"
it("should be possible to define a plugin without settings and the type should be undefined", () => {
createPlugin(({ settings }) => {
expectType<undefined>(settings)
return {} as any
})
})
it('should have defined settings if "createPlugin" is called with a settings type', () => {
createPlugin<{ pathPattern: string }>((args) => {
expectType<object>(args.settings)
expectType<string>(args.settings?.pathPattern)
return {} as any
})
})
it("should be possible to define a plugin", () => {

@@ -6,0 +22,0 @@ const myPlugin = createPlugin<{ pathPattern: string }>(({ settings }) => {

@@ -7,3 +7,3 @@ import type { InlangEnvironment } from "../environment/types.js"

>(
callback: (args: { settings?: PluginSettings; env: InlangEnvironment }) => Plugin,
callback: (args: { settings: PluginSettings; env: InlangEnvironment }) => Plugin,
): PluginSettings extends undefined

@@ -10,0 +10,0 @@ ? () => PluginSetupFunction

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