dts-gen 0.5.7 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,19 +0,0 @@
1
- const css = `
2
- div#tsguess-window {
3
- position: fixed;
4
- left: 10%;
5
- top: 10%;
6
- bottom: 10%;
7
- right: 10%;
8
- border: solid black 2px;
9
- background-color: #AAAAAA;
10
- }
11
- `;
12
- const head = document.head || document.getElementsByTagName('head')[0];
13
- const style = document.createElement('style');
14
- style.type = 'text/css';
15
- style.appendChild(document.createTextNode(css));
16
- console.log(style);
17
- const displayWindow = document.createElement('div');
18
- displayWindow.setAttribute('id', 'tsguess-window');
19
- document.body.appendChild(displayWindow);
package/bin/tests/test.js DELETED
@@ -1,60 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const fs = require("fs");
4
- const path = require("path");
5
- const tsg = require("../lib");
6
- const testModuleNames = [
7
- 'fs',
8
- 'path',
9
- 'lodash',
10
- 'jquery',
11
- 'yargs',
12
- 'ecurve',
13
- ];
14
- class MyClass {
15
- constructor(arg) {
16
- this.arg = arg;
17
- this.instanceStr = 'inst';
18
- }
19
- prototypeMethod(_p) { }
20
- static staticMethod(_s) { }
21
- }
22
- MyClass.staticNum = 32;
23
- const selfRefExpr = {
24
- a: 32,
25
- b: 'ok',
26
- self: null,
27
- };
28
- selfRefExpr.self = selfRefExpr;
29
- const expressions = {
30
- Math,
31
- selfref: selfRefExpr,
32
- builtIns: { d: new Date(3), arr: ['x'] },
33
- someArray: [1, 'foo', Math, null, undefined, false],
34
- badNames: { "*": 10, "default": true, "with": 10, " ": 3 },
35
- someClass: MyClass,
36
- };
37
- function checkDeclarationBaseline(name, content) {
38
- const filename = path.join(__dirname, `../../baselines/${name}`);
39
- const existing = fs.existsSync(filename) ? fs.readFileSync(filename, 'utf-8') : '<none>';
40
- if (existing !== content) {
41
- fs.writeFile(filename, content, 'utf-8');
42
- throw new Error(`Baseline ${name} changed`);
43
- }
44
- }
45
- describe("Module tests", () => {
46
- for (const moduleName of testModuleNames) {
47
- it(`Generates the same declaration for ${moduleName}`, () => {
48
- const result = tsg.generateModuleDeclarationFile(moduleName, require(moduleName));
49
- checkDeclarationBaseline(`module-${moduleName}.d.ts`, result);
50
- });
51
- }
52
- });
53
- describe("Expression tests", () => {
54
- for (const key of Object.keys(expressions)) {
55
- it(`Generates the same declaration for ${key}`, () => {
56
- const result = tsg.generateIdentifierDeclarationFile(key, expressions[key]);
57
- checkDeclarationBaseline(`expr-${key}.d.ts`, result);
58
- });
59
- }
60
- });
package/debug.log DELETED
@@ -1,4 +0,0 @@
1
- [0329/095319:ERROR:tcp_listen_socket.cc(76)] Could not bind socket to 127.0.0.1:5859
2
- [0329/095319:ERROR:node_debugger.cc(86)] Cannot start debugger server
3
- [0329/095320:ERROR:tcp_listen_socket.cc(76)] Could not bind socket to 127.0.0.1:5860
4
- [0329/095320:ERROR:node_debugger.cc(86)] Cannot start debugger server