diginext-utils 2.1.11 → 2.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/dist/array.d.ts +2 -2
  2. package/dist/array.js +1 -0
  3. package/dist/array.js.map +1 -1
  4. package/dist/color.d.ts +2 -0
  5. package/dist/color.js +7 -1
  6. package/dist/color.js.map +1 -1
  7. package/dist/string/random.d.ts +2 -0
  8. package/dist/string/random.js +10 -2
  9. package/dist/string/random.js.map +1 -1
  10. package/esm/array.d.ts +2 -2
  11. package/esm/array.js +1 -0
  12. package/esm/array.js.map +1 -1
  13. package/esm/color.d.ts +2 -0
  14. package/esm/color.js +5 -0
  15. package/esm/color.js.map +1 -1
  16. package/esm/string/random.d.ts +2 -0
  17. package/esm/string/random.js +8 -1
  18. package/esm/string/random.js.map +1 -1
  19. package/package.json +2 -3
  20. package/src/Checker.ts +0 -29
  21. package/src/EventDispatcher.ts +0 -62
  22. package/src/FileUpload.ts +0 -66
  23. package/src/Slug.ts +0 -365
  24. package/src/Timer.ts +0 -7
  25. package/src/Validation.ts +0 -36
  26. package/src/array.ts +0 -285
  27. package/src/color.ts +0 -87
  28. package/src/console/enableConsole.ts +0 -8
  29. package/src/console/index.ts +0 -17
  30. package/src/console/log.ts +0 -39
  31. package/src/device/browser.ts +0 -29
  32. package/src/device/camera.ts +0 -207
  33. package/src/device/index.ts +0 -230
  34. package/src/device/os.ts +0 -29
  35. package/src/file/createDir.ts +0 -14
  36. package/src/file/fileMove.ts +0 -32
  37. package/src/file/findFilesByExt.ts +0 -46
  38. package/src/file/index.ts +0 -7
  39. package/src/gameboi/index.ts +0 -65
  40. package/src/images/index.ts +0 -3
  41. package/src/images/loadImage.ts +0 -16
  42. package/src/images/resize.ts +0 -35
  43. package/src/images/upload.ts +0 -24
  44. package/src/index.ts +0 -39
  45. package/src/json.ts +0 -29
  46. package/src/math/diffDate.ts +0 -10
  47. package/src/math/index.ts +0 -90
  48. package/src/math/positiveNumber.ts +0 -12
  49. package/src/name/en.ts +0 -27
  50. package/src/name/index.ts +0 -8
  51. package/src/name/vi.ts +0 -24
  52. package/src/object.ts +0 -72
  53. package/src/permission/index.ts +0 -6
  54. package/src/permission/requestCamera.ts +0 -43
  55. package/src/permission/requestDeviceOrientationControl.ts +0 -33
  56. package/src/response/index.ts +0 -45
  57. package/src/string/convertPathnameAndQuery.ts +0 -24
  58. package/src/string/formatNumber.ts +0 -12
  59. package/src/string/generatePassword.ts +0 -18
  60. package/src/string/generateUUID.ts +0 -37
  61. package/src/string/getTextBetweenCharByIndex.ts +0 -20
  62. package/src/string/index.ts +0 -181
  63. package/src/string/indexesOf.ts +0 -15
  64. package/src/string/makeDaySlug.ts +0 -40
  65. package/src/string/random.ts +0 -33
  66. package/src/string/trimNull.ts +0 -16
  67. package/src/string/url.ts +0 -80
@@ -1,46 +0,0 @@
1
- var path = require("path");
2
- var fs = require("fs");
3
-
4
- /**
5
- * This is an alias of "findFileByExt()"
6
- */
7
- export const forEachFileByExt = (base: string, ext: string, cb: (path: string) => {}) => {
8
- var walk = function (directoryName: string) {
9
- try {
10
- fs.readdir(directoryName, function (e: any, files: string[]) {
11
- if (e) {
12
- console.log("Error: ", e);
13
- return;
14
- }
15
- files.forEach(function (file: string) {
16
- var fullPath = path.join(directoryName, file);
17
- fs.stat(fullPath, function (e: any, f: any) {
18
- if (e) {
19
- console.log("Error: ", e);
20
- return;
21
- }
22
- if (f.isDirectory()) {
23
- walk(fullPath);
24
- } else {
25
- if (fullPath.toLowerCase().indexOf(ext.toLowerCase()) > -1) {
26
- if (cb) cb(fullPath);
27
- }
28
- }
29
- });
30
- });
31
- });
32
- } catch (error) {
33
- console.log("error", error);
34
- }
35
- };
36
- walk(base);
37
- };
38
-
39
- /**
40
- * This is an alias of "forEachFileByExt()"
41
- */
42
- export const findFileByExt = forEachFileByExt;
43
-
44
- const fileExt = { findFileByExt, forEachFileByExt };
45
-
46
- export default fileExt;
package/src/file/index.ts DELETED
@@ -1,7 +0,0 @@
1
- import { createDir } from "./createDir";
2
- import { fileMove } from "./fileMove";
3
- import fileExt from "./findFilesByExt";
4
-
5
- const xfile = { createDir, fileMove, ...fileExt };
6
-
7
- export default xfile;
@@ -1,65 +0,0 @@
1
- import EventEmitter from "events";
2
-
3
- export default class GameBoi extends EventEmitter {
4
- constructor() {
5
- super();
6
-
7
- this.#awake();
8
- }
9
-
10
- #__onConnect: any;
11
- #__onDisconnect: any;
12
- #__start: any;
13
-
14
- #time = +new Date();
15
-
16
- #awake() {
17
- if (typeof window == "undefined") return;
18
- const scope = this;
19
-
20
- this.#__onConnect = this.onConnect.bind(this);
21
- window.addEventListener("gamepadconnected", this.#__onConnect);
22
-
23
- this.#__onDisconnect = this.onDisconnect.bind(this);
24
- window.addEventListener("gamepaddisconnected", this.#__onDisconnect);
25
- }
26
-
27
- onConnect(e: GamepadEvent) {
28
- const gp = navigator.getGamepads()[e.gamepad.index] as Gamepad;
29
- console.log(`Gamepad connected at index ${gp.index}: ${gp.id}. It has ${gp.buttons.length} buttons and ${gp.axes.length} axes.`);
30
-
31
- this.#time = +new Date();
32
- this.gameLoop();
33
- }
34
-
35
- onDisconnect() {
36
- console.log("onDisconnect");
37
- (window as any).cancelAnimationFrame(this.#__start);
38
- }
39
-
40
- gameLoop() {
41
- const gamepads = navigator.getGamepads();
42
- if (!gamepads) {
43
- return;
44
- }
45
-
46
- const deltaTime = (+new Date() - this.#time) / 1000;
47
-
48
- const item = gamepads[0] as any;
49
- item.deltaTime = deltaTime;
50
-
51
- this.emit("update", item);
52
-
53
- this.#time = +new Date();
54
-
55
- this.#__start = requestAnimationFrame(this.gameLoop.bind(this));
56
- }
57
-
58
- dispose() {
59
- //
60
-
61
- this.onDisconnect();
62
- window.removeEventListener("gamepadconnected", this.#__onConnect);
63
- window.removeEventListener("gamepaddisconnected", this.#__onDisconnect);
64
- }
65
- }
@@ -1,3 +0,0 @@
1
- // export { default as AdminIcon } from "diginext-dashkit/dist/Icon";
2
- export { upload } from "./upload";
3
- export { resize } from "./resize";
@@ -1,16 +0,0 @@
1
- export default async function loadImage(list: Array<string>) {
2
- //
3
- if (!list?.length) return;
4
-
5
- return await Promise.all(
6
- list.map((url) => {
7
- return new Promise((resolve, reject) => {
8
- const img = new Image();
9
- img.onload = resolve;
10
- img.onerror = resolve;
11
- img.src = url;
12
- return;
13
- });
14
- })
15
- );
16
- }
@@ -1,35 +0,0 @@
1
- import loadImage from "blueimp-load-image";
2
-
3
- export const resize = async (file: File) => {
4
- if (!file) {
5
- console.error("NO FILE AVAIABLE!");
6
- return;
7
- }
8
-
9
- const { type } = file;
10
-
11
- const data = await loadImage(file, {
12
- //
13
- meta: false,
14
- canvas: true,
15
- maxWidth: 2048,
16
- maxHeight: 2048,
17
- });
18
-
19
- const blob = await new Promise(function (resolve) {
20
- try {
21
- const canvas = data.image as any;
22
- canvas.toBlob(function (blob: Blob) {
23
- resolve(blob);
24
- }, type);
25
- } catch (error) {
26
- console.error(`diginext-utils/src/images/resize.ts canvas.toBlob error`, error);
27
- }
28
- });
29
-
30
- if (blob) return blob;
31
-
32
- return data;
33
- };
34
-
35
- export default resize;
@@ -1,24 +0,0 @@
1
- import { getFailedResponse } from "./../response/index";
2
- import resize from "./resize";
3
- import { isImage } from "./../string/url";
4
-
5
- export const upload = async (file: File) => {
6
- const { name } = file;
7
-
8
- if (!isImage(name)) {
9
- const err = "Please Choose Image!";
10
- console.error(err);
11
- return getFailedResponse(err);
12
- }
13
-
14
- const blob = (await resize(file)) as any;
15
- const url = URL.createObjectURL(blob as Blob);
16
- blob.name = name;
17
-
18
- return {
19
- blob,
20
- url,
21
- };
22
- };
23
-
24
- export default upload;
package/src/index.ts DELETED
@@ -1,39 +0,0 @@
1
- import * as array from "./array";
2
- import * as device from "./device";
3
- import * as console from "./console";
4
- import * as browser from "./device/browser";
5
- import * as camera from "./device/camera";
6
- import * as math from "./math";
7
- import * as xname from "./name";
8
- import * as object from "./object";
9
- import * as string from "./string";
10
- import * as url from "./string/url";
11
- import * as createDir from "./file/createDir";
12
- import * as fileMove from "./file/fileMove";
13
- import * as findFilesByExt from "./file/findFilesByExt";
14
- import * as Timer from "./Timer";
15
- import * as requestCamera from "./permission/requestCamera";
16
- import * as requestDeviceOrientationControl from "./permission/requestDeviceOrientationControl";
17
- import * as enableConsole from "./console/enableConsole";
18
-
19
- const utils = {
20
- xname,
21
- array,
22
- device,
23
- console,
24
- browser,
25
- camera,
26
- math,
27
- object,
28
- string,
29
- url,
30
- createDir,
31
- fileMove,
32
- findFilesByExt,
33
- Timer,
34
- requestCamera,
35
- requestDeviceOrientationControl,
36
- enableConsole,
37
- };
38
-
39
- export default utils;
package/src/json.ts DELETED
@@ -1,29 +0,0 @@
1
- /**
2
- * Check if the object or string is in JSON format
3
- */
4
- export const isValid = (content: object | string) => {
5
- if (typeof content == "object") {
6
- try {
7
- content = JSON.stringify(content);
8
- } catch (err) {
9
- return false;
10
- }
11
- }
12
-
13
- if (typeof content == "string") {
14
- try {
15
- content = JSON.parse(content);
16
- } catch (err) {
17
- return false;
18
- }
19
- }
20
-
21
- if (typeof content != "object") {
22
- return false;
23
- }
24
- return true;
25
- };
26
-
27
- const xjson = { isValid };
28
-
29
- export default xjson;
@@ -1,10 +0,0 @@
1
- /**
2
- * Returns amount of different days between 2 dates
3
- */
4
- export function diffDate(date1: string, date2: string) {
5
- date1 = date1 || new Date().toString();
6
- date2 = date2 || new Date().toString();
7
- return (new Date(date2).getTime() - new Date(date1).getTime()) / (24 * 60 * 60 * 1000);
8
- }
9
-
10
- export default diffDate;
package/src/math/index.ts DELETED
@@ -1,90 +0,0 @@
1
- const DEG2RAD = Math.PI / 180;
2
- const RAD2DEG = 180 / Math.PI;
3
-
4
- export const randRound = (number: number) => {
5
- return Math.round(Math.random() * number);
6
- };
7
-
8
- export const rand = (number: number) => {
9
- return (Math.random() - Math.random()) * number;
10
- };
11
-
12
- export const randHalt = (number: number) => {
13
- var rand = Math.random() - Math.random();
14
- var res;
15
- if (rand > 0) {
16
- res = rand * (number / 2) + number / 2;
17
- } else {
18
- res = rand * (number / 2) - number / 2;
19
- }
20
- return Math.abs(res);
21
- };
22
-
23
- export const randInt = (low: number, high: number) => {
24
- return low + Math.floor(Math.random() * (high - low + 1));
25
- };
26
-
27
- export const randFloat = (low: number, high: number) => {
28
- return low + Math.random() * (high - low);
29
- };
30
-
31
- export const degToRad = (degrees: number) => {
32
- return degrees * DEG2RAD;
33
- };
34
-
35
- export const radToDeg = (radians: number) => {
36
- return radians * RAD2DEG;
37
- };
38
-
39
- export const clamp = (value: number, min: number, max: number) => {
40
- const result = Math.max(min, Math.min(max, value));
41
- return Number.isFinite(result) ? result : 0;
42
- };
43
-
44
- export const degBetweenPoints360 = (cx: number, cy: number, ex: number, ey: number) => {
45
- let theta = degBetweenPoints(cx, cy, ex, ey); // range (-180, 180]
46
- if (theta < 0) theta = 360 + theta; // range [0, 360)
47
- return Number.isFinite(theta) ? theta : 0;
48
- };
49
-
50
- export const degBetweenPoints = (cx: number, cy: number, ex: number, ey: number) => {
51
- const dy = ey - cy;
52
- const dx = ex - cx;
53
- let theta = Math.atan2(dy, dx); // range (-PI, PI]
54
- theta *= 180 / Math.PI; // rads to degs, range (-180, 180]
55
- return Number.isFinite(theta) ? theta : 0;
56
- };
57
-
58
- export const angleBetweenPoints = (cx: number, cy: number, ex: number, ey: number) => {
59
- const dy = ey - cy;
60
- const dx = ex - cx;
61
- let theta = Math.atan2(dy, dx); // range (-PI, PI]
62
- theta *= 180 / Math.PI; // rads to degs, range (-180, 180]
63
- return Number.isFinite(theta) ? theta : 0;
64
- };
65
-
66
- export const distance2Point = (x1: number, y1: number, x2: number, y2: number) => {
67
- const dist = Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2));
68
- return Number.isFinite(dist) ? dist : 0;
69
- };
70
-
71
- import { diffDate } from "./diffDate";
72
- import { positiveNumber } from "./positiveNumber";
73
-
74
- const xmath = {
75
- rand,
76
- randRound,
77
- randHalt,
78
- randInt,
79
- randFloat,
80
- degToRad,
81
- radToDeg,
82
- degBetweenPoints360,
83
- degBetweenPoints,
84
- angleBetweenPoints,
85
- distance2Point,
86
- diffDate,
87
- positiveNumber,
88
- };
89
-
90
- export default xmath;
@@ -1,12 +0,0 @@
1
- import { isNull } from "../object";
2
-
3
- export function positiveNumber(number: number) {
4
- if (isNull(number)) return 0;
5
- if (!Number.isFinite(Number(number))) return 0;
6
- number = Number(number);
7
- if (number < 0) return 0;
8
-
9
- return number;
10
- }
11
-
12
- export default positiveNumber;
package/src/name/en.ts DELETED
@@ -1,27 +0,0 @@
1
- /*
2
- (c) by Thomas Konings
3
- Random Name Generator for Javascript
4
- https://gist.github.com/tkon99/4c98af713acc73bed74c
5
- */
6
-
7
- function capFirst(string: string) {
8
- return string.charAt(0).toUpperCase() + string.slice(1);
9
- }
10
-
11
- function getRandomInt(min: number, max: number) {
12
- return Math.floor(Math.random() * (max - min)) + min;
13
- }
14
-
15
- export function generateName() {
16
- //prettier-ignore
17
- var name1 = ["abandoned","able","absolute","adorable","adventurous","academic","acceptable","acclaimed","accomplished","accurate","aching","acidic","acrobatic","active","actual","adept","admirable","admired","adolescent","adorable","adored","advanced","afraid","affectionate","aged","aggravating","aggressive","agile","agitated","agonizing","agreeable","ajar","alarmed","alarming","alert","alienated","alive","all","altruistic","amazing","ambitious","ample","amused","amusing","anchored","ancient","angelic","angry","anguished","animated","annual","another","antique","anxious","any","apprehensive","appropriate","apt","arctic","arid","aromatic","artistic","ashamed","assured","astonishing","athletic","attached","attentive","attractive","austere","authentic","authorized","automatic","avaricious","average","aware","awesome","awful","awkward","babyish","bad","back","baggy","bare","barren","basic","beautiful","belated","beloved","beneficial","better","best","bewitched","big","big-hearted","biodegradable","bite-sized","bitter","black","black-and-white","bland","blank","blaring","bleak","blind","blissful","blond","blue","blushing","bogus","boiling","bold","bony","boring","bossy","both","bouncy","bountiful","bowed","brave","breakable","brief","bright","brilliant","brisk","broken","bronze","brown","bruised","bubbly","bulky","bumpy","buoyant","burdensome","burly","bustling","busy","buttery","buzzing","calculating","calm","candid","canine","capital","carefree","careful","careless","caring","cautious","cavernous","celebrated","charming","cheap","cheerful","cheery","chief","chilly","chubby","circular","classic","clean","clear","clear-cut","clever","close","closed","cloudy","clueless","clumsy","cluttered","coarse","cold","colorful","colorless","colossal","comfortable","common","compassionate","competent","complete","complex","complicated","composed","concerned","concrete","confused","conscious","considerate","constant","content","conventional","cooked","cool","cooperative","coordinated","corny","corrupt","costly","courageous","courteous","crafty","crazy","creamy","creative","creepy","criminal","crisp","critical","crooked","crowded","cruel","crushing","cuddly","cultivated","cultured","cumbersome","curly","curvy","cute","cylindrical","damaged","damp","dangerous","dapper","daring","darling","dark","dazzling","dead","deadly","deafening","dear","dearest","decent","decimal","decisive","deep","defenseless","defensive","defiant","deficient","definite","definitive","delayed","delectable","delicious","delightful","delirious","demanding","dense","dental","dependable","dependent","descriptive","deserted","detailed","determined","devoted","different","difficult","digital","diligent","dim","dimpled","dimwitted","direct","disastrous","discrete","disfigured","disgusting","disloyal","dismal","distant","downright","dreary","dirty","disguised","dishonest","dismal","distant","distinct","distorted","dizzy","dopey","doting","double","downright","drab","drafty","dramatic","dreary","droopy","dry","dual","dull","dutiful","each","eager","earnest","early","easy","easy-going","ecstatic","edible","educated","elaborate","elastic","elated","elderly","electric","elegant","elementary","elliptical","embarrassed","embellished","eminent","emotional","empty","enchanted","enchanting","energetic","enlightened","enormous","enraged","entire","envious","equal","equatorial","essential","esteemed","ethical","euphoric","even","evergreen","everlasting","every","evil","exalted","excellent","exemplary","exhausted","excitable","excited","exciting","exotic","expensive","experienced","expert","extraneous","extroverted","extra-large","extra-small","fabulous","failing","faint","fair","faithful","fake","false","familiar","famous","fancy","fantastic","far","faraway","far-flung","far-off","fast","fat","fatal","fatherly","favorable","favorite","fearful","fearless","feisty","feline","female","feminine","few","fickle","filthy","fine","finished","firm","first","firsthand","fitting","fixed","flaky","flamboyant","flashy","flat","flawed","flawless","flickering","flimsy","flippant","flowery","fluffy","fluid","flustered","focused","fond","foolhardy","foolish","forceful","forked","formal","forsaken","forthright","fortunate","fragrant","frail","frank","frayed","free","French","fresh","frequent","friendly","frightened","frightening","frigid","frilly","frizzy","frivolous","front","frosty","frozen","frugal","fruitful","full","fumbling","functional","funny","fussy","fuzzy","gargantuan","gaseous","general","generous","gentle","genuine","giant","giddy","gigantic","gifted","giving","glamorous","glaring","glass","gleaming","gleeful","glistening","glittering","gloomy","glorious","glossy","glum","golden","good","good-natured","gorgeous","graceful","gracious","grand","grandiose","granular","grateful","grave","gray","great","greedy","green","gregarious","grim","grimy","gripping","grizzled","gross","grotesque","grouchy","grounded","growing","growling","grown","grubby","gruesome","grumpy","guilty","gullible","gummy","hairy","half","handmade","handsome","handy","happy","happy-go-lucky","hard","hard-to-find","harmful","harmless","harmonious","harsh","hasty","hateful","haunting","healthy","heartfelt","hearty","heavenly","heavy","hefty","helpful","helpless","hidden","hideous","high","high-level","hilarious","hoarse","hollow","homely","honest","honorable","honored","hopeful","horrible","hospitable","hot","huge","humble","humiliating","humming","humongous","hungry","hurtful","husky","icky","icy","ideal","idealistic","identical","idle","idiotic","idolized","ignorant","ill","illegal","ill-fated","ill-informed","illiterate","illustrious","imaginary","imaginative","immaculate","immaterial","immediate","immense","impassioned","impeccable","impartial","imperfect","imperturbable","impish","impolite","important","impossible","impractical","impressionable","impressive","improbable","impure","inborn","incomparable","incompatible","incomplete","inconsequential","incredible","indelible","inexperienced","indolent","infamous","infantile","infatuated","inferior","infinite","informal","innocent","insecure","insidious","insignificant","insistent","instructive","insubstantial","intelligent","intent","intentional","interesting","internal","international","intrepid","ironclad","irresponsible","irritating","itchy","jaded","jagged","jam-packed","jaunty","jealous","jittery","joint","jolly","jovial","joyful","joyous","jubilant","judicious","juicy","jumbo","junior","jumpy","juvenile","kaleidoscopic","keen","key","kind","kindhearted","kindly","klutzy","knobby","knotty","knowledgeable","knowing","known","kooky","kosher","lame","lanky","large","last","lasting","late","lavish","lawful","lazy","leading","lean","leafy","left","legal","legitimate","light","lighthearted","likable","likely","limited","limp","limping","linear","lined","liquid","little","live","lively","livid","loathsome","lone","lonely","long","long-term","loose","lopsided","lost","loud","lovable","lovely","loving","low","loyal","lucky","lumbering","luminous","lumpy","lustrous","luxurious","mad","made-up","magnificent","majestic","major","male","mammoth","married","marvelous","masculine","massive","mature","meager","mealy","mean","measly","meaty","medical","mediocre","medium","meek","mellow","melodic","memorable","menacing","merry","messy","metallic","mild","milky","mindless","miniature","minor","minty","miserable","miserly","misguided","misty","mixed","modern","modest","moist","monstrous","monthly","monumental","moral","mortified","motherly","motionless","mountainous","muddy","muffled","multicolored","mundane","murky","mushy","musty","muted","mysterious","naive","narrow","nasty","natural","naughty","nautical","near","neat","necessary","needy","negative","neglected","negligible","neighboring","nervous","new","next","nice","nifty","nimble","nippy","nocturnal","noisy","nonstop","normal","notable","noted","noteworthy","novel","noxious","numb","nutritious","nutty","obedient","obese","oblong","oily","oblong","obvious","occasional","odd","oddball","offbeat","offensive","official","old","old-fashioned","only","open","optimal","optimistic","opulent","orange","orderly","organic","ornate","ornery","ordinary","original","other","our","outlying","outgoing","outlandish","outrageous","outstanding","oval","overcooked","overdue","overjoyed","overlooked","palatable","pale","paltry","parallel","parched","partial","passionate","past","pastel","peaceful","peppery","perfect","perfumed","periodic","perky","personal","pertinent","pesky","pessimistic","petty","phony","physical","piercing","pink","pitiful","plain","plaintive","plastic","playful","pleasant","pleased","pleasing","plump","plush","polished","polite","political","pointed","pointless","poised","poor","popular","portly","posh","positive","possible","potable","powerful","powerless","practical","precious","present","prestigious","pretty","precious","previous","pricey","prickly","primary","prime","pristine","private","prize","probable","productive","profitable","profuse","proper","proud","prudent","punctual","pungent","puny","pure","purple","pushy","putrid","puzzled","puzzling","quaint","qualified","quarrelsome","quarterly","queasy","querulous","questionable","quick","quick-witted","quiet","quintessential","quirky","quixotic","quizzical","radiant","ragged","rapid","rare","rash","raw","recent","reckless","rectangular","ready","real","realistic","reasonable","red","reflecting","regal","regular","reliable","relieved","remarkable","remorseful","remote","repentant","required","respectful","responsible","repulsive","revolving","rewarding","rich","rigid","right","ringed","ripe","roasted","robust","rosy","rotating","rotten","rough","round","rowdy","royal","rubbery","rundown","ruddy","rude","runny","rural","rusty","sad","safe","salty","same","sandy","sane","sarcastic","sardonic","satisfied","scaly","scarce","scared","scary","scented","scholarly","scientific","scornful","scratchy","scrawny","second","secondary","second-hand","secret","self-assured","self-reliant","selfish","sentimental","separate","serene","serious","serpentine","several","severe","shabby","shadowy","shady","shallow","shameful","shameless","sharp","shimmering","shiny","shocked","shocking","shoddy","short","short-term","showy","shrill","shy","sick","silent","silky","silly","silver","similar","simple","simplistic","sinful","single","sizzling","skeletal","skinny","sleepy","slight","slim","slimy","slippery","slow","slushy","small","smart","smoggy","smooth","smug","snappy","snarling","sneaky","sniveling","snoopy","sociable","soft","soggy","solid","somber","some","spherical","sophisticated","sore","sorrowful","soulful","soupy","sour","Spanish","sparkling","sparse","specific","spectacular","speedy","spicy","spiffy","spirited","spiteful","splendid","spotless","spotted","spry","square","squeaky","squiggly","stable","staid","stained","stale","standard","starchy","stark","starry","steep","sticky","stiff","stimulating","stingy","stormy","straight","strange","steel","strict","strident","striking","striped","strong","studious","stunning","stupendous","stupid","sturdy","stylish","subdued","submissive","substantial","subtle","suburban","sudden","sugary","sunny","super","superb","superficial","superior","supportive","sure-footed","surprised","suspicious","svelte","sweaty","sweet","sweltering","swift","sympathetic","tall","talkative","tame","tan","tangible","tart","tasty","tattered","taut","tedious","teeming","tempting","tender","tense","tepid","terrible","terrific","testy","thankful","that","these","thick","thin","third","thirsty","this","thorough","thorny","those","thoughtful","threadbare","thrifty","thunderous","tidy","tight","timely","tinted","tiny","tired","torn","total","tough","traumatic","treasured","tremendous","tragic","trained","tremendous","triangular","tricky","trifling","trim","trivial","troubled","true","trusting","trustworthy","trusty","truthful","tubby","turbulent","twin","ugly","ultimate","unacceptable","unaware","uncomfortable","uncommon","unconscious","understated","unequaled","uneven","unfinished","unfit","unfolded","unfortunate","unhappy","unhealthy","uniform","unimportant","unique","united","unkempt","unknown","unlawful","unlined","unlucky","unnatural","unpleasant","unrealistic","unripe","unruly","unselfish","unsightly","unsteady","unsung","untidy","untimely","untried","untrue","unused","unusual","unwelcome","unwieldy","unwilling","unwitting","unwritten","upbeat","upright","upset","urban","usable","used","useful","useless","utilized","utter","vacant","vague","vain","valid","valuable","vapid","variable","vast","velvety","venerated","vengeful","verifiable","vibrant","vicious","victorious","vigilant","vigorous","villainous","violet","violent","virtual","virtuous","visible","vital","vivacious","vivid","voluminous","wan","warlike","warm","warmhearted","warped","wary","wasteful","watchful","waterlogged","watery","wavy","wealthy","weak","weary","webbed","wee","weekly","weepy","weighty","weird","welcome","well-documented","well-groomed","well-informed","well-lit","well-made","well-off","well-to-do","well-worn","wet","which","whimsical","whirlwind","whispered","white","whole","whopping","wicked","wide","wide-eyed","wiggly","wild","willing","wilted","winding","windy","winged","wiry","wise","witty","wobbly","woeful","wonderful","wooden","woozy","wordy","worldly","worn","worried","worrisome","worse","worst","worthless","worthwhile","worthy","wrathful","wretched","writhing","wrong","wry","yawning","yearly","yellow","yellowish","young","youthful","yummy","zany","zealous","zesty","zigzag","rocky"];
18
-
19
- //prettier-ignore
20
- var name2 = ["people","history","way","art","world","information","map","family","government","health","system","computer","meat","year","thanks","music","person","reading","method","data","food","understanding","theory","law","bird","literature","problem","software","control","knowledge","power","ability","economics","love","internet","television","science","library","nature","fact","product","idea","temperature","investment","area","society","activity","story","industry","media","thing","oven","community","definition","safety","quality","development","language","management","player","variety","video","week","security","country","exam","movie","organization","equipment","physics","analysis","policy","series","thought","basis","boyfriend","direction","strategy","technology","army","camera","freedom","paper","environment","child","instance","month","truth","marketing","university","writing","article","department","difference","goal","news","audience","fishing","growth","income","marriage","user","combination","failure","meaning","medicine","philosophy","teacher","communication","night","chemistry","disease","disk","energy","nation","road","role","soup","advertising","location","success","addition","apartment","education","math","moment","painting","politics","attention","decision","event","property","shopping","student","wood","competition","distribution","entertainment","office","population","president","unit","category","cigarette","context","introduction","opportunity","performance","driver","flight","length","magazine","newspaper","relationship","teaching","cell","dealer","debate","finding","lake","member","message","phone","scene","appearance","association","concept","customer","death","discussion","housing","inflation","insurance","mood","woman","advice","blood","effort","expression","importance","opinion","payment","reality","responsibility","situation","skill","statement","wealth","application","city","county","depth","estate","foundation","grandmother","heart","perspective","photo","recipe","studio","topic","collection","depression","imagination","passion","percentage","resource","setting","ad","agency","college","connection","criticism","debt","description","memory","patience","secretary","solution","administration","aspect","attitude","director","personality","psychology","recommendation","response","selection","storage","version","alcohol","argument","complaint","contract","emphasis","highway","loss","membership","possession","preparation","steak","union","agreement","cancer","currency","employment","engineering","entry","interaction","limit","mixture","preference","region","republic","seat","tradition","virus","actor","classroom","delivery","device","difficulty","drama","election","engine","football","guidance","hotel","match","owner","priority","protection","suggestion","tension","variation","anxiety","atmosphere","awareness","bread","climate","comparison","confusion","construction","elevator","emotion","employee","employer","guest","height","leadership","mall","manager","operation","recording","respect","sample","transportation","boring","charity","cousin","disaster","editor","efficiency","excitement","extent","feedback","guitar","homework","leader","mom","outcome","permission","presentation","promotion","reflection","refrigerator","resolution","revenue","session","singer","tennis","basket","bonus","cabinet","childhood","church","clothes","coffee","dinner","drawing","hair","hearing","initiative","judgment","lab","measurement","mode","mud","orange","poetry","police","possibility","procedure","queen","ratio","relation","restaurant","satisfaction","sector","signature","significance","song","tooth","town","vehicle","volume","wife","accident","airport","appointment","arrival","assumption","baseball","chapter","committee","conversation","database","enthusiasm","error","explanation","farmer","gate","girl","hall","historian","hospital","injury","instruction","maintenance","manufacturer","meal","perception","pie","poem","presence","proposal","reception","replacement","revolution","river","son","speech","tea","village","warning","winner","worker","writer","assistance","breath","buyer","chest","chocolate","conclusion","contribution","cookie","courage","desk","drawer","establishment","examination","garbage","grocery","honey","impression","improvement","independence","insect","inspection","inspector","king","ladder","menu","penalty","piano","potato","profession","professor","quantity","reaction","requirement","salad","sister","supermarket","tongue","weakness","wedding","affair","ambition","analyst","apple","assignment","assistant","bathroom","bedroom","beer","birthday","celebration","championship","cheek","client","consequence","departure","diamond","dirt","ear","fortune","friendship","funeral","gene","girlfriend","hat","indication","intention","lady","midnight","negotiation","obligation","passenger","pizza","platform","poet","pollution","recognition","reputation","shirt","speaker","stranger","surgery","sympathy","tale","throat","trainer","uncle","youth","time","work","film","water","money","example","while","business","study","game","life","form","air","day","place","number","part","field","fish","back","process","heat","hand","experience","job","book","end","point","type","home","economy","value","body","market","guide","interest","state","radio","course","company","price","size","card","list","mind","trade","line","care","group","risk","word","fat","force","key","light","training","name","school","top","amount","level","order","practice","research","sense","service","piece","web","boss","sport","fun","house","page","term","test","answer","sound","focus","matter","kind","soil","board","oil","picture","access","garden","range","rate","reason","future","site","demand","exercise","image","case","cause","coast","action","age","bad","boat","record","result","section","building","mouse","cash","class","period","plan","store","tax","side","subject","space","rule","stock","weather","chance","figure","man","model","source","beginning","earth","program","chicken","design","feature","head","material","purpose","question","rock","salt","act","birth","car","dog","object","scale","sun","note","profit","rent","speed","style","war","bank","craft","half","inside","outside","standard","bus","exchange","eye","fire","position","pressure","stress","advantage","benefit","box","frame","issue","step","cycle","face","item","metal","paint","review","room","screen","structure","view","account","ball","discipline","medium","share","balance","bit","black","bottom","choice","gift","impact","machine","shape","tool","wind","address","average","career","culture","morning","pot","sign","table","task","condition","contact","credit","egg","hope","ice","network","north","square","attempt","date","effect","link","post","star","voice","capital","challenge","friend","self","shot","brush","couple","exit","front","function","lack","living","plant","plastic","spot","summer","taste","theme","track","wing","brain","button","click","desire","foot","gas","influence","notice","rain","wall","base","damage","distance","feeling","pair","savings","staff","sugar","target","text","animal","author","budget","discount","file","ground","lesson","minute","officer","phase","reference","register","sky","stage","stick","title","trouble","bowl","bridge","campaign","character","club","edge","evidence","fan","letter","lock","maximum","novel","option","pack","park","quarter","skin","sort","weight","baby","background","carry","dish","factor","fruit","glass","joint","master","muscle","red","strength","traffic","trip","vegetable","appeal","chart","gear","ideal","kitchen","land","log","mother","net","party","principle","relative","sale","season","signal","spirit","street","tree","wave","belt","bench","commission","copy","drop","minimum","path","progress","project","sea","south","status","stuff","ticket","tour","angle","blue","breakfast","confidence","daughter","degree","doctor","dot","dream","duty","essay","father","fee","finance","hour","juice","luck","milk","mouth","peace","pipe","stable","storm","substance","team","trick","afternoon","bat","beach","blank","catch","chain","consideration","cream","crew","detail","gold","interview","kid","mark","mission","pain","pleasure","score","screw","sex","shop","shower","suit","tone","window","agent","band","bath","block","bone","calendar","candidate","cap","coat","contest","corner","court","cup","district","door","east","finger","garage","guarantee","hole","hook","implement","layer","lecture","lie","manner","meeting","nose","parking","partner","profile","rice","routine","schedule","swimming","telephone","tip","winter","airline","bag","battle","bed","bill","bother","cake","code","curve","designer","dimension","dress","ease","emergency","evening","extension","farm","fight","gap","grade","holiday","horror","horse","host","husband","loan","mistake","mountain","nail","noise","occasion","package","patient","pause","phrase","proof","race","relief","sand","sentence","shoulder","smoke","stomach","string","tourist","towel","vacation","west","wheel","wine","arm","aside","associate","bet","blow","border","branch","breast","brother","buddy","bunch","chip","coach","cross","document","draft","dust","expert","floor","god","golf","habit","iron","judge","knife","landscape","league","mail","mess","native","opening","parent","pattern","pin","pool","pound","request","salary","shame","shelter","shoe","silver","tackle","tank","trust","assist","bake","bar","bell","bike","blame","boy","brick","chair","closet","clue","collar","comment","conference","devil","diet","fear","fuel","glove","jacket","lunch","monitor","mortgage","nurse","pace","panic","peak","plane","reward","row","sandwich","shock","spite","spray","surprise","till","transition","weekend","welcome","yard","alarm","bend","bicycle","bite","blind","bottle","cable","candle","clerk","cloud","concert","counter","flower","grandfather","harm","knee","lawyer","leather","load","mirror","neck","pension","plate","purple","ruin","ship","skirt","slice","snow","specialist","stroke","switch","trash","tune","zone","anger","award","bid","bitter","boot","bug","camp","candy","carpet","cat","champion","channel","clock","comfort","cow","crack","engineer","entrance","fault","grass","guy","hell","highlight","incident","island","joke","jury","leg","lip","mate","motor","nerve","passage","pen","pride","priest","prize","promise","resident","resort","ring","roof","rope","sail","scheme","script","sock","station","toe","tower","truck","witness","can","will","other","use","make","good","look","help","go","great","being","still","public","read","keep","start","give","human","local","general","specific","long","play","feel","high","put","common","set","change","simple","past","big","possible","particular","major","personal","current","national","cut","natural","physical","show","try","check","second","call","move","pay","let","increase","single","individual","turn","ask","buy","guard","hold","main","offer","potential","professional","international","travel","cook","alternative","special","working","whole","dance","excuse","cold","commercial","low","purchase","deal","primary","worth","fall","necessary","positive","produce","search","present","spend","talk","creative","tell","cost","drive","green","support","glad","remove","return","run","complex","due","effective","middle","regular","reserve","independent","leave","original","reach","rest","serve","watch","beautiful","charge","active","break","negative","safe","stay","visit","visual","affect","cover","report","rise","walk","white","junior","pick","unique","classic","final","lift","mix","private","stop","teach","western","concern","familiar","fly","official","broad","comfortable","gain","rich","save","stand","young","heavy","lead","listen","valuable","worry","handle","leading","meet","release","sell","finish","normal","press","ride","secret","spread","spring","tough","wait","brown","deep","display","flow","hit","objective","shoot","touch","cancel","chemical","cry","dump","extreme","push","conflict","eat","fill","formal","jump","kick","opposite","pass","pitch","remote","total","treat","vast","abuse","beat","burn","deposit","print","raise","sleep","somewhere","advance","consist","dark","double","draw","equal","fix","hire","internal","join","kill","sensitive","tap","win","attack","claim","constant","drag","drink","guess","minor","pull","raw","soft","solid","wear","weird","wonder","annual","count","dead","doubt","feed","forever","impress","repeat","round","sing","slide","strip","wish","combine","command","dig","divide","equivalent","hang","hunt","initial","march","mention","spiritual","survey","tie","adult","brief","crazy","escape","gather","hate","prior","repair","rough","sad","scratch","sick","strike","employ","external","hurt","illegal","laugh","lay","mobile","nasty","ordinary","respond","royal","senior","split","strain","struggle","swim","train","upper","wash","yellow","convert","crash","dependent","fold","funny","grab","hide","miss","permit","quote","recover","resolve","roll","sink","slip","spare","suspect","sweet","swing","twist","upstairs","usual","abroad","brave","calm","concentrate","estimate","grand","male","mine","prompt","quiet","refuse","regret","reveal","rush","shake","shift","shine","steal","suck","surround","bear","brilliant","dare","dear","delay","drunk","female","hurry","inevitable","invite","kiss","neat","pop","punch","quit","reply","representative","resist","rip","rub","silly","smile","spell","stretch","stupid","tear","temporary","tomorrow","wake","wrap","yesterday","Thomas","Tom","Lieuwe"];
21
-
22
- var name = capFirst(name1[getRandomInt(0, name1.length - 1)]) + " " + capFirst(name2[getRandomInt(0, name2.length - 1)]);
23
- return name;
24
- }
25
-
26
- const NameEN = { generateName };
27
- export default NameEN;
package/src/name/index.ts DELETED
@@ -1,8 +0,0 @@
1
- import NameEN from "./en";
2
- import NameVI from "./vi";
3
-
4
- export { NameEN, NameVI };
5
-
6
- const xname = { NameEN, NameVI };
7
-
8
- export default xname;