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
const TYPED_ARRAYS = [ Uint8Array, Uint8ClampedArray, Int8Array, Uint16Array, Int16Array, Uint32Array, Int32Array, DataView ]; | |
function ObjectClone(input, max_depth=128) { | |
const INPUT_TYPE = typeof input; | |
if ( INPUT_TYPE === null || | |
INPUT_TYPE === undefined || | |
INPUT_TYPE === "number" || | |
INPUT_TYPE === "boolean" || | |
INPUT_TYPE === "function" || |
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
// ES6 | |
class AngularPromise extends Promise { | |
constructor(executor) { | |
super((resolve, reject) => { | |
// before | |
return executor(resolve, reject); | |
}); | |
// after | |
} |
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
/** | |
* Author: JCloudYu | |
* Create: 2019/02/06 | |
**/ | |
(async()=>{ | |
let fs, path, dir, acquire; | |
if ( typeof require === "undefined" ) { | |
const {default:os} = await import( 'os' ); | |
({default:fs} = await import( 'fs' )); | |
({default:path} = await import( 'path' )); |
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
/** | |
* Author: JCloudYu | |
* Create: 2019/03/01 | |
**/ | |
(()=>{ | |
"use strict"; | |
const fs = require( 'fs' ); | |
const path = require( 'path' ); |
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
/** | |
* ISC License | |
* | |
* Copyright (c) 2019, J. Cloud Yu | |
* | |
* Permission to use, copy, modify, and/or distribute this software for any | |
* purpose with or without fee is hereby granted, provided that the above | |
* copyright notice and this permission notice appear in all copies. | |
* | |
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
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
/** | |
* Author: JCloudYu | |
* Create: 2019/11/29 | |
**/ | |
const _PRIVATES = new WeakMap(); | |
const configurable = true, writable = true, enumerable = false; | |
export const LogLevel = Object.freeze({ | |
silent: -1, | |
error: 0, |
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
/** | |
* Author: JCloudYu | |
* Create: 2019/07/16 | |
**/ | |
export const ColorCode = Object.freeze({ | |
// region [ 8 Colors ] | |
RESET: "\u001b[39m", | |
BLACK: "\u001b[30m", | |
RED: "\u001b[31m", | |
GREEN: "\u001b[32m", |
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
/** | |
* Author: JCloudYu | |
* Create: 2019/11/29 | |
**/ | |
const configurable = false, writable = false, enumerable = false; | |
export class ExtendedError extends Error { | |
constructor(info_obj, detail=null) { | |
super(info_obj.msg||''); | |
Object.defineProperties(this, { | |
_code: {value:info_obj.code, configurable, writable, enumerable}, |
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
/** | |
* Author: JCloudYu | |
* Create: 2019/12/14 | |
**/ | |
class _LocaleMap { | |
constructor(parent=null) { | |
this._locale_parent = parent; | |
this._locale = "_default"; | |
this._locale_maps = Object.create(null); | |
this._locales = Object.create(null); |
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
/** | |
* Author: ChenyChen, JCloudYu | |
* Create: 2020/01/29 | |
**/ | |
(async()=>{ | |
"use strict"; | |
const START_SIG = "//@export"; | |
const START_SIG_LEN = START_SIG.length; | |
const END_SIG = "//@endexport"; |