Comparing version 1.1.4 to 1.2.0
export declare class Eredita { | ||
protected data: any; | ||
protected parent: Eredita; | ||
protected parent?: Eredita; | ||
dirty: boolean; | ||
@@ -16,5 +16,6 @@ constructor(data: any, parent?: Eredita); | ||
} | ||
export declare const dot: typeof Eredita.dot; | ||
export declare const deepExtend: typeof Eredita.deepExtend; | ||
export declare function mixin(): { | ||
deepExtend: (target: any, ...args: object[]) => any; | ||
deepExtend: typeof Eredita.deepExtend; | ||
}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.mixin = exports.deepExtend = exports.dot = exports.Eredita = void 0; | ||
const isArray = Array.isArray; | ||
@@ -71,5 +72,5 @@ const isObject = function (obj) { | ||
let p = null; | ||
for (let i = 0, max = parts.length - 1; p = parts[i], i < max; i++) { | ||
for (let i = 0, max = parts.length - 1; (p = parts[i]), i < max; i++) { | ||
if (typeof ref[p] !== 'object') { | ||
ref[p] = (parseInt(parts[i + 1]) || parts[i + 1] == '0') ? [] : {}; | ||
ref[p] = parseInt(parts[i + 1]) || parts[i + 1] == '0' ? [] : {}; | ||
} | ||
@@ -108,3 +109,3 @@ ref = ref[p]; | ||
else if (val instanceof Buffer) { | ||
tmpBuf = new Buffer(val.length); | ||
tmpBuf = Buffer.alloc(val.length); | ||
val.copy(tmpBuf); | ||
@@ -119,3 +120,3 @@ target[key] = tmpBuf; | ||
if (typeof src !== 'object' || src === null) { | ||
clone = (isArray(val)) ? [] : {}; | ||
clone = isArray(val) ? [] : {}; | ||
target[key] = Eredita.deepExtend(clone, val); | ||
@@ -125,6 +126,6 @@ continue; | ||
if (isArray(val)) { | ||
clone = (isArray(src)) ? src : []; | ||
clone = isArray(src) ? src : []; | ||
} | ||
else { | ||
clone = (!isArray(src)) ? src : {}; | ||
clone = !isArray(src) ? src : {}; | ||
} | ||
@@ -138,6 +139,7 @@ target[key] = Eredita.deepExtend(clone, val); | ||
exports.Eredita = Eredita; | ||
exports.dot = Eredita.dot; | ||
exports.deepExtend = Eredita.deepExtend; | ||
function mixin() { | ||
return { | ||
deepExtend: exports.deepExtend | ||
deepExtend: exports.deepExtend, | ||
}; | ||
@@ -144,0 +146,0 @@ } |
{ | ||
"name": "eredita", | ||
"version": "1.1.4", | ||
"version": "1.2.0", | ||
"description": "Javascript Data Inheritance", | ||
@@ -19,3 +19,3 @@ "main": "dist/index.js", | ||
"cover": "nyc --reporter=lcov --reporter=text npm t", | ||
"semantic-release": "semantic-release pre && npm publish && semantic-release post" | ||
"semantic-release": "semantic-release" | ||
}, | ||
@@ -46,17 +46,17 @@ "repository": { | ||
"devDependencies": { | ||
"@types/node": "8.0.26", | ||
"chai": "4.1.2", | ||
"@types/node": "14.6.2", | ||
"chai": "4.2.0", | ||
"chai-as-promised": "7.1.1", | ||
"chai-spies": "0.7.1", | ||
"commitizen": "2.9.6", | ||
"coveralls": "2.13.1", | ||
"cz-conventional-changelog": "2.0.0", | ||
"husky": "0.14.3", | ||
"lodash": "4.17.4", | ||
"mocha": "3.5.0", | ||
"nyc": "11.2.0", | ||
"rimraf": "2.6.1", | ||
"semantic-release": "^7.0.2", | ||
"typescript": "2.5.2", | ||
"underscore": "1.8.3" | ||
"chai-spies": "1.0.0", | ||
"commitizen": "4.2.1", | ||
"coveralls": "3.1.0", | ||
"cz-conventional-changelog": "3.3.0", | ||
"husky": "4.2.5", | ||
"lodash": "4.17.20", | ||
"mocha": "8.1.3", | ||
"nyc": "15.1.0", | ||
"rimraf": "3.0.2", | ||
"semantic-release": "^17.1.1", | ||
"typescript": "4.0.2", | ||
"underscore": "1.11.0" | ||
}, | ||
@@ -68,2 +68,2 @@ "config": { | ||
} | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8333
162