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

paramo

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

paramo - npm Package Compare versions

Comparing version 1.15.0 to 1.16.0

.history/tests/types/Array_20200311110444.js

38

package.json
{
"name": "paramo",
"version": "1.15.0",
"version": "1.16.0",
"description": "🌵Swiss-army knife of stringifying, parsing and manipulating URL parameters by applying types to the parameters.",

@@ -32,31 +32,31 @@ "main": "dist/paramo.cjs.js",

"@babel/plugin-syntax-bigint": "^7.8.3",
"@babel/polyfill": "^7.8.3",
"@babel/preset-env": "^7.8.4",
"@babel/register": "^7.8.3",
"ava": "^3.3.0",
"babel-eslint": "^10.0.3",
"coveralls": "^3.0.9",
"@babel/polyfill": "^7.8.7",
"@babel/preset-env": "^7.9.6",
"@babel/register": "^7.9.0",
"ava": "^3.8.1",
"babel-eslint": "^10.1.0",
"coveralls": "^3.1.0",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.10.0",
"eslint-config-standard": "^14.1.0",
"eslint-plugin-ava": "^10.2.0",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-node": "^11.0.0",
"eslint-config-prettier": "^6.11.0",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-ava": "^10.3.0",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"mockdate": "^2.0.5",
"nyc": "^15.0.0",
"prettier": "^1.19.1",
"rollup": "^1.31.1",
"rollup-plugin-babel": "^4.3.3",
"nyc": "^15.0.1",
"prettier": "^2.0.5",
"rollup": "^2.8.0",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-terser": "^5.2.0"
"rollup-plugin-terser": "^5.3.0"
},
"dependencies": {
"humps": "^2.0.1",
"moment": "^2.24.0",
"query-string": "^6.11.0",
"moment": "^2.25.3",
"query-string": "^6.12.1",
"ramda": "^0.27.0"
}
}

@@ -9,3 +9,3 @@ import qs from 'query-string';

return params => {
return (params) => {
const keys = options.includeDefaults ? Object.keys({ ...params, ...types }) : Object.keys(params);

@@ -12,0 +12,0 @@

import { equals } from 'ramda';
import { TypeError, isInvalidArray } from '../utils';
const Type = type => ({
const Type = (type) => ({
defaultValue: [],
toType: options => value => {
toType: (options) => (value) => {
if (isInvalidArray(value, options)) throw new TypeError('Invalid t.Array');
const values = Array.isArray(value) ? value : [].concat(value);
return values.map(value => type.toType(options)(value));
return values.map((value) => type.toType(options)(value));
},
toString: options => values => {
toString: (options) => (values) => {
if (!Array.isArray(values)) throw new TypeError('Invalid t.Array');
return values.map(value => type.toString(options)(value));
return values.map((value) => type.toString(options)(value));
},

@@ -22,3 +22,3 @@ isSame: (a, b) => {

Type.Sequence = type => ({
Type.Sequence = (type) => ({
defaultValue: [],

@@ -25,0 +25,0 @@ toType: Type(type).toType,

import { TypeError } from '../utils';
export default {
toType: () => value => {
toType: () => (value) => {
try {

@@ -11,3 +11,3 @@ return BigInt(value);

},
toString: () => value => {
toString: () => (value) => {
if (!(Object(value) instanceof BigInt)) throw new TypeError('Invalid t.BigInt');

@@ -14,0 +14,0 @@ return String(value);

import { TypeError } from '../utils';
export default {
toType: ({ booleanStrings: [truthy, falsy] }) => value => {
toType: ({ booleanStrings: [truthy, falsy] }) => (value) => {
const typedValue = (() => {

@@ -24,3 +24,3 @@ switch (value) {

},
toString: ({ booleanStrings: [truthy, falsy] }) => value => {
toString: ({ booleanStrings: [truthy, falsy] }) => (value) => {
if (typeof value !== 'boolean') throw new TypeError('Invalid t.Bool');

@@ -27,0 +27,0 @@ return value === true ? truthy : falsy;

import { TypeError } from '../utils';
const raise = message => {
const raise = (message) => {
throw new TypeError(message);

@@ -14,7 +14,7 @@ };

toType(options) {
return value => this.parser({ value, options, raise });
return (value) => this.parser({ value, options, raise });
}
toString(options) {
return value => this.stringifier({ value, options, raise });
return (value) => this.stringifier({ value, options, raise });
}

@@ -21,0 +21,0 @@

@@ -5,3 +5,3 @@ import moment from 'moment';

const Type = {
toType: () => value => {
toType: () => (value) => {
const typedValue = moment.isMoment(value) ? value.toDate() : moment(value).toDate();

@@ -11,3 +11,3 @@ if (Number.isNaN(typedValue.getTime())) throw new TypeError('Invalid t.Date');

},
toString: ({ dateFormat }) => value => {
toString: ({ dateFormat }) => (value) => {
if (!(value instanceof Date)) throw new TypeError('Invalid t.Date');

@@ -19,3 +19,3 @@ return moment(value).format(dateFormat);

Type.UnixSeconds = {
toType: () => value => {
toType: () => (value) => {
const typedValue = moment(Number(value));

@@ -28,3 +28,3 @@ return Type.toType()(typedValue);

Type.UnixMilliseconds = {
toType: () => value => {
toType: () => (value) => {
const typedValue = moment.unix(Number(value));

@@ -31,0 +31,0 @@ return Type.toType()(typedValue);

import { TypeError } from '../utils';
const Type = {
toType: () => value => {
toType: () => (value) => {
const typedValue = parseFloat(value);

@@ -9,3 +9,3 @@ if (Number.isNaN(typedValue)) throw new TypeError('Invalid t.Float');

},
toString: () => value => {
toString: () => (value) => {
if (typeof value !== 'number' || Number.isInteger(value)) throw new TypeError('Invalid t.Float');

@@ -16,4 +16,4 @@ return String(value);

Type.DP = decimalPlaces => ({
toType: () => value => {
Type.DP = (decimalPlaces) => ({
toType: () => (value) => {
const typedValue = Type.toType()(value);

@@ -20,0 +20,0 @@ return Type.toType()(typedValue.toFixed(decimalPlaces));

import { TypeError } from '../utils';
export default {
toType: () => value => {
toType: () => (value) => {
const typedValue = parseInt(value);

@@ -9,3 +9,3 @@ if (Number.isNaN(typedValue)) throw new TypeError('Invalid t.Int');

},
toString: () => value => {
toString: () => (value) => {
if (typeof value !== 'number' || !Number.isInteger(value)) throw new TypeError('Invalid t.Int');

@@ -12,0 +12,0 @@ return String(value);

import { TypeError } from '../utils';
export default {
toType: () => value => {
toType: () => (value) => {
try {

@@ -6,0 +6,0 @@ return JSON.parse(value);

@@ -5,3 +5,3 @@ import { TypeError, isInvalidArray } from '../utils';

defaultValue: [],
toType: options => value => {
toType: (options) => (value) => {
if (isInvalidArray(value, options)) throw new TypeError('Invalid t.Tuple');

@@ -11,3 +11,3 @@ const values = Array.isArray(value) ? value : [].concat(value);

},
toString: options => values => {
toString: (options) => (values) => {
if (!Array.isArray(values)) throw new TypeError('Invalid t.Tuple');

@@ -14,0 +14,0 @@ return values.map((value, index) => types[index].toString(options)(value));

@@ -39,5 +39,5 @@ import humps from 'humps';

return !options.keyFormat
? { camelize: a => a, decamelize: a => a }
? { camelize: (a) => a, decamelize: (a) => a }
: {
camelize: a => {
camelize: (a) => {
const args = { process: options.processKeys };

@@ -47,3 +47,3 @@ if (options.keyFormat === option.keyFormat.pascal) return humps.camelizeKeys(a, args);

},
decamelize: a => {
decamelize: (a) => {
const args = { split: options.splitKeys, process: options.processKeys };

@@ -50,0 +50,0 @@ if (options.keyFormat === option.keyFormat.pascal) return humps.pascalizeKeys(a, args);

import test from 'ava';
import { create, type, option } from '../src';
test('It should be able to export the required interface;', t => {
test('It should be able to export the required interface;', (t) => {
t.is(typeof create, 'function');

@@ -6,0 +6,0 @@ t.is(typeof type, 'object');

@@ -5,3 +5,3 @@ import test from 'ava';

test('It should be able to parse the parameters from a simple URL string;', t => {
test('It should be able to parse the parameters from a simple URL string;', (t) => {
const types = {

@@ -20,3 +20,3 @@ name: type.String,

test("It should be able to re-throw the error if it isn't related to types;", t => {
test("It should be able to re-throw the error if it isn't related to types;", (t) => {
const types = {

@@ -30,3 +30,3 @@ name: () => {},

test('It should be able to create objects with null prototype;', t => {
test('It should be able to create objects with null prototype;', (t) => {
const types = {

@@ -43,3 +43,3 @@ name: type.String,

test('It should be able to handle the inclusion of the default parameters;', t => {
test('It should be able to handle the inclusion of the default parameters;', (t) => {
const types = {

@@ -63,3 +63,3 @@ name: type.String,

test('It should be able to handle the removal of redundant URL parameters;', t => {
test('It should be able to handle the removal of redundant URL parameters;', (t) => {
const types = {

@@ -84,3 +84,3 @@ name: type.String,

test('It should be able to handle URL parameters in a different format;', t => {
test('It should be able to handle URL parameters in a different format;', (t) => {
const types = {

@@ -87,0 +87,0 @@ name: type.String,

@@ -5,3 +5,3 @@ import test from 'ava';

test('It should be able to stringify the parameters from a simple model;', t => {
test('It should be able to stringify the parameters from a simple model;', (t) => {
const types = {

@@ -16,3 +16,3 @@ name: type.String,

test('It should yield an empty string if there are not stringified parameters;', t => {
test('It should yield an empty string if there are not stringified parameters;', (t) => {
const types = {

@@ -26,3 +26,3 @@ name: type.String,

test('It should be able to handle the stripping of default parameters;', t => {
test('It should be able to handle the stripping of default parameters;', (t) => {
const types = {

@@ -41,3 +41,3 @@ name: type.String,

test('It should be able to handle the stripping of default parameters for arrays;', t => {
test('It should be able to handle the stripping of default parameters for arrays;', (t) => {
const types = {

@@ -65,3 +65,3 @@ name: type.String,

test('It should be able to handle the stripping of default parameters for sequenced arrays;', t => {
test('It should be able to handle the stripping of default parameters for sequenced arrays;', (t) => {
const types = {

@@ -89,3 +89,3 @@ name: type.String,

test('It should be able to handle the stripping of default parameters for tuples;', t => {
test('It should be able to handle the stripping of default parameters for tuples;', (t) => {
const types = {

@@ -109,3 +109,3 @@ name: type.String,

test('It should be able to handle the inclusion of the default parameters;', t => {
test('It should be able to handle the inclusion of the default parameters;', (t) => {
const types = {

@@ -129,3 +129,3 @@ name: type.String,

test('It should be able to specify the removal of parameters by passing null values;', t => {
test('It should be able to specify the removal of parameters by passing null values;', (t) => {
const types = {

@@ -141,3 +141,3 @@ name: type.String,

test('It should be able to handle the removal of redundant URL parameters;', t => {
test('It should be able to handle the removal of redundant URL parameters;', (t) => {
const types = {

@@ -155,3 +155,3 @@ name: type.String,

test('It should be able to handle URL parameters in a different format;', t => {
test('It should be able to handle URL parameters in a different format;', (t) => {
const types = {

@@ -182,3 +182,3 @@ name: type.String,

test('It should be able to return the typed default value if the value is invalid;', t => {
test('It should be able to return the typed default value if the value is invalid;', (t) => {
const types = {

@@ -198,3 +198,3 @@ name: type.String,

test('It should be able to handle the stringifying when the values are arrays;', t => {
test('It should be able to handle the stringifying when the values are arrays;', (t) => {
const instance = create({

@@ -201,0 +201,0 @@ countries: [type.Array(type.String), []],

@@ -9,3 +9,3 @@ import test from 'ava';

test('It should be able to handle comma separated arrays;', t => {
test('It should be able to handle comma separated arrays;', (t) => {
const instance = create(types, {

@@ -20,3 +20,3 @@ arrayFormat: option.arrayFormat.comma,

test('It should be able to omit the array item if it is empty;', t => {
test('It should be able to omit the array item if it is empty;', (t) => {
const instance = create(types, {

@@ -33,3 +33,3 @@ arrayFormat: option.arrayFormat.comma,

test('It should be able to handle comma separated arrays with a single value;', t => {
test('It should be able to handle comma separated arrays with a single value;', (t) => {
const instance = create(types, {

@@ -44,3 +44,3 @@ arrayFormat: option.arrayFormat.comma,

test('It should be able to handle indexed arrays;', t => {
test('It should be able to handle indexed arrays;', (t) => {
const instance = create(types, {

@@ -55,3 +55,3 @@ arrayFormat: option.arrayFormat.index,

test('It should be able to handle bracketed arrays;', t => {
test('It should be able to handle bracketed arrays;', (t) => {
const instance = create(types, {

@@ -66,3 +66,3 @@ arrayFormat: option.arrayFormat.bracket,

test('It should be able to handle duplicate key arrays;', t => {
test('It should be able to handle duplicate key arrays;', (t) => {
const instance = create(types, {

@@ -77,3 +77,3 @@ arrayFormat: option.arrayFormat.none,

test('It should be able to handle duplicate key arrays with a single value;', t => {
test('It should be able to handle duplicate key arrays with a single value;', (t) => {
const instance = create(types, {

@@ -88,3 +88,3 @@ arrayFormat: option.arrayFormat.none,

test('It should be able to handle the skipping of the defaults;', t => {
test('It should be able to handle the skipping of the defaults;', (t) => {
const instance = create(types, {

@@ -99,3 +99,3 @@ arrayFormat: option.arrayFormat.comma,

test('It should be able to handle the skipping of the defaults for sequences;', t => {
test('It should be able to handle the skipping of the defaults for sequences;', (t) => {
const instance = create(

@@ -113,3 +113,3 @@ { ...types, countries: [type.Array.Sequence(type.String), ['UK', 'RU']] },

test('It should be able to sanitize arrays when its values are invalid;', t => {
test('It should be able to sanitize arrays when its values are invalid;', (t) => {
const instance = create({ ...types, countries: type.Array(type.Int) }, { arrayFormat: option.arrayFormat.comma });

@@ -121,3 +121,3 @@ const parsed = instance.parse('name=Adam&countries=UK,RU');

test('It should be able to default to an empty array instead of null when not specified;', t => {
test('It should be able to default to an empty array instead of null when not specified;', (t) => {
const instance = create(

@@ -136,3 +136,3 @@ { ...types, countries: type.Array(type.String) },

test('It should be able to handle the defaults;', t => {
test('It should be able to handle the defaults;', (t) => {
const types = { name: type.String, ratings: [type.Array(type.Int), [1, 2, 3]] };

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

test('It should be able to handle custom separated arrays with a single value;', t => {
test('It should be able to handle custom separated arrays with a single value;', (t) => {
const instance = create(types, {

@@ -177,3 +177,3 @@ arrayFormat: option.arrayFormat.separator,

test('It should be able to handle custom separated arrays with multiple values;', t => {
test('It should be able to handle custom separated arrays with multiple values;', (t) => {
const instance = create(types, {

@@ -188,1 +188,18 @@ arrayFormat: option.arrayFormat.separator,

});
test('It should be able to handle an array with defaults;', (t) => {
const types = {
ids: [type.Array(type.Int), [1, 2]],
};
const instance = create(types, {
stripDefaults: true,
keyFormat: option.keyFormat.snake,
arrayFormat: option.arrayFormat.comma,
splitKeys: /(?=[A-Z0-9])/,
});
const parsed = instance.parse('ids=1,2,3');
t.deepEqual(parsed, { ids: [1, 2, 3] });
const stringified = instance.stringify(parsed);
t.is(stringified, '?ids=1,2,3');
});

@@ -9,3 +9,3 @@ import test from 'ava';

test('It should be able to handle BigInt types;', t => {
test('It should be able to handle BigInt types;', (t) => {
const instance = create(types);

@@ -18,3 +18,3 @@ const parsed = instance.parse('name=Adam&age=34');

test('It should be able to sanitize BigInts when the value is invalid;', t => {
test('It should be able to sanitize BigInts when the value is invalid;', (t) => {
const instance = create(types);

@@ -21,0 +21,0 @@ const parsed = instance.parse('name=Adam&age=ThirtyFour');

@@ -9,3 +9,3 @@ import test from 'ava';

test('It should be able to handle Bool types;', t => {
test('It should be able to handle Bool types;', (t) => {
const instance = create(types);

@@ -18,3 +18,3 @@ const parsed = instance.parse('name=Adam&isDeveloper=true');

test('It should be able to handle custom Bool types;', t => {
test('It should be able to handle custom Bool types;', (t) => {
const instance = create(types, { booleanStrings: ['yar', 'naw'] });

@@ -27,3 +27,3 @@ const parsed = instance.parse('name=Adam&isDeveloper=yar');

test('It should be able to sanitize Bools when the value is invalid;', t => {
test('It should be able to sanitize Bools when the value is invalid;', (t) => {
const instance = create(types);

@@ -30,0 +30,0 @@ const parsed = instance.parse('name=Adam&isDeveloper=yup');

@@ -8,3 +8,3 @@ import test from 'ava';

if (!value.includes(',')) raise('Invalid t.Location');
return value.split(' ').map(a => a.split(',').map(Number));
return value.split(' ').map((a) => a.split(',').map(Number));
});

@@ -25,3 +25,3 @@

test('It should be able to handle custom types;', t => {
test('It should be able to handle custom types;', (t) => {
const instance = create(types);

@@ -42,3 +42,3 @@ const model = {

test('It should be able to sanitize custom types when the value is invalid;', t => {
test('It should be able to sanitize custom types when the value is invalid;', (t) => {
const instance = create(types);

@@ -51,3 +51,3 @@ const stringified = instance.stringify({ name: 'Adam', location: [] });

test('It should be able to apply the defaults for custom types;', t => {
test('It should be able to apply the defaults for custom types;', (t) => {
const instance = create({ ...types, location: [Location, [[1, 2]]] }, { includeDefaults: true });

@@ -60,3 +60,3 @@ const stringified = instance.stringify({ name: 'Adam', location: false });

test('It should be able to skip applying defaults for custom types if default is invalid;', t => {
test('It should be able to skip applying defaults for custom types if default is invalid;', (t) => {
const instance = create({ ...types, location: [Location, 'an invalid default'] }, { includeDefaults: true });

@@ -63,0 +63,0 @@ const stringified = instance.stringify({ name: 'Adam', location: false });

@@ -23,3 +23,3 @@ import test from 'ava';

test('It should be able to handle Date types;', t => {
test('It should be able to handle Date types;', (t) => {
const instance = create(types, { dateFormat: 'YYYY-MM-DD' });

@@ -32,3 +32,3 @@ const parsed = instance.parse('name=Adam&birthDate=1985-10-10');

test('It should be able to handle Unix S Date types;', t => {
test('It should be able to handle Unix S Date types;', (t) => {
const instance = create({ ...types, birthDate: type.Date.UnixSeconds }, { dateFormat: 'YYYY-MM-DD' });

@@ -42,3 +42,3 @@ const parsed = instance.parse(`name=Adam&birthDate=${moment('1985-10-10').valueOf()}`);

test('It should be able to handle Unix MS Date types;', t => {
test('It should be able to handle Unix MS Date types;', (t) => {
const instance = create({ ...types, birthDate: type.Date.UnixMilliseconds }, { dateFormat: 'YYYY-MM-DD' });

@@ -52,3 +52,3 @@ const parsed = instance.parse(`name=Adam&birthDate=${moment('1985-10-10').unix()}`);

test('It should be able to sanitize Dates when the value is invalid;', t => {
test('It should be able to sanitize Dates when the value is invalid;', (t) => {
const instance = create(types);

@@ -60,3 +60,3 @@ const parsed = instance.parse('name=Adam&birthDate=10th Oct 1985');

test('It should be able to handle dates with a default value defined as a function;', t => {
test('It should be able to handle dates with a default value defined as a function;', (t) => {
const instance = create(

@@ -63,0 +63,0 @@ { ...types, birthDate: [type.Date, () => moment('2020-10-10').toDate()] },

@@ -9,3 +9,3 @@ import test from 'ava';

test('It should be able to handle Float types;', t => {
test('It should be able to handle Float types;', (t) => {
const instance = create(types);

@@ -18,3 +18,3 @@ const parsed = instance.parse('name=Adam&age=34.1');

test('It should be able to handle Float types with decimal places;', t => {
test('It should be able to handle Float types with decimal places;', (t) => {
const instance = create({ ...types, age: type.Float.DP(2) });

@@ -27,3 +27,3 @@ const parsed = instance.parse('name=Adam&age=34.18900');

test('It should be able to sanitize BigInts when the value is invalid;', t => {
test('It should be able to sanitize BigInts when the value is invalid;', (t) => {
const instance = create(types);

@@ -30,0 +30,0 @@ const parsed = instance.parse('name=Adam&age=ThirtyFourPointOne');

@@ -9,3 +9,3 @@ import test from 'ava';

test('It should be able to handle Int types;', t => {
test('It should be able to handle Int types;', (t) => {
const instance = create(types);

@@ -18,3 +18,3 @@ const parsed = instance.parse('name=Adam&age=34');

test('It should be able to round floats for the Int type;', t => {
test('It should be able to round floats for the Int type;', (t) => {
const instance = create(types);

@@ -25,3 +25,3 @@ const parsed = instance.parse('name=Adam&age=34.1');

test('It should be able to sanitize Ints when the value is invalid;', t => {
test('It should be able to sanitize Ints when the value is invalid;', (t) => {
const instance = create(types);

@@ -28,0 +28,0 @@ const parsed = instance.parse('name=Adam&age=ThirtyFour');

@@ -9,3 +9,3 @@ import test from 'ava';

test('It should be able to handle JSON types;', t => {
test('It should be able to handle JSON types;', (t) => {
const instance = create(types);

@@ -25,3 +25,3 @@ const model = {

test('It should be able to sanitize JSON when the value is invalid;', t => {
test('It should be able to sanitize JSON when the value is invalid;', (t) => {
const instance = create(types);

@@ -28,0 +28,0 @@ const parsed = instance.parse('name=Adam&profile=34,London');

@@ -8,3 +8,3 @@ import test from 'ava';

test('It should be able to handle String types;', t => {
test('It should be able to handle String types;', (t) => {
const instance = create(types);

@@ -11,0 +11,0 @@ const parsed = instance.parse('name=Adam');

@@ -9,3 +9,3 @@ import test from 'ava';

test('It should be able to handle comma separated tuples;', t => {
test('It should be able to handle comma separated tuples;', (t) => {
const instance = create(types, {

@@ -21,3 +21,3 @@ arrayFormat: option.arrayFormat.comma,

test('It should be able to sanitize tuples when its values are invalid;', t => {
test('It should be able to sanitize tuples when its values are invalid;', (t) => {
const instance = create(types, { arrayFormat: option.arrayFormat.comma });

@@ -24,0 +24,0 @@ const parsed = instance.parse('name=Adam&profile=Software Developer,ThirtyFour,True');

@@ -5,3 +5,3 @@ import test from 'ava';

test('It should be able to determine if the search params can be read;', t => {
test('It should be able to determine if the search params can be read;', (t) => {
global.location = {

@@ -15,3 +15,3 @@ search: '?name=Adam&age=34',

test('It should be able to handle the yielding of the type functions;', t => {
test('It should be able to handle the yielding of the type functions;', (t) => {
const int = utils.getType(type.Int);

@@ -24,3 +24,3 @@ t.is(int.defaultValue, null);

test('It should be able to handle the handle yielding default values;', t => {
test('It should be able to handle the handle yielding default values;', (t) => {
const string = utils.getType([type.String, 'Adam']);

@@ -30,3 +30,3 @@ t.is(string.defaultValue, 'Adam');

test('It should be able to determine when strings are equal;', t => {
test('It should be able to determine when strings are equal;', (t) => {
const string = utils.getType(type.String);

@@ -37,3 +37,3 @@ t.true(string.isSame('Adam', 'Adam'));

test('It should be able to determine when ints are equal;', t => {
test('It should be able to determine when ints are equal;', (t) => {
const int = utils.getType(type.Int);

@@ -44,3 +44,3 @@ t.true(int.isSame(1, 1));

test('It should be able to determine when arrays are equal;', t => {
test('It should be able to determine when arrays are equal;', (t) => {
const bool = utils.getType(type.Array(type.Int));

@@ -52,3 +52,3 @@ t.true(bool.isSame([1, 2, 3], [1, 2, 3]));

test('It should be able to determine when sequenced arrays are equal;', t => {
test('It should be able to determine when sequenced arrays are equal;', (t) => {
const bool = utils.getType(type.Array.Sequence(type.Int));

@@ -60,3 +60,3 @@ t.true(bool.isSame([1, 2, 3], [1, 2, 3]));

test('It should be able to decamelize objects based on the key format;', t => {
test('It should be able to decamelize objects based on the key format;', (t) => {
const defaultTransform = utils.getKeyFormat({ keyFormat: null });

@@ -76,3 +76,3 @@ t.deepEqual(defaultTransform.decamelize({ birthDate: '1985-10-10' }), {

test('It should be able to camelize objects based on the key format;', t => {
test('It should be able to camelize objects based on the key format;', (t) => {
const defaultTransform = utils.getKeyFormat({ keyFormat: null });

@@ -90,3 +90,3 @@ t.deepEqual(defaultTransform.camelize({ birthDate: '1985-10-10' }), {

test("It should be able to obtain the array format from the Symbol's description;", t => {
test("It should be able to obtain the array format from the Symbol's description;", (t) => {
t.is(utils.getArrayFormat({ arrayFormat: option.arrayFormat.index }), 'index');

@@ -93,0 +93,0 @@ t.is(utils.getArrayFormat({ arrayFormat: option.arrayFormat.bracket }), 'bracket');

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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