SILENT KILLERPanel

Current Path: > home > codekrsu > > shopceylon.store > wp-content > plugins > code-snippets > > js > utils >


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: /home/codekrsu//shopceylon.store/wp-content/plugins/code-snippets//js/utils/

NameTypeSizeLast ModifiedActions
Linter.ts File 4545 bytes February 14 2025 13:16:14.
errors.ts File 80 bytes November 27 2024 21:52:46.
files.ts File 1110 bytes November 27 2024 21:28:50.
general.ts File 249 bytes November 27 2024 21:28:50.
restAPI.ts File 793 bytes February 14 2025 13:16:14.
shortcodes.ts File 346 bytes May 19 2023 18:41:32.
snippets.ts File 968 bytes November 27 2024 21:28:50.
text.ts File 623 bytes February 14 2025 13:16:14.

Reading File: /home/codekrsu//shopceylon.store/wp-content/plugins/code-snippets//js/utils//snippets.ts

import { isNetworkAdmin } from './general'
import type { Snippet, SnippetScope, SnippetType } from '../types/Snippet'

const PRO_TYPES: SnippetType[] = ['css', 'js']

export const createEmptySnippet = (): Snippet => ({
	id: 0,
	name: '',
	desc: '',
	code: '',
	tags: [],
	scope: 'global',
	modified: '',
	active: false,
	network: isNetworkAdmin(),
	shared_network: null,
	priority: 10
})

export const getSnippetType = (snippetOrScope: Snippet | SnippetScope): SnippetType => {
	const scope = 'string' === typeof snippetOrScope ? snippetOrScope : snippetOrScope.scope

	switch (true) {
		case scope.endsWith('-css'):
			return 'css'

		case scope.endsWith('-js'):
			return 'js'

		case scope.endsWith('content'):
			return 'html'

		default:
			return 'php'
	}
}

export const isProSnippet = (snippet: Snippet | SnippetScope): boolean =>
	PRO_TYPES.includes(getSnippetType(snippet))

export const isProType = (type: SnippetType): boolean =>
	PRO_TYPES.includes(type)

SILENT KILLER Tool