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.22 to 1.0.23

1

dist/index.d.ts

@@ -11,2 +11,3 @@ import { Semaphore } from "./Semaphore";

export declare const round: (value: number, decimalPlates?: number) => number;
export declare const timeToPercentage: (time: string) => number;
export { Semaphore };

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.Semaphore = exports.round = exports.trunc = exports.delay = exports.replacer = exports.log = exports.getUptimeServer = exports.getPackageJsonData = exports.isEmpty = exports.isNotEmpty = void 0;
exports.Semaphore = exports.timeToPercentage = exports.round = exports.trunc = exports.delay = exports.replacer = exports.log = exports.getUptimeServer = exports.getPackageJsonData = exports.isEmpty = exports.isNotEmpty = void 0;
const fs = __importStar(require("fs"));
const moment_1 = __importDefault(require("moment"));
const Semaphore_1 = require("./Semaphore");
Object.defineProperty(exports, "Semaphore", { enumerable: true, get: function () { return Semaphore_1.Semaphore; } });
const fs = __importStar(require("fs"));
const isNotEmpty = (obj) => {

@@ -125,1 +125,16 @@ return !(0, exports.isEmpty)(obj);

exports.round = round;
const timeToPercentage = (time) => {
// Expressão regular para validar o formato HH:mm
const timeFormat = /^([01]\d|2[0-3]):([0-5]\d)$/;
// Verifica se o formato está correto
if (!timeFormat.test(time)) {
throw new Error("Invalid time format, expected HH:mm");
}
const [hours, minutes] = time.split(":").map(Number);
if (isNaN(hours) || isNaN(minutes)) {
throw new Error("Invalid time format");
}
// Convert hours and minutes to the percentage equivalent
return hours + (minutes / 60);
};
exports.timeToPercentage = timeToPercentage;

2

package.json
{
"name": "c2-util",
"version": "1.0.22",
"version": "1.0.23",
"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