-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sean Hamilton
committed
May 25, 2019
1 parent
dd23c99
commit f68d2d2
Showing
15 changed files
with
3,488 additions
and
3,467 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var IconType; | ||
(function (IconType) { | ||
IconType["SOLID"] = "solid"; | ||
IconType["OUTLINE"] = "outline"; | ||
IconType["THIN"] = "thin"; | ||
IconType["BRAND"] = "brand"; | ||
})(IconType || (IconType = {})); | ||
exports.default = IconType; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var IconType; | ||
(function (IconType) { | ||
IconType["SOLID"] = "solid"; | ||
IconType["OUTLINE"] = "outline"; | ||
IconType["THIN"] = "thin"; | ||
IconType["BRAND"] = "brand"; | ||
})(IconType || (IconType = {})); | ||
exports.default = IconType; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,49 @@ | ||
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; | ||
result["default"] = mod; | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
// tasks | ||
var InitialPrompt_1 = __importDefault(require("./tasks/InitialPrompt")); | ||
var DownloadAsset_1 = __importDefault(require("./tasks/DownloadAsset")); | ||
var BuildDist_1 = __importDefault(require("./tasks/BuildDist")); | ||
var CleanUp_1 = __importDefault(require("./tasks/CleanUp")); | ||
// utils | ||
var Logger_1 = __importDefault(require("./util/Logger")); | ||
function run() { | ||
if (process.argv.includes('--clean')) { | ||
CleanUp_1.default() | ||
.then(function () { | ||
process.exit(0); | ||
}); | ||
} | ||
else { | ||
InitialPrompt_1.default() | ||
.then(function (results) { | ||
DownloadAsset_1.default(results) | ||
.then(function (paths) { | ||
Promise.resolve().then(function () { return __importStar(require("./parsers/" + results.iconSet.parser)); }).then(function (Parser) { | ||
Parser.default(results, paths) | ||
.then(function (parseResults) { | ||
BuildDist_1.default(results, parseResults) | ||
.then(function () { | ||
process.exit(0); | ||
}); | ||
}); | ||
}) | ||
.catch(function (err) { | ||
Logger_1.default.error(err); | ||
process.exit(1); | ||
}); | ||
}); | ||
}); | ||
} | ||
} | ||
exports.default = run; | ||
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; | ||
result["default"] = mod; | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
// tasks | ||
var InitialPrompt_1 = __importDefault(require("./tasks/InitialPrompt")); | ||
var DownloadAsset_1 = __importDefault(require("./tasks/DownloadAsset")); | ||
var BuildDist_1 = __importDefault(require("./tasks/BuildDist")); | ||
var CleanUp_1 = __importDefault(require("./tasks/CleanUp")); | ||
// utils | ||
var Logger_1 = __importDefault(require("./util/Logger")); | ||
function run() { | ||
if (process.argv.includes('--clean')) { | ||
CleanUp_1.default() | ||
.then(function () { | ||
process.exit(0); | ||
}); | ||
} | ||
else { | ||
InitialPrompt_1.default() | ||
.then(function (results) { | ||
DownloadAsset_1.default(results) | ||
.then(function (paths) { | ||
Promise.resolve().then(function () { return __importStar(require("./parsers/" + results.iconSet.parser)); }).then(function (Parser) { | ||
Parser.default(results, paths) | ||
.then(function (parseResults) { | ||
BuildDist_1.default(results, parseResults) | ||
.then(function () { | ||
process.exit(0); | ||
}); | ||
}); | ||
}) | ||
.catch(function (err) { | ||
Logger_1.default.error(err); | ||
process.exit(1); | ||
}); | ||
}); | ||
}); | ||
} | ||
} | ||
exports.default = run; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,42 @@ | ||
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
// static | ||
var categories_json_1 = __importDefault(require("../static/categories.json")); | ||
var Category = /** @class */ (function () { | ||
function Category(data) { | ||
this.data = data; | ||
} | ||
Object.defineProperty(Category.prototype, "rawName", { | ||
get: function () { | ||
return this.data.name; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(Category.prototype, "name", { | ||
get: function () { | ||
return this.data.label; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(Category.prototype, "description", { | ||
get: function () { | ||
return categories_json_1.default[this.rawName]; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(Category.prototype, "icons", { | ||
get: function () { | ||
return this.data.icons; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
return Category; | ||
}()); | ||
exports.default = Category; | ||
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
// static | ||
var categories_json_1 = __importDefault(require("../static/categories.json")); | ||
var Category = /** @class */ (function () { | ||
function Category(data) { | ||
this.data = data; | ||
} | ||
Object.defineProperty(Category.prototype, "rawName", { | ||
get: function () { | ||
return this.data.name; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(Category.prototype, "name", { | ||
get: function () { | ||
return this.data.label; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(Category.prototype, "description", { | ||
get: function () { | ||
return categories_json_1.default[this.rawName]; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(Category.prototype, "icons", { | ||
get: function () { | ||
return this.data.icons; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
return Category; | ||
}()); | ||
exports.default = Category; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,85 @@ | ||
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
// utils | ||
var Converter_1 = __importDefault(require("../util/Converter")); | ||
// enums | ||
var IconType_1 = __importDefault(require("../enums/IconType")); | ||
// static | ||
var corrections_json_1 = __importDefault(require("../static/corrections.json")); | ||
var Icon = /** @class */ (function () { | ||
function Icon(data) { | ||
this.data = data; | ||
} | ||
Icon.prototype.hasCorrection = function (field) { | ||
var iconCorrection = corrections_json_1.default[this.rawName]; | ||
if (iconCorrection !== undefined) { | ||
return iconCorrection[field] !== undefined; | ||
} | ||
return false; | ||
}; | ||
Icon.prototype.correction = function (field) { | ||
return this.hasCorrection(field) | ||
? corrections_json_1.default[this.rawName][field] | ||
: ''; | ||
}; | ||
Object.defineProperty(Icon.prototype, "rawName", { | ||
get: function () { | ||
return this.data.name; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(Icon.prototype, "name", { | ||
get: function () { | ||
var name = this.data.name; | ||
if (this.type === IconType_1.default.OUTLINE) { | ||
name += '-outline'; | ||
} | ||
if (this.type === IconType_1.default.THIN) { | ||
name += '-thin'; | ||
} | ||
return this.hasCorrection('name') | ||
? this.correction('name') | ||
: Converter_1.default.iconName(name); | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(Icon.prototype, "className", { | ||
get: function () { | ||
return this.hasCorrection('className') | ||
? this.correction('className') | ||
: Converter_1.default.iconClassName(this.name); | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(Icon.prototype, "unicode", { | ||
get: function () { | ||
return this.hasCorrection('unicode') | ||
? this.correction('unicode') | ||
: "\\" + this.data.unicode; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(Icon.prototype, "type", { | ||
get: function () { | ||
return this.data.type; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(Icon.prototype, "searchTerms", { | ||
get: function () { | ||
return this.data.searchTerms.join(', '); | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
return Icon; | ||
}()); | ||
exports.default = Icon; | ||
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
// utils | ||
var Converter_1 = __importDefault(require("../util/Converter")); | ||
// enums | ||
var IconType_1 = __importDefault(require("../enums/IconType")); | ||
// static | ||
var corrections_json_1 = __importDefault(require("../static/corrections.json")); | ||
var Icon = /** @class */ (function () { | ||
function Icon(data) { | ||
this.data = data; | ||
} | ||
Icon.prototype.hasCorrection = function (field) { | ||
var iconCorrection = corrections_json_1.default[this.rawName]; | ||
if (iconCorrection !== undefined) { | ||
return iconCorrection[field] !== undefined; | ||
} | ||
return false; | ||
}; | ||
Icon.prototype.correction = function (field) { | ||
return this.hasCorrection(field) | ||
? corrections_json_1.default[this.rawName][field] | ||
: ''; | ||
}; | ||
Object.defineProperty(Icon.prototype, "rawName", { | ||
get: function () { | ||
return this.data.name; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(Icon.prototype, "name", { | ||
get: function () { | ||
var name = this.data.name; | ||
if (this.type === IconType_1.default.OUTLINE) { | ||
name += '-outline'; | ||
} | ||
if (this.type === IconType_1.default.THIN) { | ||
name += '-thin'; | ||
} | ||
return this.hasCorrection('name') | ||
? this.correction('name') | ||
: Converter_1.default.iconName(name); | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(Icon.prototype, "className", { | ||
get: function () { | ||
return this.hasCorrection('className') | ||
? this.correction('className') | ||
: Converter_1.default.iconClassName(this.name); | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(Icon.prototype, "unicode", { | ||
get: function () { | ||
return this.hasCorrection('unicode') | ||
? this.correction('unicode') | ||
: "\\" + this.data.unicode; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(Icon.prototype, "type", { | ||
get: function () { | ||
return this.data.type; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(Icon.prototype, "searchTerms", { | ||
get: function () { | ||
return this.data.searchTerms.join(', '); | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
return Icon; | ||
}()); | ||
exports.default = Icon; |
Oops, something went wrong.