Skip to content

Instantly share code, notes, and snippets.

@artem-mangilev
artem-mangilev / json-to-map.ts
Last active March 23, 2022 10:01
JSON -> Map
// const { performance } = require('perf_hooks'); // for node.js
function map(strings, ...values) {
const innerMapsMap = new Map<string, Map<any, any>>();
let str = ''
strings.forEach((string, i) => {
if (values[i] instanceof Map)
{
const key = `__innerMap_${performance.now()}`
@artem-mangilev
artem-mangilev / launch.json
Last active August 27, 2020 11:46
VSCode launch configuration for debugging Mocha tests written in TypeScript.
{
"version": "0.2.0",
"configurations": [
{
"env": {
"TS_NODE_COMPILER_OPTIONS": "{\"module\":\"commonjs\"}"
},
"args": [
"-r",
"ts-node/register",