Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@buildingsblock/core

Package Overview
Dependencies
Maintainers
1
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.5 to 0.0.6

86

lib/stratas/index.js

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

});
Object.defineProperty(exports, "createSchema", {
enumerable: true,
get: function get() {
return _schema.default;
}
});
exports.default = exports.calcContingencyReserveFundPerSquareFoot = void 0;
exports.createSchema = exports.calcContingencyReserveFundPerSquareFoot = void 0;

@@ -21,6 +15,5 @@ var _lodash = _interopRequireDefault(require("lodash"));

var _schema = _interopRequireDefault(require("./schema"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// import createSchema from './schema'
var calcContingencyReserveFundPerSquareFoot = function calcContingencyReserveFundPerSquareFoot(stratas) {

@@ -42,5 +35,72 @@ var stratasWithContingencyReserveFund = stratas.filter(function (x) {

exports.calcContingencyReserveFundPerSquareFoot = calcContingencyReserveFundPerSquareFoot;
var _default = {
calcContingencyReserveFundPerSquareFoot: calcContingencyReserveFundPerSquareFoot
};
exports.default = _default;
var createSchema = function createSchema(Mongoose) {
var StrataSchema = new Mongoose.Schema({
strataNumber: String,
units: Number,
postalCode: String,
builtAt: Number,
elevators: Number,
pools: Number,
gyms: Number,
area: {
total: Number,
liveable: Number,
basement: Number,
unfinishedBasement: Number,
finishedBasement: Number
},
budget: [{
value: Number,
at: String
}],
repairAndMaintenanceBudget: [{
value: Number,
at: String
}],
contingencyReserveFund: [{
value: Number,
at: String
}],
contingencyReserveFundContributions: [{
value: Number,
at: String
}],
levies: [{
value: Number,
at: String
}]
}, {
timestamps: true
});
/* eslint-disable func-names */
StrataSchema.pre('save', function (next) {
var strata = this; // order values
strata.budget = _lodash.default.orderBy(strata.budget, ['at'], ['desc']);
strata.repairAndMaintenanceBudget = _lodash.default.orderBy(strata.repairAndMaintenanceBudget, ['at'], ['desc']);
strata.contingencyReserveFund = _lodash.default.orderBy(strata.contingencyReserveFund, ['at'], ['desc']);
strata.contingencyReserveFundContributions = _lodash.default.orderBy(strata.contingencyReserveFundContributions, ['at'], ['desc']);
strata.levies = _lodash.default.orderBy(strata.levies, ['at'], ['desc']);
next();
});
StrataSchema.set('toJSON', {
transform: function transform(doc, ret) {
ret.id = ret._id; // eslint-disable-line
delete ret._id; // eslint-disable-line
delete ret.__v; // eslint-disable-line
}
});
return StrataSchema;
}; // import * as colors from './colors';
//
// export { colors };
// export default {
// calcContingencyReserveFundPerSquareFoot,
// }
exports.createSchema = createSchema;

2

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

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

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