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 default function replayer(array, opts = {}, emit) { | |
| let idx = 0 | |
| let timer | |
| return { | |
| start: next, | |
| stop: stop, | |
| reset: reset | |
| } |
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
| [ | |
| { | |
| "op": "replace", | |
| "path": [ | |
| "nodes", | |
| "0", | |
| "nodes", | |
| "0", | |
| "characters", | |
| "8", |
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
| node_modules |
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
| { | |
| "name": "gist-test", | |
| "version": "0.0.0", | |
| "bin": "./run.js" | |
| } |
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 assert = require('assert') | |
| // takes a flat structure like this | |
| const input = [ | |
| { | |
| level: 1, | |
| title: '1' | |
| }, | |
| { | |
| level: 1, |
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 {Subject} from 'rx/Subject' | |
| import {of} from 'rx/observable/of' | |
| import {publishReplay, refCount, concat} from 'rxjs/observable' | |
| function createState(initial) { | |
| const onChange$ = new Subject() | |
| function onChange(...args) { | |
| onChange$.next(args) | |
| } |
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
| /* eslint-disable no-console */ | |
| import client from 'part:@sanity/base/client' | |
| import reduce from 'json-reduce' | |
| // see https://github.com/sanity-io/sanity/blob/next/packages/example-studio/schemas/languages.js for an example | |
| import {SUPPORTED_LANGUAGES} from '../schemas/languages' | |
| import Translate from '@google-cloud/translate' | |
| const translateAPI = new Translate({ |
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
Show hidden characters
| { | |
| "presets": [ | |
| [ | |
| "env", | |
| { | |
| "targets": { | |
| "node": "6", | |
| "chrome": "59", | |
| "safari": "10", | |
| "firefox": "56", |
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 {deburr, kebabCase} = require('lodash') | |
| const sanityClient = require('@sanity/client') | |
| const client = sanityClient({ | |
| projectId: '<your priojectId>', | |
| dataset: '<your dataset>', | |
| token: '<your auth token>', | |
| useCdn: false | |
| }) |
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 React from 'react' | |
| import SearchableSelect from 'part:@sanity/components/selects/searchable' | |
| import FormField from 'part:@sanity/components/formfields/default' | |
| import {PatchEvent, set, unset} from 'part:@sanity/form-builder/patch-event' | |
| const STREET_NAMES = [ | |
| 'Thorvald Meyers gate', | |
| 'Champs-Élysées', | |
| 'Lombard Street', | |
| 'Abbey Road', |