function escapeCell(value) {
if (value === null || value === undefined) return '';
const str = String(value);
if (/[",\n\r]/.test(str)) {
return '"' + str.replace(/"/g, '""') + '"';
}
import base64
import json
from datetime import datetime
class InvalidCursor(Exception):
class Article < ApplicationRecord
has_many :taggings, dependent: :destroy
has_many :tags, through: :taggings
scope :published, -> { where.not(published_at: nil) }
use async_trait::async_trait;
use std::io;
#[async_trait]
pub trait ConnectionFactory: Send + Sync + 'static {
type Connection: Send + 'static;
import { SetMetadata } from '@nestjs/common';
export enum Role {
User = 'user',
Editor = 'editor',
Admin = 'admin',
package authtransport
import (
"errors"
"net/http"
)
@RestController
@RequestMapping("/api/transactions")
public class TransactionExportController {
private final CsvExportService exportService;
class ApiError extends Error {
constructor(statusCode, message, code) {
super(message);
this.name = 'ApiError';
this.statusCode = statusCode;
this.code = code || null;
import io
import os
from uuid import uuid4
from PIL import Image, UnidentifiedImageError
ALLOWED_FORMATS = {"JPEG", "PNG", "WEBP"}
const CACHE_NAME = 'swr-api-v1';
const STAMP_HEADER = 'x-cached-at';
async function open() {
return caches.open(CACHE_NAME);
}
class Product < ApplicationRecord
has_many :reviews, dependent: :destroy
scope :published, -> { where(published: true) }
def average_rating
import base64
import json
from django.core.exceptions import BadRequest