mirror of
https://github.com/JuanCanham/HackMyResume.git
synced 2024-11-25 01:40:10 +00:00
Remove custom "extend" method.
Replace with NPM extend.
This commit is contained in:
parent
c98d05270e
commit
e72564162b
@ -51,6 +51,7 @@
|
|||||||
"chalk": "^1.1.1",
|
"chalk": "^1.1.1",
|
||||||
"commander": "^2.9.0",
|
"commander": "^2.9.0",
|
||||||
"copy": "^0.1.3",
|
"copy": "^0.1.3",
|
||||||
|
"extend": "^3.0.0",
|
||||||
"fresca": "~0.4.0",
|
"fresca": "~0.4.0",
|
||||||
"fresh-jrs-converter": "^0.2.0",
|
"fresh-jrs-converter": "^0.2.0",
|
||||||
"fresh-resume-starter": "^0.2.0",
|
"fresh-resume-starter": "^0.2.0",
|
||||||
|
@ -13,7 +13,7 @@ Definition of the `main` function.
|
|||||||
var HMR = require( '../hackmyapi')
|
var HMR = require( '../hackmyapi')
|
||||||
, PKG = require('../../package.json')
|
, PKG = require('../../package.json')
|
||||||
, FS = require('fs')
|
, FS = require('fs')
|
||||||
, EXTEND = require('../utils/extend')
|
, EXTEND = require('extend')
|
||||||
, chalk = require('chalk')
|
, chalk = require('chalk')
|
||||||
, PATH = require('path')
|
, PATH = require('path')
|
||||||
, HACKMYSTATUS = require('../core/status-codes')
|
, HACKMYSTATUS = require('../core/status-codes')
|
||||||
|
@ -18,7 +18,7 @@ Output routines for HackMyResume.
|
|||||||
, PATH = require('path')
|
, PATH = require('path')
|
||||||
, LO = require('lodash')
|
, LO = require('lodash')
|
||||||
, FS = require('fs')
|
, FS = require('fs')
|
||||||
, EXTEND = require('../utils/extend')
|
, EXTEND = require('extend')
|
||||||
, HANDLEBARS = require('handlebars')
|
, HANDLEBARS = require('handlebars')
|
||||||
, YAML = require('yamljs')
|
, YAML = require('yamljs')
|
||||||
, printf = require('printf')
|
, printf = require('printf')
|
||||||
|
@ -11,7 +11,7 @@ Definition of the FRESHResume class.
|
|||||||
|
|
||||||
|
|
||||||
var FS = require('fs')
|
var FS = require('fs')
|
||||||
, extend = require('../utils/extend')
|
, extend = require('extend')
|
||||||
, validator = require('is-my-json-valid')
|
, validator = require('is-my-json-valid')
|
||||||
, _ = require('underscore')
|
, _ = require('underscore')
|
||||||
, __ = require('lodash')
|
, __ = require('lodash')
|
||||||
|
@ -9,13 +9,12 @@ Definition of the FRESHTheme class.
|
|||||||
|
|
||||||
|
|
||||||
var FS = require('fs')
|
var FS = require('fs')
|
||||||
, extend = require('../utils/extend')
|
|
||||||
, validator = require('is-my-json-valid')
|
, validator = require('is-my-json-valid')
|
||||||
, _ = require('underscore')
|
, _ = require('underscore')
|
||||||
, PATH = require('path')
|
, PATH = require('path')
|
||||||
, parsePath = require('parse-filepath')
|
, parsePath = require('parse-filepath')
|
||||||
, pathExists = require('path-exists').sync
|
, pathExists = require('path-exists').sync
|
||||||
, EXTEND = require('../utils/extend')
|
, EXTEND = require('extend')
|
||||||
, moment = require('moment')
|
, moment = require('moment')
|
||||||
, READFILES = require('recursive-readdir-sync');
|
, READFILES = require('recursive-readdir-sync');
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ Definition of the JRSResume class.
|
|||||||
|
|
||||||
|
|
||||||
var FS = require('fs')
|
var FS = require('fs')
|
||||||
, extend = require('../utils/extend')
|
, extend = require('extend')
|
||||||
, validator = require('is-my-json-valid')
|
, validator = require('is-my-json-valid')
|
||||||
, _ = require('underscore')
|
, _ = require('underscore')
|
||||||
, PATH = require('path')
|
, PATH = require('path')
|
||||||
|
@ -16,7 +16,7 @@ Definition of the TemplateGenerator class. TODO: Refactor
|
|||||||
, parsePath = require('parse-filepath')
|
, parsePath = require('parse-filepath')
|
||||||
, MKDIRP = require('mkdirp')
|
, MKDIRP = require('mkdirp')
|
||||||
, BaseGenerator = require( './base-generator' )
|
, BaseGenerator = require( './base-generator' )
|
||||||
, EXTEND = require('../utils/extend')
|
, EXTEND = require('extend')
|
||||||
, FRESHTheme = require('../core/fresh-theme')
|
, FRESHTheme = require('../core/fresh-theme')
|
||||||
, JRSTheme = require('../core/jrs-theme');
|
, JRSTheme = require('../core/jrs-theme');
|
||||||
|
|
||||||
|
@ -1,79 +0,0 @@
|
|||||||
/**
|
|
||||||
Definition of the `extend` method.
|
|
||||||
@license MIT. Copyright (c) 2015 James Devlin / FluentDesk.
|
|
||||||
@module extend.js
|
|
||||||
*/
|
|
||||||
|
|
||||||
function _extend() {
|
|
||||||
|
|
||||||
function isPlainObject( obj ) {
|
|
||||||
if ((typeof obj !== "object") || obj.nodeType ||
|
|
||||||
(obj !== null && obj === obj.window)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (obj.constructor &&
|
|
||||||
!hasOwnProperty.call( obj.constructor.prototype, "isPrototypeOf" )) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
var options
|
|
||||||
, name
|
|
||||||
, src
|
|
||||||
, copy
|
|
||||||
, copyIsArray
|
|
||||||
, clone
|
|
||||||
, target = arguments[0] || {}
|
|
||||||
, i = 1
|
|
||||||
, length = arguments.length
|
|
||||||
, deep = false;
|
|
||||||
|
|
||||||
// Handle a deep copy situation
|
|
||||||
if (typeof target === "boolean") {
|
|
||||||
deep = target;
|
|
||||||
// Skip the boolean and the target
|
|
||||||
target = arguments[i] || {};
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handle case when target is a string or something (possible in deep copy)
|
|
||||||
//if (typeof target !== "object" && !jQuery.isFunction(target))
|
|
||||||
if (typeof target !== "object" && typeof target !== "function")
|
|
||||||
target = {};
|
|
||||||
|
|
||||||
for (; i < length; i++) {
|
|
||||||
// Only deal with non-null/undefined values
|
|
||||||
if ((options = arguments[i]) !== null) {
|
|
||||||
// Extend the base object
|
|
||||||
for (name in options) {
|
|
||||||
src = target[name];
|
|
||||||
copy = options[name];
|
|
||||||
|
|
||||||
// Prevent never-ending loop
|
|
||||||
if (target === copy) continue;
|
|
||||||
|
|
||||||
// Recurse if we're merging plain objects or arrays
|
|
||||||
if (deep && copy && (isPlainObject(copy) ||
|
|
||||||
(copyIsArray = (copy.constructor === Array)))) {
|
|
||||||
if (copyIsArray) {
|
|
||||||
copyIsArray = false;
|
|
||||||
clone = src && (src.constructor === Array) ? src : [];
|
|
||||||
} else {
|
|
||||||
clone = src && isPlainObject(src) ? src : {};
|
|
||||||
}
|
|
||||||
// Never move original objects, clone them
|
|
||||||
target[name] = _extend(deep, clone, copy);
|
|
||||||
// Don't bring in undefined values
|
|
||||||
} else if (copy !== undefined) {
|
|
||||||
target[name] = copy;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Return the modified object
|
|
||||||
return target;
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = _extend;
|
|
@ -10,26 +10,23 @@ Implementation of the 'build' verb for HackMyResume.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
var PATH = require('path')
|
var _ = require('underscore')
|
||||||
|
, PATH = require('path')
|
||||||
, FS = require('fs')
|
, FS = require('fs')
|
||||||
, MD = require('marked')
|
, MD = require('marked')
|
||||||
, MKDIRP = require('mkdirp')
|
, MKDIRP = require('mkdirp')
|
||||||
, EXTEND = require('../utils/extend')
|
, extend = require('extend')
|
||||||
|
, parsePath = require('parse-filepath')
|
||||||
|
, RConverter = require('fresh-jrs-converter')
|
||||||
, HMSTATUS = require('../core/status-codes')
|
, HMSTATUS = require('../core/status-codes')
|
||||||
, HMEVENT = require('../core/event-codes')
|
, HMEVENT = require('../core/event-codes')
|
||||||
, RConverter = require('fresh-jrs-converter')
|
|
||||||
, RTYPES = { FRESH: require('../core/fresh-resume'),
|
, RTYPES = { FRESH: require('../core/fresh-resume'),
|
||||||
JRS: require('../core/jrs-resume') }
|
JRS: require('../core/jrs-resume') }
|
||||||
, parsePath = require('parse-filepath')
|
|
||||||
, _opts = require('../core/default-options')
|
, _opts = require('../core/default-options')
|
||||||
, FluentTheme = require('../core/fresh-theme')
|
, FRESHTheme = require('../core/fresh-theme')
|
||||||
, JRSTheme = require('../core/jrs-theme')
|
, JRSTheme = require('../core/jrs-theme')
|
||||||
, ResumeFactory = require('../core/resume-factory')
|
, ResumeFactory = require('../core/resume-factory')
|
||||||
, _ = require('underscore')
|
|
||||||
, _fmts = require('../core/default-formats')
|
, _fmts = require('../core/default-formats')
|
||||||
, extend = require('../utils/extend')
|
|
||||||
, chalk = require('chalk')
|
|
||||||
, pad = require('string-padding')
|
|
||||||
, Verb = require('../verbs/verb');
|
, Verb = require('../verbs/verb');
|
||||||
|
|
||||||
var _err, _log, _rezObj;
|
var _err, _log, _rezObj;
|
||||||
@ -346,7 +343,7 @@ Implementation of the 'build' verb for HackMyResume.
|
|||||||
|
|
||||||
// Create a FRESH or JRS theme object
|
// Create a FRESH or JRS theme object
|
||||||
var theTheme = _opts.theme.indexOf('jsonresume-theme-') > -1 ?
|
var theTheme = _opts.theme.indexOf('jsonresume-theme-') > -1 ?
|
||||||
new JRSTheme().open(tFolder) : new FluentTheme().open( tFolder );
|
new JRSTheme().open(tFolder) : new FRESHTheme().open( tFolder );
|
||||||
|
|
||||||
// Cache the theme object
|
// Cache the theme object
|
||||||
_opts.themeObj = theTheme;
|
_opts.themeObj = theTheme;
|
||||||
|
Loading…
Reference in New Issue
Block a user