Skip to content

Instantly share code, notes, and snippets.

View snuffyDev's full-sized avatar
😮‍💨
nice

snuffy snuffyDev

😮‍💨
nice
View GitHub Profile
import { browser } from "$app/env";
import type { Item } from "./types";
import type { Dict } from "./types/utilities";
import { generateId, iter, notify, splice } from "./utils";
export interface IObjectStores {
playlists: { keyPath: 'id'; },
favorites: { keyPath: 'videoId' | 'id'; };
}
export interface IDBPlaylist {
import { Logger } from "../../helpers";
import { ParsedOption, parseOption } from "./utils";
import * as styles from '../utils/style';
export interface ICommand {
name: string;
flags: string[];
description: string;
<script lang="ts">
import { navigating, session } from "$app/stores";
import { AudioPlayer } from "$lib/player";
import { immersiveQueue, isPagePlaying, playerLoading } from "$lib/stores";
import list from "$lib/stores/list";
import ListItem from "../ListItem/ListItem.svelte";
import Loading from "../Loading/Loading.svelte";
import Tabs from "../Tabs";
import TrackList from "../TrackList";
import { fullscreenStore } from "./channel";
#!/usr/bin/env node
var X=Object.create;var k=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var tt=Object.getOwnPropertyNames;var st=Object.getPrototypeOf,ot=Object.prototype.hasOwnProperty;var et=(t,s,n,e)=>{if(s&&typeof s=="object"||typeof s=="function")for(let o of tt(s))!ot.call(t,o)&&o!==n&&k(t,o,{get:()=>s[o],enumerable:!(e=Q(s,o))||e.enumerable});return t};var nt=(t,s,n)=>(n=t!=null?X(st(t)):{},et(s||!t||!t.__esModule?k(n,"default",{value:t,enumerable:!0}):n,t));var Y=require("path");var j=require("fs"),R=require("path"),B=nt(require("readline"));async function L(){let t=process.stdout,s=process.openStdin(),n=B.default.createInterface({input:s,output:t});function e(r){return new Promise((i,d)=>{n.question(r,i)})}let o=r=>typeof r>"u"?null:(0,R.resolve)(r),p={};n.write(`Sveltegen Configuration -- Leave path blank if unneeded.
`),p.actions=o(await e("Path to actions directory? ")),p.components=o(await e("Path to components directory? ")),p.routes=o(await e("Path to routes directory? "))
<script lang="ts">
import { browser } from '$app/env';
import { UIStore } from '$lib/stores/ui';
import { sleep } from '$lib/utils/wait';
import { onMount } from 'svelte';
import Terminal, {
handler,
} from './Terminal.svelte';
#!
// import { forEach } from './../src/collections/array/forEach';
// import { forEach } from './../src/collections/array/forEach';
import * as fs from 'fs';
import _path from 'path';
const BASE_PATH = _path.resolve('.');
const makePath = (...str: string[]) => _path.join(...str);
const TypeExport = /(?<=export (?:enum|type|interface)[\s]?)(\w+)/gm;
import { Command } from "./Command";
import * as styles from './utils/style';
export class CLI {
private _commands: Record<string, Command> = {};
private _aliases: Record<string, Command> = {};
public help() {
const header = `\n${styles.bold((styles.dim(this.name + ' ' + (this.version ? `v${this.version}` : ' '))))}\n\n`;
import { browser } from "$app/env";
import type { Item } from "./types";
import { generateId, iter, notify, splice } from "./utils";
export interface IObjectStores {
playlists: { keyPath: 'id'; },
favorites: { keyPath: 'videoId' | 'id'; };
}
export interface IDBPlaylist {
name?: string;
transaction.getAll().onsuccess = function (e: IDBRequestTarget) {
if (e.target.result) {
const result = e.target.result;
if (Array.isArray(result)) {
lists = result;
lists.forEach((item, i, array) => {
let id;
if (!item?.id) {
id = generateId(32);
array[i].id = id;
import { browser } from "$app/env";
import { Mutex } from "$lib/utils/mutex";
import type { Item } from "./types";
import { generateId, notify } from "./utils";
export interface IObjectStores {
playlists: { keyPath: 'id'; },
favorites: { keyPath: 'videoId' | 'id'; };
}
export interface IDBPlaylist {