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

c2-util

Package Overview
Dependencies
Maintainers
0
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

c2-util - npm Package Compare versions

Comparing version 1.0.25 to 1.0.26

7

dist/index.d.ts

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

import moment from "moment";
import { Semaphore } from "./Semaphore";

@@ -6,2 +7,8 @@ export declare const isNotEmpty: (obj: any) => boolean;

export declare const getUptimeServer: () => string;
export declare const getInitDateTimeServer: () => {
localDateTime: moment.Moment;
serverDateTime: moment.Moment;
utc0DateTime: moment.Moment;
};
export declare const getVersionFromPackageJson: () => any;
export declare const log: (tag: string, value: any) => void;

@@ -8,0 +15,0 @@ export declare const replacer: () => (key: any, value: any) => any;

23

dist/index.js

@@ -29,3 +29,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.Semaphore = exports.buildNestedObject = exports.expandObjectRecursive = exports.timeToPercentage = exports.round = exports.trunc = exports.delay = exports.replacer = exports.log = exports.getUptimeServer = exports.getPackageJsonData = exports.isEmpty = exports.isNotEmpty = void 0;
exports.Semaphore = exports.buildNestedObject = exports.expandObjectRecursive = exports.timeToPercentage = exports.round = exports.trunc = exports.delay = exports.replacer = exports.log = exports.getVersionFromPackageJson = exports.getInitDateTimeServer = exports.getUptimeServer = exports.getPackageJsonData = exports.isEmpty = exports.isNotEmpty = void 0;
const fs = __importStar(require("fs"));

@@ -84,2 +84,23 @@ const moment_1 = __importDefault(require("moment"));

exports.getUptimeServer = getUptimeServer;
const getInitDateTimeServer = () => {
const timeInSeconds = process.uptime();
return {
localDateTime: (0, moment_1.default)().subtract(timeInSeconds, "seconds").utc(true),
serverDateTime: (0, moment_1.default)().subtract(timeInSeconds, "seconds").utc(true),
utc0DateTime: (0, moment_1.default)().subtract(timeInSeconds, "seconds").utc(false)
};
};
exports.getInitDateTimeServer = getInitDateTimeServer;
const getVersionFromPackageJson = () => {
try {
const packageJsonPath = "./package.json";
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
return packageJson.version;
}
catch (error) {
console.error("Error reading package.json:", error);
return null;
}
};
exports.getVersionFromPackageJson = getVersionFromPackageJson;
const log = (tag, value) => {

@@ -86,0 +107,0 @@ if (process.env.MODE_DEBUG === "true") {

2

package.json
{
"name": "c2-util",
"version": "1.0.25",
"version": "1.0.26",
"description": "Biblioteca de funções utilitárias",

@@ -5,0 +5,0 @@ "repository": "https://cabralsilva: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@github.com/cabralsilva/c2-util.git",

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