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

@wix/metro-runtime

Package Overview
Dependencies
Maintainers
20
Versions
439
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wix/metro-runtime - npm Package Compare versions

Comparing version 1.1494.0 to 1.1495.0

4

dist/cjs/url-resolver.js

@@ -9,5 +9,7 @@ "use strict";

const WIX_API_DOMAINS = ['42.wixprod.net', 'uw2-edt-1.wixprod.net'];
const DEV_WIX_CODE_DOMAIN = 'dev.wix-code.com';
const REGEX_CAPTURE_PROTO_FIELD = /{(.*)}/;
const REGEX_CAPTURE_DOMAINS = new RegExp(`\\.(${DOMAINS.join('|')})$`);
const REGEX_CAPTURE_API_DOMAINS = new RegExp(`\\.(${WIX_API_DOMAINS.join('|')})$`);
const REGEX_CAPTURE_DEV_WIX_CODE_DOMAIN = new RegExp(`.*\\.${DEV_WIX_CODE_DOMAIN}$`);
function resolveUrl(opts) {

@@ -33,3 +35,3 @@ const domain = resolveDomain(opts.host);

const resolvedHost = fixHostExceptions(host);
return resolvedHost.replace(REGEX_CAPTURE_DOMAINS, '._base_domain_').replace(REGEX_CAPTURE_API_DOMAINS, '._api_base_domain_');
return resolvedHost.replace(REGEX_CAPTURE_DOMAINS, '._base_domain_').replace(REGEX_CAPTURE_API_DOMAINS, '._api_base_domain_').replace(REGEX_CAPTURE_DEV_WIX_CODE_DOMAIN, '*.dev.wix-code.com');
}

@@ -36,0 +38,0 @@

@@ -5,5 +5,7 @@ import { findByPath } from './utils';

var WIX_API_DOMAINS = ['42.wixprod.net', 'uw2-edt-1.wixprod.net'];
var DEV_WIX_CODE_DOMAIN = 'dev.wix-code.com';
var REGEX_CAPTURE_PROTO_FIELD = /{(.*)}/;
var REGEX_CAPTURE_DOMAINS = new RegExp("\\.(".concat(DOMAINS.join('|'), ")$"));
var REGEX_CAPTURE_API_DOMAINS = new RegExp("\\.(".concat(WIX_API_DOMAINS.join('|'), ")$"));
var REGEX_CAPTURE_DEV_WIX_CODE_DOMAIN = new RegExp(".*\\.".concat(DEV_WIX_CODE_DOMAIN, "$"));
export function resolveUrl(opts) {

@@ -34,3 +36,4 @@ var domain = resolveDomain(opts.host);

.replace(REGEX_CAPTURE_DOMAINS, '._base_domain_')
.replace(REGEX_CAPTURE_API_DOMAINS, '._api_base_domain_');
.replace(REGEX_CAPTURE_API_DOMAINS, '._api_base_domain_')
.replace(REGEX_CAPTURE_DEV_WIX_CODE_DOMAIN, '*.dev.wix-code.com');
}

@@ -37,0 +40,0 @@ // hosts which standard string replacing doesn't apply to them, will be fixed here.

{
"metro-runtime.js": "https://static.parastorage.com/services/metro-runtime/7e18dca23ee67a31f2019049442244d63a97339fb4b208648024fb4d/metro-runtime.umd.js"
"metro-runtime.js": "https://static.parastorage.com/services/metro-runtime/fe0c9969fb46755d5a3ef7ed76785c1961ee1f527b028f81cc55f999/metro-runtime.umd.js"
}
{
"metro-runtime.js": "https://static.parastorage.com/services/metro-runtime/7e18dca23ee67a31f2019049442244d63a97339fb4b208648024fb4d/metro-runtime.umd.min.js"
"metro-runtime.js": "https://static.parastorage.com/services/metro-runtime/fe0c9969fb46755d5a3ef7ed76785c1961ee1f527b028f81cc55f999/metro-runtime.umd.min.js"
}

@@ -68,3 +68,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

;// CONCATENATED MODULE: ./url-resolver.ts
var USER_DOMAIN='_';var DOMAINS=['wix.com','editorx.com'];var WIX_API_DOMAINS=['42.wixprod.net','uw2-edt-1.wixprod.net'];var REGEX_CAPTURE_PROTO_FIELD=/{(.*)}/;var REGEX_CAPTURE_DOMAINS=new RegExp("\\.("+DOMAINS.join('|')+")$");var REGEX_CAPTURE_API_DOMAINS=new RegExp("\\.("+WIX_API_DOMAINS.join('|')+")$");function resolveUrl(opts){var domain=resolveDomain(opts.host);var mappings=resolveMappingsByDomain(domain,opts.domainToMappings);var path=injectDataIntoProtoPath(opts.protoPath,opts.data||{});return resolvePath(path,mappings);}function injectDataIntoProtoPath(protoPath,data){return protoPath.split('/').map(function(path){return maybeProtoPathToData(path,data);}).join('/');}function maybeProtoPathToData(protoPath,data){var protoRegExpMatch=protoPath.match(REGEX_CAPTURE_PROTO_FIELD)||[];var field=protoRegExpMatch[1];if(field){var suffix=protoPath.replace(protoRegExpMatch[0],'');return findByPath(data,field,protoPath,suffix);}return protoPath;}function resolveDomain(host){var resolvedHost=fixHostExceptions(host);return resolvedHost.replace(REGEX_CAPTURE_DOMAINS,'._base_domain_').replace(REGEX_CAPTURE_API_DOMAINS,'._api_base_domain_');}// hosts which standard string replacing doesn't apply to them, will be fixed here.
var USER_DOMAIN='_';var DOMAINS=['wix.com','editorx.com'];var WIX_API_DOMAINS=['42.wixprod.net','uw2-edt-1.wixprod.net'];var DEV_WIX_CODE_DOMAIN='dev.wix-code.com';var REGEX_CAPTURE_PROTO_FIELD=/{(.*)}/;var REGEX_CAPTURE_DOMAINS=new RegExp("\\.("+DOMAINS.join('|')+")$");var REGEX_CAPTURE_API_DOMAINS=new RegExp("\\.("+WIX_API_DOMAINS.join('|')+")$");var REGEX_CAPTURE_DEV_WIX_CODE_DOMAIN=new RegExp(".*\\."+DEV_WIX_CODE_DOMAIN+"$");function resolveUrl(opts){var domain=resolveDomain(opts.host);var mappings=resolveMappingsByDomain(domain,opts.domainToMappings);var path=injectDataIntoProtoPath(opts.protoPath,opts.data||{});return resolvePath(path,mappings);}function injectDataIntoProtoPath(protoPath,data){return protoPath.split('/').map(function(path){return maybeProtoPathToData(path,data);}).join('/');}function maybeProtoPathToData(protoPath,data){var protoRegExpMatch=protoPath.match(REGEX_CAPTURE_PROTO_FIELD)||[];var field=protoRegExpMatch[1];if(field){var suffix=protoPath.replace(protoRegExpMatch[0],'');return findByPath(data,field,protoPath,suffix);}return protoPath;}function resolveDomain(host){var resolvedHost=fixHostExceptions(host);return resolvedHost.replace(REGEX_CAPTURE_DOMAINS,'._base_domain_').replace(REGEX_CAPTURE_API_DOMAINS,'._api_base_domain_').replace(REGEX_CAPTURE_DEV_WIX_CODE_DOMAIN,'*.dev.wix-code.com');}// hosts which standard string replacing doesn't apply to them, will be fixed here.
function fixHostExceptions(host){// https://system-kb.wixanswers.com/kb/en/article/editorx-domains-matching-to-wixcom

@@ -71,0 +71,0 @@ return host.replace('create.editorx.com','editor.editorx.com');}function resolveMappingsByDomain(domain,domainToMappings){var mappings=domainToMappings[domain]||domainToMappings[USER_DOMAIN];if(!mappings){if(isBaseDomain(domain)){// fallback <lang>.wix.com sub domains to www.wix.com

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

!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("counter",[],r):"object"==typeof exports?exports.counter=r():e.counter=r()}("undefined"!=typeof self?self:this,(function(){return function(){"use strict";var e={d:function(r,t){for(var n in t)e.o(t,n)&&!e.o(r,n)&&Object.defineProperty(r,n,{enumerable:!0,get:t[n]})},o:function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},r={};function t(e){void 0===e&&(e="");var r=n(e),t=r[0],o=r[1];return o?{schemaName:o,schemaType:t}:{schemaName:t}}e.r(r),e.d(r,{parseLeanSchemaRef:function(){return t},resolveUrl:function(){return f},toURLSearchParams:function(){return d}});var n=function(e){return e.split("#")};function o(e,r){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=function(e,r){if(!e)return;if("string"==typeof e)return a(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return a(e,r)}(e))||r&&e&&"number"==typeof e.length){t&&(e=t);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var i=/{(.*)}/,u=new RegExp("\\.("+["wix.com","editorx.com"].join("|")+")$"),c=new RegExp("\\.("+["42.wixprod.net","uw2-edt-1.wixprod.net"].join("|")+")$");function f(e){var r,t,n=function(e,r){var t=r[e]||r._;if(!t&&function(e){return!!e.match(/\._base_domain_$/)}(e))return r[l];return t}(function(e){return e.replace("create.editorx.com","editor.editorx.com")}(e.host).replace(u,"._base_domain_").replace(c,"._api_base_domain_"),e.domainToMappings);return function(e,r){var t=null==r?void 0:r.find((function(r){return e.startsWith(r.destPath)}));if(!t)return e;return t.srcPath+e.slice(t.destPath.length)}((r=e.protoPath,t=e.data||{},r.split("/").map((function(e){return function(e,r){var t=e.match(i)||[],n=t[1];if(n){var a=e.replace(t[0],"");return function(e,r,t,n){for(var a,i=e,u=o(r.split("."));!(a=u()).done;){var c=a.value;if(!i)return t;i=i[c]}return""+i+n}(r,n,e,a)}return e}(e,t)})).join("/")),n)}var l="www._base_domain_";function s(e,r){void 0===r&&(r="");var t={};return Object.entries(e).forEach((function(e){var n=e[0],o=e[1],a=null!==o&&"object"==typeof o&&!Array.isArray(o),i=function(e,r){return e+(e?".":"")+r}(r,n);if(a){var u=s(o,i);Object.assign(t,u)}else t[i]=o})),t}function d(e){var r=s(e);return Object.entries(r).reduce((function(e,r){var t=r[0],n=r[1];return(Array.isArray(n)?n:[n]).forEach((function(r){null!=r&&e.append(t,r)})),e}),new URLSearchParams)}return r}()}));
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("counter",[],r):"object"==typeof exports?exports.counter=r():e.counter=r()}("undefined"!=typeof self?self:this,(function(){return function(){"use strict";var e={d:function(r,t){for(var n in t)e.o(t,n)&&!e.o(r,n)&&Object.defineProperty(r,n,{enumerable:!0,get:t[n]})},o:function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},r={};function t(e){void 0===e&&(e="");var r=n(e),t=r[0],o=r[1];return o?{schemaName:o,schemaType:t}:{schemaName:t}}e.r(r),e.d(r,{parseLeanSchemaRef:function(){return t},resolveUrl:function(){return l},toURLSearchParams:function(){return p}});var n=function(e){return e.split("#")};function o(e,r){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=function(e,r){if(!e)return;if("string"==typeof e)return a(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return a(e,r)}(e))||r&&e&&"number"==typeof e.length){t&&(e=t);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var i=/{(.*)}/,u=new RegExp("\\.("+["wix.com","editorx.com"].join("|")+")$"),c=new RegExp("\\.("+["42.wixprod.net","uw2-edt-1.wixprod.net"].join("|")+")$"),f=new RegExp(".*\\.dev.wix-code.com$");function l(e){var r,t,n=function(e,r){var t=r[e]||r._;if(!t&&function(e){return!!e.match(/\._base_domain_$/)}(e))return r[d];return t}(function(e){return e.replace("create.editorx.com","editor.editorx.com")}(e.host).replace(u,"._base_domain_").replace(c,"._api_base_domain_").replace(f,"*.dev.wix-code.com"),e.domainToMappings);return function(e,r){var t=null==r?void 0:r.find((function(r){return e.startsWith(r.destPath)}));if(!t)return e;return t.srcPath+e.slice(t.destPath.length)}((r=e.protoPath,t=e.data||{},r.split("/").map((function(e){return function(e,r){var t=e.match(i)||[],n=t[1];if(n){var a=e.replace(t[0],"");return function(e,r,t,n){for(var a,i=e,u=o(r.split("."));!(a=u()).done;){var c=a.value;if(!i)return t;i=i[c]}return""+i+n}(r,n,e,a)}return e}(e,t)})).join("/")),n)}var d="www._base_domain_";function s(e,r){void 0===r&&(r="");var t={};return Object.entries(e).forEach((function(e){var n=e[0],o=e[1],a=null!==o&&"object"==typeof o&&!Array.isArray(o),i=function(e,r){return e+(e?".":"")+r}(r,n);if(a){var u=s(o,i);Object.assign(t,u)}else t[i]=o})),t}function p(e){var r=s(e);return Object.entries(r).reduce((function(e,r){var t=r[0],n=r[1];return(Array.isArray(n)?n:[n]).forEach((function(r){null!=r&&e.append(t,r)})),e}),new URLSearchParams)}return r}()}));
//# sourceMappingURL=metro-runtime.umd.min.js.map
{
"name": "@wix/metro-runtime",
"version": "1.1494.0",
"version": "1.1495.0",
"license": "UNLICENSED",

@@ -82,3 +82,3 @@ "author": {

},
"falconPackageHash": "6e394a401a7b6da28a9d81d6f0df442ef5fc4a9cd8aefce16cb1e79c"
"falconPackageHash": "aa03e5c0b660680340b1f20ae8b1d1ff13c766db77e6fc7dcce12d97"
}

@@ -9,2 +9,4 @@ import { findByPath } from './utils';

const DEV_WIX_CODE_DOMAIN = 'dev.wix-code.com';
const REGEX_CAPTURE_PROTO_FIELD = /{(.*)}/;

@@ -18,2 +20,6 @@

const REGEX_CAPTURE_DEV_WIX_CODE_DOMAIN = new RegExp(
`.*\\.${DEV_WIX_CODE_DOMAIN}$`,
);
export type ResolveUrlOpts = {

@@ -68,3 +74,4 @@ // resource path as defined in proto file, including all wildcards & co.

.replace(REGEX_CAPTURE_DOMAINS, '._base_domain_')
.replace(REGEX_CAPTURE_API_DOMAINS, '._api_base_domain_');
.replace(REGEX_CAPTURE_API_DOMAINS, '._api_base_domain_')
.replace(REGEX_CAPTURE_DEV_WIX_CODE_DOMAIN, '*.dev.wix-code.com');
}

@@ -71,0 +78,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 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