Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@open-editor/shared

Package Overview
Dependencies
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@open-editor/shared - npm Package Compare versions

Comparing version
0.8.3
to
0.8.4
+5
-3
dist/index.d.ts

@@ -0,1 +1,5 @@

declare const ENTRY_MATCH_RE: RegExp;
declare const ENTRY_ESM_MATCH_RE: RegExp;
declare const CLIENT_MODULE_ID = "@open-editor/client";
declare const ServerApis: {

@@ -19,6 +23,4 @@ readonly OPEN_EDITOR: "/__open_editor__";

declare function omit<T extends AnyObject, K extends keyof T>(val: T, ...keys: K[]): Omit<T, K>;
declare function injectClient(code: string, userOpts: AnyObject): string;
export { ServerApis, camelCase, clamp, hasOwnProperty, injectClient, isArr, isBol, isFn, isNaN, isNum, isObj, isStr, omit };
export { CLIENT_MODULE_ID, ENTRY_ESM_MATCH_RE, ENTRY_MATCH_RE, ServerApis, camelCase, clamp, hasOwnProperty, injectClient, isArr, isBol, isFn, isNaN, isNum, isObj, isStr };

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

"use strict";const ServerApis={OPEN_EDITOR:"/__open_editor__"};function isFn(value){return typeof value=="function"}function isObj(value){return value!=null&&typeof value=="object"}function isStr(value){return typeof value=="string"}function isNum(value){return typeof value=="number"}function isBol(value){return typeof value=="boolean"}function isArr(value){return Array.isArray(value)}function isNaN(value){return Number.isNaN(value)}const camelCaseRE=/(?:(?=^)|(?:[./\-_]+))([a-z])/g;function camelCase(str){return str.replace(camelCaseRE,(...$)=>$[1].toUpperCase())}function clamp(val,start,end){return Math.min(Math.max(val,start),end)}function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}var __defProp=Object.defineProperty,__getOwnPropSymbols$1=Object.getOwnPropertySymbols,__hasOwnProp$1=Object.prototype.hasOwnProperty,__propIsEnum$1=Object.prototype.propertyIsEnumerable,__defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp$1.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols$1)for(var prop of __getOwnPropSymbols$1(b))__propIsEnum$1.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a};function omit(val,...keys){const newVal=__spreadValues({},val);for(const key of keys)hasOwnProperty(val,key)&&delete newVal[key];return newVal}var __getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__objRest=(source,exclude)=>{var target={};for(var prop in source)__hasOwnProp.call(source,prop)&&exclude.indexOf(prop)<0&&(target[prop]=source[prop]);if(source!=null&&__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(source))exclude.indexOf(prop)<0&&__propIsEnum.call(source,prop)&&(target[prop]=source[prop]);return target};const useStrictRE=/^['"]use strict['"];?/;function injectClient(code,userOpts){const _a=userOpts,{isCommonjs}=_a,opts=__objRest(_a,["isCommonjs"]);return(useStrictRE.test(code)?`"use strict";
"use strict";const REACT_15_PATH=normalizePath("react/react.js"),REACT_17_PATH=normalizePath("react/index.js"),VUE_2_PATH=normalizePath("vue/dist/vue.runtime.common.js"),VUE_2_ESM_PATH=normalizePath("vue/dist/vue.runtime.esm.js"),VUE_3_PATH=normalizePath("vue/index.js"),VUE_3_ESM_PATH=normalizePath("vue/dist/vue.runtime.esm-bundler.js"),ENTRY_MATCH_RE=createMatchRE([REACT_15_PATH,REACT_17_PATH,VUE_2_PATH,VUE_2_ESM_PATH,VUE_3_PATH,VUE_3_ESM_PATH]),ENTRY_ESM_MATCH_RE=createMatchRE([VUE_2_ESM_PATH,VUE_3_ESM_PATH]),CLIENT_MODULE_ID="@open-editor/client";function normalizePath(path){return path.replace(/\./g,"\\.")}function createMatchRE(paths){return RegExp(`/node_modules/(${paths.join("|")})$`)}const ServerApis={OPEN_EDITOR:"/__open_editor__"};function isFn(value){return typeof value=="function"}function isObj(value){return value!=null&&typeof value=="object"}function isStr(value){return typeof value=="string"}function isNum(value){return typeof value=="number"}function isBol(value){return typeof value=="boolean"}function isArr(value){return Array.isArray(value)}function isNaN(value){return Number.isNaN(value)}const camelCaseRE=/(?:(?=^)|(?:[./\-_]+))([a-z])/g;function camelCase(str){return str.replace(camelCaseRE,(...$)=>$[1].toUpperCase())}function clamp(val,start,end){return Math.min(Math.max(val,start),end)}function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}var __getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__objRest=(source,exclude)=>{var target={};for(var prop in source)__hasOwnProp.call(source,prop)&&exclude.indexOf(prop)<0&&(target[prop]=source[prop]);if(source!=null&&__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(source))exclude.indexOf(prop)<0&&__propIsEnum.call(source,prop)&&(target[prop]=source[prop]);return target};const useStrictRE=/^['"]use strict['"];?/;function injectClient(code,userOpts){const _a=userOpts,{isCommonjs}=_a,opts=__objRest(_a,["isCommonjs"]);return(useStrictRE.test(code)?`"use strict";
`:"")+(isCommonjs?`const { setupClient } = require("@open-editor/client");

@@ -6,2 +6,2 @@ `:`import { setupClient } from "@open-editor/client";

if(typeof window !== "undefined"){setupClient(`+JSON.stringify(opts)+`)};
`}exports.ServerApis=ServerApis,exports.camelCase=camelCase,exports.clamp=clamp,exports.hasOwnProperty=hasOwnProperty,exports.injectClient=injectClient,exports.isArr=isArr,exports.isBol=isBol,exports.isFn=isFn,exports.isNaN=isNaN,exports.isNum=isNum,exports.isObj=isObj,exports.isStr=isStr,exports.omit=omit;
`}exports.CLIENT_MODULE_ID=CLIENT_MODULE_ID,exports.ENTRY_ESM_MATCH_RE=ENTRY_ESM_MATCH_RE,exports.ENTRY_MATCH_RE=ENTRY_MATCH_RE,exports.ServerApis=ServerApis,exports.camelCase=camelCase,exports.clamp=clamp,exports.hasOwnProperty=hasOwnProperty,exports.injectClient=injectClient,exports.isArr=isArr,exports.isBol=isBol,exports.isFn=isFn,exports.isNaN=isNaN,exports.isNum=isNum,exports.isObj=isObj,exports.isStr=isStr;

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

const ServerApis={OPEN_EDITOR:"/__open_editor__"};function isFn(value){return typeof value=="function"}function isObj(value){return value!=null&&typeof value=="object"}function isStr(value){return typeof value=="string"}function isNum(value){return typeof value=="number"}function isBol(value){return typeof value=="boolean"}function isArr(value){return Array.isArray(value)}function isNaN(value){return Number.isNaN(value)}const camelCaseRE=/(?:(?=^)|(?:[./\-_]+))([a-z])/g;function camelCase(str){return str.replace(camelCaseRE,(...$)=>$[1].toUpperCase())}function clamp(val,start,end){return Math.min(Math.max(val,start),end)}function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}var __defProp=Object.defineProperty,__getOwnPropSymbols$1=Object.getOwnPropertySymbols,__hasOwnProp$1=Object.prototype.hasOwnProperty,__propIsEnum$1=Object.prototype.propertyIsEnumerable,__defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp$1.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols$1)for(var prop of __getOwnPropSymbols$1(b))__propIsEnum$1.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a};function omit(val,...keys){const newVal=__spreadValues({},val);for(const key of keys)hasOwnProperty(val,key)&&delete newVal[key];return newVal}var __getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__objRest=(source,exclude)=>{var target={};for(var prop in source)__hasOwnProp.call(source,prop)&&exclude.indexOf(prop)<0&&(target[prop]=source[prop]);if(source!=null&&__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(source))exclude.indexOf(prop)<0&&__propIsEnum.call(source,prop)&&(target[prop]=source[prop]);return target};const useStrictRE=/^['"]use strict['"];?/;function injectClient(code,userOpts){const _a=userOpts,{isCommonjs}=_a,opts=__objRest(_a,["isCommonjs"]);return(useStrictRE.test(code)?`"use strict";
const REACT_15_PATH=normalizePath("react/react.js"),REACT_17_PATH=normalizePath("react/index.js"),VUE_2_PATH=normalizePath("vue/dist/vue.runtime.common.js"),VUE_2_ESM_PATH=normalizePath("vue/dist/vue.runtime.esm.js"),VUE_3_PATH=normalizePath("vue/index.js"),VUE_3_ESM_PATH=normalizePath("vue/dist/vue.runtime.esm-bundler.js"),ENTRY_MATCH_RE=createMatchRE([REACT_15_PATH,REACT_17_PATH,VUE_2_PATH,VUE_2_ESM_PATH,VUE_3_PATH,VUE_3_ESM_PATH]),ENTRY_ESM_MATCH_RE=createMatchRE([VUE_2_ESM_PATH,VUE_3_ESM_PATH]),CLIENT_MODULE_ID="@open-editor/client";function normalizePath(path){return path.replace(/\./g,"\\.")}function createMatchRE(paths){return RegExp(`/node_modules/(${paths.join("|")})$`)}const ServerApis={OPEN_EDITOR:"/__open_editor__"};function isFn(value){return typeof value=="function"}function isObj(value){return value!=null&&typeof value=="object"}function isStr(value){return typeof value=="string"}function isNum(value){return typeof value=="number"}function isBol(value){return typeof value=="boolean"}function isArr(value){return Array.isArray(value)}function isNaN(value){return Number.isNaN(value)}const camelCaseRE=/(?:(?=^)|(?:[./\-_]+))([a-z])/g;function camelCase(str){return str.replace(camelCaseRE,(...$)=>$[1].toUpperCase())}function clamp(val,start,end){return Math.min(Math.max(val,start),end)}function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}var __getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__objRest=(source,exclude)=>{var target={};for(var prop in source)__hasOwnProp.call(source,prop)&&exclude.indexOf(prop)<0&&(target[prop]=source[prop]);if(source!=null&&__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(source))exclude.indexOf(prop)<0&&__propIsEnum.call(source,prop)&&(target[prop]=source[prop]);return target};const useStrictRE=/^['"]use strict['"];?/;function injectClient(code,userOpts){const _a=userOpts,{isCommonjs}=_a,opts=__objRest(_a,["isCommonjs"]);return(useStrictRE.test(code)?`"use strict";
`:"")+(isCommonjs?`const { setupClient } = require("@open-editor/client");

@@ -6,2 +6,2 @@ `:`import { setupClient } from "@open-editor/client";

if(typeof window !== "undefined"){setupClient(`+JSON.stringify(opts)+`)};
`}export{ServerApis,camelCase,clamp,hasOwnProperty,injectClient,isArr,isBol,isFn,isNaN,isNum,isObj,isStr,omit};
`}export{CLIENT_MODULE_ID,ENTRY_ESM_MATCH_RE,ENTRY_MATCH_RE,ServerApis,camelCase,clamp,hasOwnProperty,injectClient,isArr,isBol,isFn,isNaN,isNum,isObj,isStr};
{
"name": "@open-editor/shared",
"version": "0.8.3",
"version": "0.8.4",
"description": "internal utils shared across @open-editor packages",

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