New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@locator/shared

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@locator/shared - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

dist/isValidRenderer.d.ts

2

dist/index.d.ts

@@ -29,2 +29,4 @@ export * from "./types";

export declare function detectVue(): boolean;
export declare function detectJSX(): boolean;
export declare function detectReact(): boolean;
export declare type SourceLocation = {

@@ -31,0 +33,0 @@ start: {

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

import { isValidRenderer } from "./isValidRenderer";
export * from "./types";

@@ -40,3 +41,2 @@ export const allTargets = {

export function detectSvelte() {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore

@@ -47,3 +47,2 @@ if (window.__SVELTE_HMR) {

}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore

@@ -56,3 +55,2 @@ if (window.__SAPPER__) {

export function detectVue() {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore

@@ -64,1 +62,27 @@ if (window.__VUE__) {

}
export function detectJSX() {
// @ts-ignore
if (window.__LOCATOR_DATA__) {
return true;
}
return false;
}
export function detectReact() {
// @ts-ignore
if (window.__REACT_DEVTOOLS_GLOBAL_HOOK__) {
// @ts-ignore
const renderersMap = window.__REACT_DEVTOOLS_GLOBAL_HOOK__?.renderers;
if (renderersMap) {
const problematicRenderers = [];
const renderers = Array.from(renderersMap.values()).filter((renderer) => {
return isValidRenderer(renderer, (msg) => {
problematicRenderers.push(msg);
});
});
if (renderers.length) {
return true;
}
}
}
return false;
}

4

package.json
{
"name": "@locator/shared",
"version": "0.1.4",
"version": "0.1.5",
"main": "./dist/index.js",

@@ -18,3 +18,3 @@ "license": "MIT",

},
"gitHead": "1995de3282210cb5634577cd00156d4071d13ec3",
"gitHead": "0d3e398f955c538dc5435db6fa1efde87ad9a27c",
"files": [

@@ -21,0 +21,0 @@ "dist",

@@ -0,1 +1,4 @@

import { isValidRenderer } from "./isValidRenderer";
import { Renderer } from "./types";
export * from "./types";

@@ -55,3 +58,2 @@

export function detectSvelte() {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore

@@ -63,3 +65,2 @@ if (window.__SVELTE_HMR) {

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore

@@ -73,3 +74,2 @@ if (window.__SAPPER__) {

export function detectVue() {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore

@@ -82,2 +82,32 @@ if (window.__VUE__) {

export function detectJSX() {
// @ts-ignore
if (window.__LOCATOR_DATA__) {
return true;
}
return false;
}
export function detectReact() {
// @ts-ignore
if (window.__REACT_DEVTOOLS_GLOBAL_HOOK__) {
// @ts-ignore
const renderersMap = window.__REACT_DEVTOOLS_GLOBAL_HOOK__?.renderers;
if (renderersMap) {
const problematicRenderers: string[] = [];
const renderers = Array.from(renderersMap.values()).filter(
(renderer: Renderer) => {
return isValidRenderer(renderer, (msg) => {
problematicRenderers.push(msg);
});
}
);
if (renderers.length) {
return true;
}
}
}
return false;
}
export type SourceLocation = {

@@ -84,0 +114,0 @@ start: {

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