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

archetype

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

archetype - npm Package Compare versions

Comparing version 0.10.2 to 0.11.0

10

CHANGELOG.md

@@ -0,1 +1,11 @@

<a name="0.11.0"></a>
# [0.11.0](https://github.com/boosterfuels/archetype/compare/v0.10.2...v0.11.0) (2020-02-27)
### Features
* make `new Type()` clone by default, but allow passing in an option to disable cloning for perf ([3638b57](https://github.com/boosterfuels/archetype/commit/3638b57))
<a name="0.10.2"></a>

@@ -2,0 +12,0 @@ ## [0.10.2](https://github.com/boosterfuels/archetype/compare/v0.10.0...v0.10.2) (2020-02-25)

3

package.json
{
"name": "archetype",
"version": "0.10.2",
"version": "0.11.0",
"author": "Valeri Karpov <val@boosterfuels.com>",
"dependencies": {
"lodash.clonedeep": "4.x",
"lodash.set": "4.x",

@@ -7,0 +8,0 @@ "mpath": "0.5.1",

@@ -5,2 +5,3 @@ 'use strict';

const Type = require('./type');
const cloneDeep = require('lodash.clonedeep');
const get = require('./get');

@@ -13,3 +14,3 @@ const set = require('lodash.set');

constructor(obj) {
this._obj = obj;
this._obj = cloneDeep(obj);
this._paths = {};

@@ -16,0 +17,0 @@ }

'use strict';
const cloneDeep = require('lodash.clonedeep');
const unmarshal = require('./unmarshal');
class Type {
constructor(obj, projection) {
constructor(obj, projection, options) {
options = options || {};
if (options.clone !== false) {
obj = cloneDeep(obj);
}
Object.assign(this, unmarshal(obj, this.constructor.schema, projection));

@@ -8,0 +14,0 @@ }

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