@supernova-studio/model 0.0.8 → 0.2.2

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.
@@ -1,641 +0,0 @@
1
- import slugifyImplementation from "@sindresorhus/slugify";
2
-
3
- export function slugify(str: string, options?: slugifyImplementation.Options): string {
4
- const slug = slugifyImplementation(str ?? "", options);
5
- return slug?.length > 0 ? slug : "item";
6
- }
7
-
8
- // Consists of lowercased letters, digits and hyphens.
9
- // Can not start or end with hyphen.
10
- // Warning: does not forbid consecutive hyphens
11
- export const SLUG_REGEX = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
12
-
13
- export const RESERVED_SLUGS = [
14
- "workspaces",
15
- "workspace",
16
- "api0",
17
- "api1",
18
- "api2",
19
- "custom",
20
- "x-sn-reserved",
21
- // further elements copied from https://github.com/shouldbee/reserved-usernames/blob/master/reserved-usernames.json
22
-
23
- "0",
24
- "about",
25
- "access",
26
- "account",
27
- "accounts",
28
- "activate",
29
- "activities",
30
- "activity",
31
- "ad",
32
- "add",
33
- "address",
34
- "adm",
35
- "admin",
36
- "administration",
37
- "administrator",
38
- "ads",
39
- "adult",
40
- "advertising",
41
- "affiliate",
42
- "affiliates",
43
- "ajax",
44
- "all",
45
- "alpha",
46
- "analysis",
47
- "analytics",
48
- "android",
49
- "anon",
50
- "anonymous",
51
- "api",
52
- "app",
53
- "apps",
54
- "archive",
55
- "archives",
56
- "article",
57
- "asct",
58
- "asset",
59
- "assets",
60
- "atom",
61
- "auth",
62
- "authentication",
63
- "avatar",
64
- "backup",
65
- "balancer-manager",
66
- "banner",
67
- "banners",
68
- "beta",
69
- "billing",
70
- "bin",
71
- "blog",
72
- "blogs",
73
- "board",
74
- "book",
75
- "bookmark",
76
- "bot",
77
- "bots",
78
- "bug",
79
- "business",
80
- "cache",
81
- "cadastro",
82
- "calendar",
83
- "call",
84
- "campaign",
85
- "cancel",
86
- "captcha",
87
- "career",
88
- "careers",
89
- "cart",
90
- "categories",
91
- "category",
92
- "cgi",
93
- "cgi-bin",
94
- "changelog",
95
- "chat",
96
- "check",
97
- "checking",
98
- "checkout",
99
- "client",
100
- "cliente",
101
- "clients",
102
- "code",
103
- "codereview",
104
- "comercial",
105
- "comment",
106
- "comments",
107
- "communities",
108
- "community",
109
- "company",
110
- "compare",
111
- "compras",
112
- "config",
113
- "configuration",
114
- "connect",
115
- "contact",
116
- "contact-us",
117
- "contact_us",
118
- "contactus",
119
- "contest",
120
- "contribute",
121
- "corp",
122
- "create",
123
- "css",
124
- "dashboard",
125
- "data",
126
- "db",
127
- "default",
128
- "delete",
129
- "demo",
130
- "design",
131
- "designer",
132
- "destroy",
133
- "dev",
134
- "devel",
135
- "developer",
136
- "developers",
137
- "diagram",
138
- "diary",
139
- "dict",
140
- "dictionary",
141
- "die",
142
- "dir",
143
- "direct_messages",
144
- "directory",
145
- "dist",
146
- "doc",
147
- "docs",
148
- "documentation",
149
- "domain",
150
- "download",
151
- "downloads",
152
- "ecommerce",
153
- "edit",
154
- "editor",
155
- "edu",
156
- "education",
157
- "email",
158
- "employment",
159
- "empty",
160
- "end",
161
- "enterprise",
162
- "entries",
163
- "entry",
164
- "error",
165
- "errors",
166
- "eval",
167
- "event",
168
- "exit",
169
- "explore",
170
- "facebook",
171
- "faq",
172
- "favorite",
173
- "favorites",
174
- "feature",
175
- "features",
176
- "feed",
177
- "feedback",
178
- "feeds",
179
- "file",
180
- "files",
181
- "first",
182
- "flash",
183
- "fleet",
184
- "fleets",
185
- "flog",
186
- "follow",
187
- "followers",
188
- "following",
189
- "forgot",
190
- "form",
191
- "forum",
192
- "forums",
193
- "founder",
194
- "free",
195
- "friend",
196
- "friends",
197
- "ftp",
198
- "gadget",
199
- "gadgets",
200
- "game",
201
- "games",
202
- "get",
203
- "ghost",
204
- "gift",
205
- "gifts",
206
- "gist",
207
- "github",
208
- "graph",
209
- "group",
210
- "groups",
211
- "guest",
212
- "guests",
213
- "help",
214
- "home",
215
- "homepage",
216
- "host",
217
- "hosting",
218
- "hostmaster",
219
- "hostname",
220
- "howto",
221
- "hpg",
222
- "html",
223
- "http",
224
- "httpd",
225
- "https",
226
- "i",
227
- "iamges",
228
- "icon",
229
- "icons",
230
- "id",
231
- "idea",
232
- "ideas",
233
- "image",
234
- "images",
235
- "imap",
236
- "img",
237
- "index",
238
- "indice",
239
- "info",
240
- "information",
241
- "inquiry",
242
- "instagram",
243
- "intranet",
244
- "invitations",
245
- "invite",
246
- "ipad",
247
- "iphone",
248
- "irc",
249
- "is",
250
- "issue",
251
- "issues",
252
- "it",
253
- "item",
254
- "items",
255
- "java",
256
- "javascript",
257
- "job",
258
- "jobs",
259
- "join",
260
- "js",
261
- "json",
262
- "jump",
263
- "knowledgebase",
264
- "language",
265
- "languages",
266
- "last",
267
- "ldap-status",
268
- "legal",
269
- "license",
270
- "link",
271
- "links",
272
- "linux",
273
- "list",
274
- "lists",
275
- "log",
276
- "log-in",
277
- "log-out",
278
- "log_in",
279
- "log_out",
280
- "login",
281
- "logout",
282
- "logs",
283
- "m",
284
- "mac",
285
- "mail",
286
- "mail1",
287
- "mail2",
288
- "mail3",
289
- "mail4",
290
- "mail5",
291
- "mailer",
292
- "mailing",
293
- "maintenance",
294
- "manager",
295
- "manual",
296
- "map",
297
- "maps",
298
- "marketing",
299
- "master",
300
- "me",
301
- "media",
302
- "member",
303
- "members",
304
- "message",
305
- "messages",
306
- "messenger",
307
- "microblog",
308
- "microblogs",
309
- "mine",
310
- "mis",
311
- "mob",
312
- "mobile",
313
- "movie",
314
- "movies",
315
- "mp3",
316
- "msg",
317
- "msn",
318
- "music",
319
- "musicas",
320
- "mx",
321
- "my",
322
- "mysql",
323
- "name",
324
- "named",
325
- "nan",
326
- "navi",
327
- "navigation",
328
- "net",
329
- "network",
330
- "new",
331
- "news",
332
- "newsletter",
333
- "nick",
334
- "nickname",
335
- "notes",
336
- "noticias",
337
- "notification",
338
- "notifications",
339
- "notify",
340
- "ns",
341
- "ns1",
342
- "ns10",
343
- "ns2",
344
- "ns3",
345
- "ns4",
346
- "ns5",
347
- "ns6",
348
- "ns7",
349
- "ns8",
350
- "ns9",
351
- "null",
352
- "oauth",
353
- "oauth_clients",
354
- "offer",
355
- "offers",
356
- "official",
357
- "old",
358
- "online",
359
- "openid",
360
- "operator",
361
- "order",
362
- "orders",
363
- "organization",
364
- "organizations",
365
- "overview",
366
- "owner",
367
- "owners",
368
- "page",
369
- "pager",
370
- "pages",
371
- "panel",
372
- "password",
373
- "payment",
374
- "perl",
375
- "phone",
376
- "photo",
377
- "photoalbum",
378
- "photos",
379
- "php",
380
- "phpmyadmin",
381
- "phppgadmin",
382
- "phpredisadmin",
383
- "pic",
384
- "pics",
385
- "ping",
386
- "plan",
387
- "plans",
388
- "plugin",
389
- "plugins",
390
- "policy",
391
- "pop",
392
- "pop3",
393
- "popular",
394
- "portal",
395
- "post",
396
- "postfix",
397
- "postmaster",
398
- "posts",
399
- "pr",
400
- "premium",
401
- "press",
402
- "price",
403
- "pricing",
404
- "privacy",
405
- "privacy-policy",
406
- "privacy_policy",
407
- "privacypolicy",
408
- "private",
409
- "product",
410
- "products",
411
- "profile",
412
- "project",
413
- "projects",
414
- "promo",
415
- "pub",
416
- "public",
417
- "purpose",
418
- "put",
419
- "python",
420
- "query",
421
- "random",
422
- "ranking",
423
- "read",
424
- "readme",
425
- "recent",
426
- "recruit",
427
- "recruitment",
428
- "register",
429
- "registration",
430
- "release",
431
- "remove",
432
- "replies",
433
- "report",
434
- "reports",
435
- "repositories",
436
- "repository",
437
- "req",
438
- "request",
439
- "requests",
440
- "reset",
441
- "roc",
442
- "root",
443
- "rss",
444
- "ruby",
445
- "rule",
446
- "sag",
447
- "sale",
448
- "sales",
449
- "sample",
450
- "samples",
451
- "save",
452
- "school",
453
- "script",
454
- "scripts",
455
- "search",
456
- "secure",
457
- "security",
458
- "self",
459
- "send",
460
- "server",
461
- "server-info",
462
- "server-status",
463
- "service",
464
- "services",
465
- "session",
466
- "sessions",
467
- "setting",
468
- "settings",
469
- "setup",
470
- "share",
471
- "shop",
472
- "show",
473
- "sign-in",
474
- "sign-up",
475
- "sign_in",
476
- "sign_up",
477
- "signin",
478
- "signout",
479
- "signup",
480
- "site",
481
- "sitemap",
482
- "sites",
483
- "smartphone",
484
- "smtp",
485
- "soporte",
486
- "source",
487
- "spec",
488
- "special",
489
- "sql",
490
- "src",
491
- "ssh",
492
- "ssl",
493
- "ssladmin",
494
- "ssladministrator",
495
- "sslwebmaster",
496
- "staff",
497
- "stage",
498
- "staging",
499
- "start",
500
- "stat",
501
- "state",
502
- "static",
503
- "stats",
504
- "status",
505
- "store",
506
- "stores",
507
- "stories",
508
- "style",
509
- "styleguide",
510
- "stylesheet",
511
- "stylesheets",
512
- "subdomain",
513
- "subscribe",
514
- "subscriptions",
515
- "suporte",
516
- "support",
517
- "svn",
518
- "swf",
519
- "sys",
520
- "sysadmin",
521
- "sysadministrator",
522
- "system",
523
- "tablet",
524
- "tablets",
525
- "tag",
526
- "talk",
527
- "task",
528
- "tasks",
529
- "team",
530
- "teams",
531
- "tech",
532
- "telnet",
533
- "term",
534
- "terms",
535
- "terms-of-service",
536
- "terms_of_service",
537
- "termsofservice",
538
- "test",
539
- "test1",
540
- "test2",
541
- "test3",
542
- "teste",
543
- "testing",
544
- "tests",
545
- "theme",
546
- "themes",
547
- "thread",
548
- "threads",
549
- "tmp",
550
- "todo",
551
- "tool",
552
- "tools",
553
- "top",
554
- "topic",
555
- "topics",
556
- "tos",
557
- "tour",
558
- "translations",
559
- "trends",
560
- "tutorial",
561
- "tux",
562
- "tv",
563
- "twitter",
564
- "undef",
565
- "unfollow",
566
- "unsubscribe",
567
- "update",
568
- "upload",
569
- "uploads",
570
- "url",
571
- "usage",
572
- "user",
573
- "username",
574
- "users",
575
- "usuario",
576
- "vendas",
577
- "ver",
578
- "version",
579
- "video",
580
- "videos",
581
- "visitor",
582
- "watch",
583
- "weather",
584
- "web",
585
- "webhook",
586
- "webhooks",
587
- "webmail",
588
- "webmaster",
589
- "website",
590
- "websites",
591
- "welcome",
592
- "widget",
593
- "widgets",
594
- "wiki",
595
- "win",
596
- "windows",
597
- "word",
598
- "work",
599
- "works",
600
- "workshop",
601
- "ww",
602
- "wws",
603
- "www",
604
- "www1",
605
- "www2",
606
- "www3",
607
- "www4",
608
- "www5",
609
- "www6",
610
- "www7",
611
- "wwws",
612
- "wwww",
613
- "xfn",
614
- "xml",
615
- "xmpp",
616
- "xpg",
617
- "xxx",
618
- "yaml",
619
- "year",
620
- "yml",
621
- "you",
622
- "yourdomain",
623
- "yourname",
624
- "yoursite",
625
- "yourusername",
626
- "latest",
627
- "live",
628
- "preview",
629
- "learn",
630
- "supernova",
631
- "super-nova",
632
- ];
633
-
634
- const RESERVED_SLUGS_SET = new Set(RESERVED_SLUGS);
635
-
636
- export const RESERVED_SLUG_PREFIX = "x-sn-reserved-";
637
-
638
- const isSlugReservedInternal = (slug: string) => slug?.startsWith(RESERVED_SLUG_PREFIX);
639
- export function isSlugReserved(slug: string) {
640
- return RESERVED_SLUGS_SET.has(slug) || isSlugReservedInternal(slug);
641
- }