1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2025-05-02 12:27:08 +01:00

chore: update project dependencies

This commit is contained in:
hacksalot
2018-02-12 00:05:29 -05:00
parent 7144126175
commit c4f7350528
71 changed files with 1600 additions and 1737 deletions

View File

@ -1,10 +1,8 @@
/**
Definition of the SyntaxErrorEx class.
@module file-contains.js
*/
(function() {
/**
Definition of the SyntaxErrorEx class.
@module file-contains.js
*/
module.exports = function(file, needle) {
return require('fs').readFileSync(file, 'utf-8').indexOf(needle) > -1;
};

View File

@ -1,10 +1,23 @@
/**
Defines a regex suitable for matching FRESH versions.
@module file-contains.js
*/
(function() {
/**
Defines a regex suitable for matching FRESH versions.
@module file-contains.js
*/
// Set up a regex that matches all of the following:
// - FRESH
// - JRS
// - FRESCA
// - FRESH@1.0.0
// - FRESH@1.0
// - FRESH@1
// - JRS@0.16.0
// - JRS@0.16
// - JRS@0
// Don't use a SEMVER regex (eg, NPM's semver-regex) because a) we want to
// support partial semvers like "0" or "1.2" and b) we'll expand this later to
// support fully scoped FRESH versions.
module.exports = function() {
return RegExp('^(FRESH|FRESCA|JRS)(?:@(\\d+(?:\\.\\d+)?(?:\\.\\d+)?))?$');
};

View File

@ -1,11 +1,9 @@
/**
Definition of the Markdown to WordProcessingML conversion routine.
@license MIT. Copyright (c) 2015 James Devlin / FluentDesk.
@module utils/html-to-wpml
*/
(function() {
/**
Definition of the Markdown to WordProcessingML conversion routine.
@license MIT. Copyright (c) 2015 James Devlin / FluentDesk.
@module utils/html-to-wpml
*/
var HTML5Tokenizer, XML, _;
XML = require('xml-escape');
@ -16,8 +14,12 @@ Definition of the Markdown to WordProcessingML conversion routine.
module.exports = function(html) {
var final, is_bold, is_italic, is_link, link_url, tokens;
// Tokenize the HTML stream.
tokens = HTML5Tokenizer.tokenize(html);
final = is_bold = is_italic = is_link = link_url = '';
// Process <em>, <strong>, and <a> elements in the HTML stream, producing
// equivalent WordProcessingML that can be dumped into a <w:p> or other
// text container element.
_.each(tokens, function(tok) {
var style;
switch (tok.type) {

View File

@ -1,11 +1,9 @@
/**
Inline Markdown-to-Chalk conversion routines.
@license MIT. See LICENSE.md for details.
@module utils/md2chalk
*/
(function() {
/**
Inline Markdown-to-Chalk conversion routines.
@license MIT. See LICENSE.md for details.
@module utils/md2chalk
*/
var CHALK, LO, MD;
MD = require('marked');

View File

@ -1,4 +1,7 @@
(function() {
// Exemplar script for generating documents with Phantom.js.
// https://raw.githubusercontent.com/ariya/phantomjs/master/examples/rasterize.js
// Converted to CoffeeScript by hacksalot
"use strict";
var address, output, page, pageHeight, pageWidth, size, system;
@ -50,7 +53,7 @@
} else {
console.log("size:", system.args[3]);
pageWidth = parseInt(system.args[3], 10);
pageHeight = parseInt(pageWidth * 3 / 4, 10);
pageHeight = parseInt(pageWidth * 3 / 4, 10); // it's as good an assumption as any
console.log("pageHeight:", pageHeight);
page.viewportSize = {
width: pageWidth,

View File

@ -1,13 +1,11 @@
/**
Definition of the ResumeDetector class.
@module utils/resume-detector
@license MIT. See LICENSE.md for details.
*/
(function() {
/**
Definition of the ResumeDetector class.
@module utils/resume-detector
@license MIT. See LICENSE.md for details.
*/
module.exports = function(rez) {
if (rez.meta && rez.meta.format) {
if (rez.meta && rez.meta.format) { //&& rez.meta.format.substr(0, 5).toUpperCase() == 'FRESH'
return 'fresh';
} else if (rez.basics) {
return 'jrs';

View File

@ -1,6 +1,5 @@
(function() {
module.exports = {
/**
Removes ignored or private fields from a resume object
@returns an object with the following structure:
@ -9,24 +8,24 @@
ignoreList: an array of ignored nodes that were removed
privateList: an array of private nodes that were removed
}
*/
*/
scrubResume: function(rep, opts) {
var ignoreList, includePrivates, privateList, scrubbed, traverse;
traverse = require('traverse');
ignoreList = [];
privateList = [];
includePrivates = opts && opts["private"];
scrubbed = traverse(rep).map(function() {
includePrivates = opts && opts.private;
scrubbed = traverse(rep).map(function() { // [^1]
if (!this.isLeaf) {
if (this.node.ignore === true || this.node.ignore === 'true') {
ignoreList.push(this.node);
this["delete"]();
} else if ((this.node["private"] === true || this.node["private"] === 'true') && !includePrivates) {
this.delete();
} else if ((this.node.private === true || this.node.private === 'true') && !includePrivates) {
privateList.push(this.node);
this["delete"]();
this.delete();
}
}
if (_.isArray(this.node)) {
if (_.isArray(this.node)) { // [^2]
this.after(function() {
this.update(_.compact(this.node));
});
@ -40,6 +39,17 @@
}
};
// [^1]: As of v0.6.6, the NPM traverse library has a quirk when attempting
// to remove array elements directly using traverse's `this.remove`. See:
// https://github.com/substack/js-traverse/issues/48
// [^2]: The workaround is to use traverse's 'this.delete' to nullify the value
// first, followed by removal with something like _.compact.
// https://github.com/substack/js-traverse/issues/48#issuecomment-142607200
}).call(this);
//# sourceMappingURL=resume-scrubber.js.map

View File

@ -1,11 +1,9 @@
/**
Definition of the SafeJsonLoader class.
@module utils/safe-json-loader
@license MIT. See LICENSE.md for details.
*/
(function() {
/**
Definition of the SafeJsonLoader class.
@module utils/safe-json-loader
@license MIT. See LICENSE.md for details.
*/
var FS, SyntaxErrorEx;
FS = require('fs');
@ -13,16 +11,19 @@ Definition of the SafeJsonLoader class.
SyntaxErrorEx = require('./syntax-error-ex');
module.exports = function(file) {
var ret, retRaw;
var err, ret, retRaw;
ret = {};
try {
ret.raw = FS.readFileSync(file, 'utf8');
ret.json = JSON.parse(ret.raw);
} catch (_error) {
} catch (error) {
err = error;
// If we get here, either FS.readFileSync or JSON.parse failed.
// We'll return HMSTATUS.readError or HMSTATUS.parseError.
retRaw = ret.raw && ret.raw.trim();
ret.ex = {
op: retRaw ? 'parse' : 'read',
inner: SyntaxErrorEx.is(_error) ? new SyntaxErrorEx(_error, retRaw) : _error,
inner: SyntaxErrorEx.is(err) ? new SyntaxErrorEx(err, retRaw) : err,
file: file
};
}

View File

@ -1,19 +1,15 @@
/**
Safe spawn utility for HackMyResume / FluentCV.
@module utils/safe-spawn
@license MIT. See LICENSE.md for details.
*/
/** Safely spawn a process synchronously or asynchronously without throwing an
exception
*/
(function() {
/**
Safe spawn utility for HackMyResume / FluentCV.
@module utils/safe-spawn
@license MIT. See LICENSE.md for details.
*/
/** Safely spawn a process synchronously or asynchronously without throwing an
exception */
module.exports = function(cmd, args, isSync, callback, param) {
var info, spawn;
var ex, info, spawn;
try {
// .spawnSync not available on earlier Node.js, so default to .spawn
spawn = require('child_process')[isSync ? 'spawnSync' : 'spawn'];
info = spawn(cmd, args);
if (!isSync) {
@ -33,11 +29,12 @@ exception
};
}
}
} catch (_error) {
} catch (error) {
ex = error;
if (typeof callback === "function") {
callback(_error, param);
callback(ex, param);
}
return _error;
return ex;
}
};

View File

@ -1,26 +1,23 @@
/**
Object string transformation.
@module utils/string-transformer
@license MIT. See LICENSE.md for details.
*/
(function() {
/**
Object string transformation.
@module utils/string-transformer
@license MIT. See LICENSE.md for details.
*/
var _, moment;
_ = require('underscore');
moment = require('moment');
/**
Create a copy of this object in which all string fields have been run through
a transformation function (such as a Markdown filter or XML encoder).
*/
*/
module.exports = function(ret, filt, transformer) {
var that, transformStringsInObject;
that = this;
// TODO: refactor recursion
transformStringsInObject = function(obj, filters) {
if (!obj) {
return;

22
dist/utils/string.js vendored
View File

@ -1,17 +1,13 @@
/**
Definitions of string utility functions.
@module utils/string
*/
/**
Determine if the string is null, empty, or whitespace.
See: http://stackoverflow.com/a/32800728/4942583
@method isNullOrWhitespace
*/
(function() {
/**
Definitions of string utility functions.
@module utils/string
*/
/**
Determine if the string is null, empty, or whitespace.
See: http://stackoverflow.com/a/32800728/4942583
@method isNullOrWhitespace
*/
String.isNullOrWhitespace = function(input) {
return !input || !input.trim();
};

View File

@ -1,26 +1,22 @@
/**
Definition of the SyntaxErrorEx class.
@module utils/syntax-error-ex
@license MIT. See LICENSE.md for details.
*/
/**
Represents a SyntaxError exception with line and column info.
Collect syntax error information from the provided exception object. The
JavaScript `SyntaxError` exception isn't interpreted uniformly across environ-
ments, so we reparse on error to grab the line and column.
See: http://stackoverflow.com/q/13323356
@class SyntaxErrorEx
*/
(function() {
/**
Definition of the SyntaxErrorEx class.
@module utils/syntax-error-ex
@license MIT. See LICENSE.md for details.
*/
var SyntaxErrorEx;
SyntaxErrorEx = (function() {
function SyntaxErrorEx(ex, rawData) {
var JSONLint, colNum, lineNum, lint, ref;
/**
Represents a SyntaxError exception with line and column info.
Collect syntax error information from the provided exception object. The
JavaScript `SyntaxError` exception isn't interpreted uniformly across environ-
ments, so we reparse on error to grab the line and column.
See: http://stackoverflow.com/q/13323356
@class SyntaxErrorEx
*/
SyntaxErrorEx = class SyntaxErrorEx {
constructor(ex, rawData) {
var JSONLint, colNum, err, lineNum, lint;
lineNum = null;
colNum = null;
JSONLint = require('json-lint');
@ -28,22 +24,22 @@ See: http://stackoverflow.com/q/13323356
comments: false
});
if (lint.error) {
ref = [lint.line, lint.character], this.line = ref[0], this.col = ref[1];
[this.line, this.col] = [lint.line, lint.character];
}
if (!lint.error) {
JSONLint = require('jsonlint');
try {
JSONLint.parse(rawData);
} catch (_error) {
this.line = (/on line (\d+)/.exec(_error))[1];
} catch (error) {
err = error;
this.line = (/on line (\d+)/.exec(err))[1];
}
}
}
return SyntaxErrorEx;
})();
};
// Return true if the supplied parameter is a JavaScript SyntaxError
SyntaxErrorEx.is = function(ex) {
return ex instanceof SyntaxError;
};