🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

react-native-is-edge-to-edge

Package Overview
Dependencies
Maintainers
0
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-is-edge-to-edge - npm Package Compare versions

Comparing version

to
1.1.0

1

dist/index.android.d.ts
export declare const isEdgeToEdge: () => boolean;
export declare const controlEdgeToEdgeValues: (values: Record<string, unknown>) => void;

@@ -6,7 +6,32 @@ 'use strict';

// src/index.android.ts
var isEdgeToEdge = () => hasReactNativeEdgeToEdgePackage;
var hasReactNativeEdgeToEdgePackage = reactNative.TurboModuleRegistry.get("RNEdgeToEdge") != null;
var isEdgeToEdge = () => hasReactNativeEdgeToEdgePackage;
var warnings = /* @__PURE__ */ new Set();
var controlEdgeToEdgeValues = (values) => {
if (__DEV__) {
if (hasReactNativeEdgeToEdgePackage) {
const entries = Object.entries(values).filter(
([, value]) => typeof value !== "undefined"
);
const stableKey = entries.join(" ");
if (entries.length < 1 || warnings.has(stableKey)) {
return;
}
warnings.add(stableKey);
const isPlural = entries.length > 1;
const lastIndex = entries.length - 1;
const list = entries.reduce(
(acc, [name], index) => index === 0 ? name : acc + (index === lastIndex ? " and " : ", ") + name,
""
);
console.warn(
`${list} ${isPlural ? "value" : "values"} are ignored when using react-native-edge-to-edge`
);
}
}
};
exports.controlEdgeToEdgeValues = controlEdgeToEdgeValues;
exports.isEdgeToEdge = isEdgeToEdge;
//# sourceMappingURL=index.android.js.map
//# sourceMappingURL=index.android.js.map
export declare const isEdgeToEdge: () => boolean;
export declare const controlEdgeToEdgeValues: (values: Record<string, unknown>) => void;

@@ -5,5 +5,8 @@ 'use strict';

var isEdgeToEdge = () => true;
var controlEdgeToEdgeValues = (values) => {
};
exports.controlEdgeToEdgeValues = controlEdgeToEdgeValues;
exports.isEdgeToEdge = isEdgeToEdge;
//# sourceMappingURL=index.js.map
//# sourceMappingURL=index.js.map

8

package.json
{
"name": "react-native-is-edge-to-edge",
"version": "1.0.0",
"version": "1.1.0",
"license": "MIT",

@@ -30,3 +30,4 @@ "description": "Detect react-native-edge-to-edge package install",

"clean": "rm -rf dist",
"build": "yarn clean && tsup && tsc --emitDeclarationOnly"
"test": "vitest run",
"build": "yarn clean && yarn test && tsup && tsc -p tsconfig.build.json --emitDeclarationOnly"
},

@@ -41,4 +42,5 @@ "peerDependencies": {

"tsup": "^8.3.0",
"typescript": "^5.6.3"
"typescript": "^5.6.3",
"vitest": "^2.1.3"
}
}

@@ -7,8 +7,27 @@ # react-native-is-edge-to-edge

```ts
import { isEdgeToEdge } from "react-native-is-edge-to-edge";
```jsx
import {
isEdgeToEdge,
controlEdgeToEdgeValues,
} from "react-native-is-edge-to-edge";
if (isEdgeToEdge()) {
// …do something
const EDGE_TO_EDGE = isEdgeToEdge();
function MyLibraryComponent({
statusBarTranslucent,
navigationBarTranslucent,
}) {
if (__DEV__) {
// warn the user once about unnecessary defined values
controlEdgeToEdgeValues({ statusBarTranslucent, navigationBarTranslucent });
}
return (
<MyLibraryNativeComponent
statusBarTranslucent={EDGE_TO_EDGE || statusBarTranslucent}
navigationBarTranslucent={EDGE_TO_EDGE || navigationBarTranslucent}
// …
/>
);
}
```

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

Sorry, the diff of this file is not supported yet