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

@rawmodel/utils

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rawmodel/utils - npm Package Compare versions

Comparing version 3.0.0-alpha0 to 3.0.0-alpha3

rawmodel-utils.build.error.log

2

CHANGELOG.json

@@ -5,3 +5,3 @@ {

{
"version": "3.0.0-alpha0",
"version": "3.0.0-alpha3",
"tag": "@rawmodel/utils_v2.4.0",

@@ -8,0 +8,0 @@ "date": "Fri, 12 Jul 2019 17:57:56 GMT",

@@ -6,2 +6,4 @@ "use strict";

const is_string_1 = require("./is-string");
const is_number_1 = require("./is-number");
const is_infinite_1 = require("./is-infinite");
function toString(v) {

@@ -14,4 +16,7 @@ if (is_string_1.isString(v)) {

}
else if (is_number_1.isNumber(v) && (isNaN(v) || is_infinite_1.isInfinite(v))) {
return null;
}
else {
return toString(v.toString());
return JSON.stringify(v);
}

@@ -18,0 +23,0 @@ }

@@ -11,9 +11,10 @@ "use strict";

ctx.is(__1.toString(''), '');
ctx.is(__1.toString(NaN), 'NaN');
ctx.is(__1.toString(Infinity), 'Infinity');
ctx.is(__1.toString(NaN), null);
ctx.is(__1.toString(Infinity), null);
ctx.is(__1.toString(true), 'true');
ctx.is(__1.toString(100.1), '100.1');
ctx.is(__1.toString([1, 2]), '1,2');
ctx.is(__1.toString({ a: 1 }), '{"a":1}');
ctx.is(__1.toString([1, 2]), '[1,2]');
});
exports.default = spec;
//# sourceMappingURL=to-string.test.js.map

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

const spec = new spec_1.Spec();
spec.test('exposed content', (t) => {
t.true(!!rawmodel.isArray);
t.true(!!rawmodel.isBoolean);
t.true(!!rawmodel.isClassOf);
t.true(!!rawmodel.isDate);
t.true(!!rawmodel.isDeepEqual);
t.true(!!rawmodel.isFloat);
t.true(!!rawmodel.isFunction);
t.true(!!rawmodel.isInfinite);
t.true(!!rawmodel.isInstanceOf);
t.true(!!rawmodel.isInteger);
t.true(!!rawmodel.isNull);
t.true(!!rawmodel.isNumber);
t.true(!!rawmodel.isObject);
t.true(!!rawmodel.isPresent);
t.true(!!rawmodel.isString);
t.true(!!rawmodel.isUndefined);
t.true(!!rawmodel.isValue);
t.true(!!rawmodel.normalize);
t.true(!!rawmodel.realize);
t.true(!!rawmodel.toArray);
t.true(!!rawmodel.toBoolean);
t.true(!!rawmodel.toDate);
t.true(!!rawmodel.toFloat);
t.true(!!rawmodel.toInteger);
t.true(!!rawmodel.toNumber);
t.true(!!rawmodel.toString);
spec.test('exposed content', (ctx) => {
ctx.true(!!rawmodel.isArray);
ctx.true(!!rawmodel.isBoolean);
ctx.true(!!rawmodel.isClassOf);
ctx.true(!!rawmodel.isDate);
ctx.true(!!rawmodel.isDeepEqual);
ctx.true(!!rawmodel.isFloat);
ctx.true(!!rawmodel.isFunction);
ctx.true(!!rawmodel.isInfinite);
ctx.true(!!rawmodel.isInstanceOf);
ctx.true(!!rawmodel.isInteger);
ctx.true(!!rawmodel.isNull);
ctx.true(!!rawmodel.isNumber);
ctx.true(!!rawmodel.isObject);
ctx.true(!!rawmodel.isPresent);
ctx.true(!!rawmodel.isString);
ctx.true(!!rawmodel.isUndefined);
ctx.true(!!rawmodel.isValue);
ctx.true(!!rawmodel.normalize);
ctx.true(!!rawmodel.realize);
ctx.true(!!rawmodel.toArray);
ctx.true(!!rawmodel.toBoolean);
ctx.true(!!rawmodel.toDate);
ctx.true(!!rawmodel.toFloat);
ctx.true(!!rawmodel.toInteger);
ctx.true(!!rawmodel.toNumber);
ctx.true(!!rawmodel.toString);
});
exports.default = spec;
//# sourceMappingURL=index.test.js.map

@@ -5,6 +5,6 @@ {

"packages/rawmodel-utils/.npmignore": "417dbeccc3958deb2d45197baad0d9adfc323e4a",
"packages/rawmodel-utils/CHANGELOG.json": "0c26214369829f561db138ddaa2a2eeaa1df9dc0",
"packages/rawmodel-utils/CHANGELOG.json": "7085e619b533cbb4c0278897ec7b5478d26cee97",
"packages/rawmodel-utils/CHANGELOG.md": "21a1573f161e1f2c1aa54fe95dba1de71ccbba51",
"packages/rawmodel-utils/nodemon.json": "82b893373db9861f1df4b55d8ea68a5d37b118de",
"packages/rawmodel-utils/package.json": "df82fc1b7819375bcb2e6e8d363ebe7381910036",
"packages/rawmodel-utils/package.json": "10551df50605e64dc5eb9c2250b2e6170dfa66de",
"packages/rawmodel-utils/src/helpers/is-array.ts": "d77ddcf44458612d76a83829932295adfb708f7a",

@@ -35,3 +35,3 @@ "packages/rawmodel-utils/src/helpers/is-boolean.ts": "51e3192e3aa97393063f6bc71f2aae94c0cf477d",

"packages/rawmodel-utils/src/helpers/to-number.ts": "b4d125c93220972dc1d0a9b562e186192ceead07",
"packages/rawmodel-utils/src/helpers/to-string.ts": "e350964b6f3c7addae737bc9ee4eb4dc00bc4735",
"packages/rawmodel-utils/src/helpers/to-string.ts": "7915804f1ae6e0ae39ba7bb480df749425e63af3",
"packages/rawmodel-utils/src/index.ts": "5ffc857d210daff5b9ef4a15ef735fc6ed961174",

@@ -62,9 +62,9 @@ "packages/rawmodel-utils/src/tests/helpers/is-array.test.ts": "b6032331cd20b35dd89ee078ae9d24f0b03e210e",

"packages/rawmodel-utils/src/tests/helpers/to-integer.test.ts": "3528ee52fb2ff37c9fc40b8494911d4cb3e64e08",
"packages/rawmodel-utils/src/tests/helpers/to-string.test.ts": "1f1397d8ddcd88d25558a0b19751c684a71ff72e",
"packages/rawmodel-utils/src/tests/index.test.ts": "3e89cf3658865524348516e6108049590d0baf04",
"packages/rawmodel-utils/src/tests/helpers/to-string.test.ts": "582c63b79f2689f058d6ca11b9f60ef818d590d9",
"packages/rawmodel-utils/src/tests/index.test.ts": "c9e09505c8600226ec7fcde9ef0843a46b71f8b6",
"packages/rawmodel-utils/tsconfig.json": "99f0fa2e7cf44aa40828236230bc6f15d8648bc6",
"packages/rawmodel-utils/tslint.json": "88f5b48ff1a1024a2b414e5521474fd8a4f3d649",
"common/config/rush/npm-shrinkwrap.json": "553298014eb9135de3cb15c92c9e297e28417a3e"
"common/config/rush/npm-shrinkwrap.json": "066eda275e073c1e90cf2a6308e7329951fa2f0f"
},
"arguments": "npx nyc npx hayspec test "
}
{
"name": "@rawmodel/utils",
"version": "3.0.0-alpha0",
"version": "3.0.0-alpha3",
"description": "Shared helpers for RawModel.",

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

"serialization",
"serializable"
"serializable",
"schema",
"json"
],

@@ -81,0 +83,0 @@ "author": "Kristijan Sedlak (Xpepermint)",

import { isUndefined } from './is-undefined';
import { isNull } from './is-null';
import { isString } from './is-string';
import { isNumber } from './is-number';
import { isInfinite } from './is-infinite';

@@ -16,5 +18,7 @@ /**

}
else {
return toString(v.toString());
else if (isNumber(v) && (isNaN(v) || isInfinite(v))) {
return null;
} else {
return JSON.stringify(v);
}
}

@@ -11,9 +11,10 @@ import { Spec } from '@hayspec/spec';

ctx.is(toString(''), '');
ctx.is(toString(NaN), 'NaN');
ctx.is(toString(Infinity), 'Infinity');
ctx.is(toString(NaN), null);
ctx.is(toString(Infinity), null);
ctx.is(toString(true), 'true');
ctx.is(toString(100.1), '100.1');
ctx.is(toString([1, 2]), '1,2');
ctx.is(toString({ a: 1 }), '{"a":1}');
ctx.is(toString([1, 2]), '[1,2]');
});
export default spec;

@@ -6,31 +6,31 @@ import { Spec } from '@hayspec/spec';

spec.test('exposed content', (t) => {
t.true(!!rawmodel.isArray);
t.true(!!rawmodel.isBoolean);
t.true(!!rawmodel.isClassOf);
t.true(!!rawmodel.isDate);
t.true(!!rawmodel.isDeepEqual);
t.true(!!rawmodel.isFloat);
t.true(!!rawmodel.isFunction);
t.true(!!rawmodel.isInfinite);
t.true(!!rawmodel.isInstanceOf);
t.true(!!rawmodel.isInteger);
t.true(!!rawmodel.isNull);
t.true(!!rawmodel.isNumber);
t.true(!!rawmodel.isObject);
t.true(!!rawmodel.isPresent);
t.true(!!rawmodel.isString);
t.true(!!rawmodel.isUndefined);
t.true(!!rawmodel.isValue);
t.true(!!rawmodel.normalize);
t.true(!!rawmodel.realize);
t.true(!!rawmodel.toArray);
t.true(!!rawmodel.toBoolean);
t.true(!!rawmodel.toDate);
t.true(!!rawmodel.toFloat);
t.true(!!rawmodel.toInteger);
t.true(!!rawmodel.toNumber);
t.true(!!rawmodel.toString);
spec.test('exposed content', (ctx) => {
ctx.true(!!rawmodel.isArray);
ctx.true(!!rawmodel.isBoolean);
ctx.true(!!rawmodel.isClassOf);
ctx.true(!!rawmodel.isDate);
ctx.true(!!rawmodel.isDeepEqual);
ctx.true(!!rawmodel.isFloat);
ctx.true(!!rawmodel.isFunction);
ctx.true(!!rawmodel.isInfinite);
ctx.true(!!rawmodel.isInstanceOf);
ctx.true(!!rawmodel.isInteger);
ctx.true(!!rawmodel.isNull);
ctx.true(!!rawmodel.isNumber);
ctx.true(!!rawmodel.isObject);
ctx.true(!!rawmodel.isPresent);
ctx.true(!!rawmodel.isString);
ctx.true(!!rawmodel.isUndefined);
ctx.true(!!rawmodel.isValue);
ctx.true(!!rawmodel.normalize);
ctx.true(!!rawmodel.realize);
ctx.true(!!rawmodel.toArray);
ctx.true(!!rawmodel.toBoolean);
ctx.true(!!rawmodel.toDate);
ctx.true(!!rawmodel.toFloat);
ctx.true(!!rawmodel.toInteger);
ctx.true(!!rawmodel.toNumber);
ctx.true(!!rawmodel.toString);
});
export default spec;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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