This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface FetchOptions { | |
method?: | |
| "get" | |
| "GET" | |
| "post" | |
| "POST" | |
| "put" | |
| "PUT" | |
| "delete" | |
| "DELETE"; |
- How to install specific NodeJS version
- How do I downgrade node or install a specific previous version using homebrew?
Current linked node version,
$ brew search node
export function CASE<T>(...args: [boolean, T][]) {
return args.find(a => a[0])?.[1]
}
Example:
CASE(
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Ecwid, EcwidOptions } from '@wmakeev/ecwid' | |
import memoize from 'lodash.memoize' | |
export * from '@wmakeev/ecwid' | |
export const getInstance = memoize( | |
(_?: string, options: EcwidOptions = {}) => { | |
const { ECWID_STORE_ID, ECWID_TOKEN_SECRET } = process.env | |
if (!ECWID_STORE_ID) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { cleanEnv, str } from 'envalid' | |
import once from 'lodash/once' | |
export const getEnv = once(() => { | |
return cleanEnv(process.env, { | |
MOYSKLAD_LOGIN: str(), | |
MOYSKLAD_PASSWORD: str(), | |
MOYSKLAD_TIMEZONE: num({ default: -new Date().getTimezoneOffset() }), | |
}) | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const once = require('lodash.once') | |
const { cleanEnv, str } = require('envalid') | |
const getEnv = once(() => { | |
const env = cleanEnv(process.env, { | |
CALENDAR_FIRST_DATE: str() | |
}) | |
return env | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import once from 'lodash/once' | |
import { cleanEnv, str } from 'envalid' | |
import { getSheetAsRecord } from './tools' | |
export function getDocumentProperties() { | |
return PropertiesService.getDocumentProperties().getProperties() | |
} | |
export function setDocumentProperties(properties: { [key: string]: string }) { | |
const props = PropertiesService.getDocumentProperties().setProperties( |