$ npm install
$ npx tsc
index.ts:3:24 - error TS2507: Type '{ default: DuplexifyConstructor; obj(writable?: Writable | undefined, readable?: Readable | undefined, streamOptions?: DuplexOptions | undefined): Duplexify; }' is not a constructor function type.
3 class MyDuplex extends Duplexify {}
~~~~~~~~~
This file contains 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 {Readable} = require('stream'); | |
class PageStream extends Readable { | |
constructor(requestFn) { | |
super({objectMode: true}); | |
this.request = requestFn; | |
this.nextQuery = {}; | |
this.pending = []; | |
} | |
async _read() { |
This file contains 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
function decorate(Promise) { | |
Promise.prototype.spread = function(yep, nope) { | |
var args = [yep ? resolver(yep) : null]; | |
if (nope) { | |
args.push(resolver(nope)); | |
} | |
return this.then.apply(this, args); | |
}; |
This file contains 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": "test", | |
"version": "0.0.0", | |
"dependencies": { | |
"@google-cloud/bigquery": { | |
"version": "0.3.0", | |
"from": "@google-cloud/bigquery@>=0.3.0 <0.4.0", | |
"resolved": "https://registry.npmjs.org/@google-cloud/bigquery/-/bigquery-0.3.0.tgz" | |
}, | |
"@google-cloud/bigtable": { |
This file contains 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
{ | |
"id": "bigtable", | |
"type": "class", | |
"name": "Bigtable", | |
"overview": "<p>\n This class allows you interact with Google Cloud Bigtable.\n</p>\n\n<p>\n First, install <code>@google-cloud/bigtable</code> with npm:\n</p>\n\n<div hljs language=\"bash\">$ npm install --save @google-cloud/bigtable</div>\n\n<p>\n If you are running your app on Google Compute Engine, you won't need to worry about supplying connection configuration options to <code>@google-cloud/bigtable</code>— we figure that out for you.\n</p>\n\n<p>\n However, if you're running your app elsewhere, you will need to provide project details to authenticate API requests.\n</p>\n\n<h4>Compute Engine</h4>\n<div hljs language=\"javascript\">\nvar bigtable = require('@google-cloud/bigtable')();\n</div>\n\n<h4>Elsewhere</h4>\n<div hljs language=\"javascript\">\nvar bigtable = require('@google-cloud/bigtable')({\n projectId: 'grape-spaceship-123',\n keyFilename: '/path/to/keyfile.json'\n});\n</div>\n\n<p>\n The full set of options which can be |
This file contains 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
{ | |
"id": "bucket", | |
"metadata": { | |
"name": "Bucket", | |
"description": null | |
}, | |
"methods": [{ | |
"metadata": { | |
"constructor": true, | |
"name": "Bucket", |
This file contains 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 argparse | |
import json | |
from parinx.parser import parse_docstring | |
import pdoc | |
def main(): | |
parser = argparse.ArgumentParser(description='Document Python modules.') | |
parser.add_argument('module', nargs='*', |
This file contains 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
var Thing = Weird.extend({ | |
myProp: 'hello', | |
getMyProp: function () { | |
return myProp; | |
}, | |
setMyProp: function (value) { | |
myProp = value; |
This file contains 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
angular | |
.module('preload', []) | |
.factory('preload', function ($q) { | |
'use strict'; | |
function getImage (src, ignoreFailure) { | |
var defer = $q.defer(); | |
var img = new Image(); | |
var resolve = defer.resolve.bind(defer, img); |
NewerOlder