|
@@ -0,0 +1,15 @@
|
|
|
+// src/utils/ipUpdate.ts
|
|
|
+
|
|
|
+const ipSplicing = (startIp: string, endIp: string | null | undefined): string => {
|
|
|
+ if (!endIp || endIp.trim() === '') {
|
|
|
+ return startIp;
|
|
|
+ }
|
|
|
+
|
|
|
+ const startParts = startIp.split('.');
|
|
|
+ const endParts = endIp.split('.');
|
|
|
+ const lastPartOfEndIp = endParts[endParts.length - 1];
|
|
|
+
|
|
|
+ return `${startIp}/${lastPartOfEndIp}`;
|
|
|
+};
|
|
|
+
|
|
|
+export { ipSplicing };
|