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

@buildingsblock/core

Package Overview
Dependencies
Maintainers
2
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@buildingsblock/core - npm Package Compare versions

Comparing version 0.0.10 to 0.0.11

23

lib/stratas/index.js

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

});
exports.default = void 0;
exports.default = exports.calcSalesTurnoverRate = exports.calcContingencyReserveFundPerSquareFoot = void 0;

@@ -17,3 +17,2 @@ var _lodash = _interopRequireDefault(require("lodash"));

// import createSchema from './schema'
var calcContingencyReserveFundPerSquareFoot = function calcContingencyReserveFundPerSquareFoot(stratas) {

@@ -34,2 +33,21 @@ var stratasWithContingencyReserveFund = stratas.filter(function (x) {

exports.calcContingencyReserveFundPerSquareFoot = calcContingencyReserveFundPerSquareFoot;
var calcSalesTurnoverRate = function calcSalesTurnoverRate(strata) {
var sales = strata.sales,
units = strata.units;
var _sales$ = sales[0],
pastYear = _sales$.pastYear,
twoYearsAgo = _sales$.twoYearsAgo,
threeYearsAgo = _sales$.threeYearsAgo;
var turnoverRate = {
pastYear: new _decimal.Decimal(pastYear).dividedBy(units).toNumber(),
twoYearsAgo: new _decimal.Decimal(twoYearsAgo).dividedBy(units).toNumber(),
threeYearsAgo: new _decimal.Decimal(threeYearsAgo).dividedBy(units).toNumber()
};
return turnoverRate;
};
exports.calcSalesTurnoverRate = calcSalesTurnoverRate;
var createSchema = function createSchema(Mongoose) {

@@ -107,4 +125,5 @@ var StrataSchema = new Mongoose.Schema({

calcContingencyReserveFundPerSquareFoot: calcContingencyReserveFundPerSquareFoot,
calcSalesTurnoverRate: calcSalesTurnoverRate,
createSchema: createSchema
};
exports.default = _default;

2

package.json
{
"name": "@buildingsblock/core",
"version": "0.0.10",
"version": "0.0.11",
"description": "Core code base for Buildingsblock",

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

import test from 'ava'
import { calcContingencyReserveFundPerSquareFoot } from '../../src/stratas'
import {
calcContingencyReserveFundPerSquareFoot,
calcSalesTurnoverRate,
} from '../../src/stratas'

@@ -30,1 +33,14 @@ test('calcContingencyReserveFundPerSquareFoot', (t) => {

})
test('calcSalesTurnoverRate', (t) => {
const strata = {
sales: [{ pastYear: 10, twoYearsAgo: 5, threeYearsAgo: 20 }],
units: 100,
}
const result = calcSalesTurnoverRate(strata)
t.is(result.pastYear, 0.1, 'should return turnover rate for past year')
t.is(result.twoYearsAgo, 0.05, 'should return turnover rate for two years ago')
t.is(result.threeYearsAgo, 0.2, 'should return turnover rate for three years ago')
})
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