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

@symbolic/lib

Package Overview
Dependencies
Maintainers
4
Versions
226
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@symbolic/lib - npm Package Compare versions

Comparing version 1.0.26 to 1.0.27

src/time/time.js

34

dist/index.js

@@ -11,3 +11,2 @@ 'use strict';

console.log('apitest');
var api = {

@@ -75,2 +74,32 @@ async request({uri, body={}}, {token, shouldAlert=true}={}) {

var time = {};
time.scales = [
{abbreviation: 'm', title: 'minute', minutes: 1, maxMinutes: 59},
{abbreviation: 'h', title: 'hour', minutes: 60, maxMinutes: 479},
{abbreviation: 'd', title: 'day', minutes: 480, maxMinutes: 2399},
{abbreviation: 'w', title: 'week', minutes: 2400, maxMinutes: 10079},
{abbreviation: 'mo', title: 'month', minutes: 10080, maxMinutes: 125279},
{abbreviation: 'y', title: 'year', minutes: 125280}
];
time.toLabel = (minutes) => {
minutes = Math.round(minutes) || 0; //HINT prevent invalid minutes values
var scale = _.find(time.scales, scale => minutes <= scale.maxMinutes) || _.last(time.scales);
var number = Math.round(minutes/scale.minutes * 10) / 10;
return `${number}${scale.abbreviation}`;
};
time.toMinutes = (label) => {
label = label || '0m';
var number = parseFloat(label) || 0;
var abbreviation = label.replace(`${number}`, '');
var scale = _.find(time.scales, {abbreviation});
return scale && number ? (number * scale.minutes) : 0;
};
var colors = {};

@@ -136,3 +165,3 @@

var sf = {api, colors, validation};
var sf = {api, colors, validation, time};

@@ -142,2 +171,3 @@ exports.api = api;

exports.default = sf;
exports.time = time;
exports.validation = validation;

2

package.json
{
"name": "@symbolic/lib",
"version": "1.0.26",
"version": "1.0.27",
"description": "plain js utilities",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

import axios from 'axios';
import _ from 'lodash';
import Cookies from 'js-cookie';
console.log('apitest')
var api = {

@@ -6,0 +6,0 @@ async request({uri, body={}}, {token, shouldAlert=true}={}) {

import api from './api/api';
import time from './time/time';
import colors from './colors/colors';
import validation from './validation/validation';
var sf = {api, colors, validation};
var sf = {api, colors, validation, time};
export default sf;
export {api, colors, validation};
export {api, colors, validation, time};
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