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

@wixc3/engine-core

Package Overview
Dependencies
Maintainers
0
Versions
333
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wixc3/engine-core - npm Package Compare versions

Comparing version 45.7.3 to 45.8.0

19

dist/helpers/web.d.ts

@@ -0,2 +1,21 @@

import { IRunOptions } from '../types';
export declare function injectScript(win: Window, rootComId: string, scriptUrl: string): Promise<Window>;
interface EngineWebEntryGlobalObj {
document?: {
currentScript: {
dataset: {
engineRunOptions?: string | null;
};
} | null;
};
location?: {
search?: string;
};
engineEntryOptions?: (options: {
currentRunOptions: IRunOptions;
envName: string;
}) => IRunOptions;
}
export declare function getEngineEntryOptions(envName: string, globalObj: EngineWebEntryGlobalObj): IRunOptions;
export {};
//# sourceMappingURL=web.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.injectScript = injectScript;
exports.getEngineEntryOptions = getEngineEntryOptions;
function injectScript(win, rootComId, scriptUrl) {

@@ -15,2 +16,13 @@ return new Promise((res, rej) => {

}
function getEngineEntryOptions(envName, globalObj) {
const urlParams = new URLSearchParams(globalObj?.location?.search);
const currentScript = globalObj?.document?.currentScript;
const optionsFromScript = new URLSearchParams(currentScript && currentScript.dataset.engineRunOptions || undefined);
const optionsBeforeInject = new Map([...optionsFromScript, ...urlParams]);
const optionsAfterInject = globalObj?.engineEntryOptions?.({
currentRunOptions: optionsBeforeInject,
envName
});
return optionsAfterInject || optionsBeforeInject;
}
//# sourceMappingURL=web.js.map

1

dist/types.d.ts

@@ -96,2 +96,3 @@ import type { LogMessage } from './common-types.js';

entries(): IterableIterator<[string, string | string[] | boolean | null | undefined]>;
[Symbol.iterator](): IterableIterator<[string, string | string[] | boolean | null | undefined]>;
}

@@ -98,0 +99,0 @@ export type RegisteringFeature<API extends EntityRecord, ENV extends AnyEnvironment, ProvidedOutputs extends MapTypesForEnv<GetOutputs<API>, ENV, 'providedFrom'> = MapTypesForEnv<GetOutputs<API>, ENV, 'providedFrom'>> = keyof ProvidedOutputs extends never ? undefined | void : ProvidedOutputs;

2

package.json
{
"name": "@wixc3/engine-core",
"version": "45.7.3",
"version": "45.8.0",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "exports": {

@@ -0,1 +1,3 @@

import { IRunOptions } from '../types';
export function injectScript(win: Window, rootComId: string, scriptUrl: string) {

@@ -12,1 +14,21 @@ return new Promise<Window>((res, rej) => {

}
interface EngineWebEntryGlobalObj {
document?: { currentScript: { dataset: { engineRunOptions?: string | null } } | null },
location?: { search?: string }
engineEntryOptions?: (options: { currentRunOptions: IRunOptions; envName: string }) => IRunOptions;
}
export function getEngineEntryOptions(envName: string, globalObj: EngineWebEntryGlobalObj): IRunOptions {
const urlParams = new URLSearchParams(globalObj?.location?.search);
const currentScript = globalObj?.document?.currentScript;
const optionsFromScript = new URLSearchParams(currentScript && currentScript.dataset.engineRunOptions || undefined);
const optionsBeforeInject = new Map([...optionsFromScript, ...urlParams]);
const optionsAfterInject = globalObj?.engineEntryOptions?.({
currentRunOptions: optionsBeforeInject,
envName
});
return optionsAfterInject || optionsBeforeInject;
}

@@ -174,2 +174,4 @@ import type { LogMessage } from './common-types.js';

entries(): IterableIterator<[string, string | string[] | boolean | null | undefined]>;
[Symbol.iterator](): IterableIterator<[string, string | string[] | boolean | null | undefined]>;
}

@@ -176,0 +178,0 @@

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 too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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