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

yup

Package Overview
Dependencies
Maintainers
1
Versions
127
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yup - npm Package Compare versions

Comparing version 0.13.0 to 0.14.0

7

CHANGELOG.md

@@ -0,1 +1,8 @@

v0.14.0 - Mon, 08 Feb 2016 16:17:40 GMT
---------------------------------------
- [86b6446](../../commit/86b6446) [fixed] camelcase should maintain leading underscores
v0.13.0 - Mon, 01 Feb 2016 20:49:40 GMT

@@ -2,0 +9,0 @@ ---------------------------------------

9

lib/object.js

@@ -25,2 +25,9 @@ 'use strict';

c.type('altCamel', function (str) {
var result = c.camel(str),
idx = str.search(/[^_]/);
return idx === 0 ? result : str.substr(0, idx) + result;
});
var childSchema = function childSchema(field, parent) {

@@ -221,3 +228,3 @@ return isRecursive(field) ? field.of ? field.of(parent) : parent : field;

return obj == null ? obj : transform(obj, function (newobj, val, key) {
return newobj[c.camel(key)] = val;
return newobj[c.altCamel(key)] = val;
});

@@ -224,0 +231,0 @@ });

2

package.json
{
"name": "yup",
"version": "0.13.0",
"version": "0.14.0",
"description": "Dead simple Object schema validation",

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

@@ -18,2 +18,9 @@ 'use strict';

c.type('altCamel', function(str) {
let result = c.camel(str)
, idx = str.search(/[^_]/)
return idx === 0 ? result : (str.substr(0, idx) + result)
})
let childSchema = (field, parent) => {

@@ -219,3 +226,3 @@ return isRecursive(field)

return this.transform(obj => obj == null ? obj
: transform(obj, (newobj, val, key ) => newobj[c.camel(key)] = val))
: transform(obj, (newobj, val, key ) => newobj[c.altCamel(key)] = val))
},

@@ -222,0 +229,0 @@

@@ -449,2 +449,11 @@ 'use strict';

it('should camelCase with leading underscore', function(){
var inst = object().camelcase()
inst
.cast({ CON_STAT: 5, __isNew: true, __IS_FUN: true })
.should
.eql({ conStat: 5, __isNew: true, __isFun: true })
})
it('should CONSTANT_CASE keys', function(){

@@ -451,0 +460,0 @@ var inst = object().shape({

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