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

orm

Package Overview
Dependencies
Maintainers
2
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

orm - npm Package Compare versions

Comparing version 2.1.6 to 2.1.7

after-load.patch

4

Changelog.md
### v2.2.0 - (to do, in future)
- Fixes error code spelling: `PARAM_MISSMATCH` -> `PARAM_MISMATCH`
### v2.1.7 - 25 Apr 2014
- Add explicit 'integer' type to avoid confusion.
`type: 'number', rational: false` will auto convert to `type: 'integer'`.
### v2.1.6 - 23 Apr 2014

@@ -5,0 +9,0 @@ - Add '.omit' to chain find - opposite of '.only'

2

lib/Model.js

@@ -659,3 +659,3 @@ var ChainFind = require("./ChainFind");

allProperties[k] = opts.properties[k] || {
type: 'serial', rational: 'false', key: true, klass: 'key'
type: 'serial', key: true, klass: 'key'
};

@@ -662,0 +662,0 @@ }

var ORMError = require("./Error");
var KNOWN_TYPES = [
"text", "number", "integer", "boolean", "date", "enum", "object",
"binary", "point", "serial"
]
exports.normalize = function (prop, customTypes, Settings) {

@@ -33,6 +38,4 @@ if (typeof prop === "function") {

if ([ "text", "number", "boolean", "date", "enum", "object", "binary", "point" ].indexOf(prop.type) === -1) {
if (!(prop.type in customTypes)) {
throw new ORMError("Unknown property type: " + prop.type, 'NO_SUPPORT');
}
if (KNOWN_TYPES.indexOf(prop.type) === -1 && !(prop.type in customTypes)) {
throw new ORMError("Unknown property type: " + prop.type, 'NO_SUPPORT');
}

@@ -44,6 +47,12 @@

if (prop.type == "number" && !prop.hasOwnProperty("rational")) {
// Defaults to true. Rational means floating point here.
if (prop.type == "number" && prop.rational === undefined) {
prop.rational = true;
}
if (prop.type == "number" && prop.rational === false) {
prop.type = "integer";
delete prop.rational;
}
return prop;

@@ -50,0 +59,0 @@ };

@@ -203,5 +203,4 @@ /**

field_opts = {
type : p.type || "number",
type : p.type || "integer",
size : p.size || 4,
rational : p.rational || false,
unsigned : p.unsigned || true,

@@ -215,5 +214,4 @@ time : p.time || false,

field_opts = {
type : "number",
type : "integer",
unsigned : true,
rational : false,
size : 4,

@@ -220,0 +218,0 @@ required : required

@@ -15,3 +15,3 @@ {

],
"version" : "2.1.6",
"version" : "2.1.7",
"license" : "MIT",

@@ -42,3 +42,3 @@ "homepage" : "http://dresende.github.io/node-orm2",

"sql-query" : "0.1.16",
"sql-ddl-sync" : "git://github.com/dresende/node-sql-ddl-sync.git#v0.2.4",
"sql-ddl-sync" : "git://github.com/dresende/node-sql-ddl-sync.git#v0.3.0",
"hat" : "0.0.3",

@@ -45,0 +45,0 @@ "lodash" : "2.4.1"

@@ -174,3 +174,3 @@ ## Object Relational Mapping

name : String,
height : { type: 'number', rational: false }
height : { type: 'integer' }
});

@@ -177,0 +177,0 @@ Person.tallerThan = function(height, callback) {

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