GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — :recycle: cleaner typeof · nullstack/nullstack@eed0986

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • client
    • instanceProxyHandler.js
    • render.js
    • rerender.js
  • server
    • index.js
    • instanceProxyHandler.js
    • render.js
    • server.js
    • template.js
  • shared
    • nodes.js
  • tests/src
    • TwoWayBindings.njs
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎client/instanceProxyHandler.js‎

Copy file name to clipboardExpand all lines: client/instanceProxyHandler.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const instanceProxyHandler = {
66
get(target, name) {
77
if (name === '_isProxy') return true;
88
if (target.constructor[name]?.name === '_invoke') return target.constructor[name].bind(target.constructor)
9-
if (!target[name]?.name?.startsWith('_') && !name.startsWith('_') && typeof (target[name]) === 'function' && name !== 'constructor') {
9+
if (!target[name]?.name?.startsWith('_') && !name.startsWith('_') && typeof target[name] === 'function' && name !== 'constructor') {
1010
const { [name]: named } = {
1111
[name]: (args) => {
1212
const context = generateContext({ ...target._attributes, ...args, self: target._self });
Collapse file

‎client/render.js‎

Copy file name to clipboardExpand all lines: client/render.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export default function render(node, options) {
4545
eventSubjects.set(node.element, node.attributes)
4646
}
4747
} else {
48-
const type = typeof (node.attributes[name]);
48+
const type = typeof node.attributes[name];
4949
if (type !== 'object' && type !== 'function') {
5050
if (name != 'value' && node.attributes[name] === true) {
5151
node.element.setAttribute(name, '');
Collapse file

‎client/rerender.js‎

Copy file name to clipboardExpand all lines: client/rerender.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function updateAttributes(selector, current, next) {
4040
eventSubjects.set(selector, next.attributes)
4141
}
4242
} else {
43-
const type = typeof (next.attributes[name]);
43+
const type = typeof next.attributes[name];
4444
if (type !== 'object' && type !== 'function') {
4545
if (current.attributes[name] !== undefined && next.attributes[name] === undefined) {
4646
selector.removeAttribute(name);
Collapse file

‎server/index.js‎

Copy file name to clipboardExpand all lines: server/index.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class Nullstack {
6565
toJSON() {
6666
const serialized = {};
6767
for (const name of Object.getOwnPropertyNames(this)) {
68-
if (typeof (this[name]) !== 'function' && !name.startsWith('_') && name !== 'attributes') {
68+
if (typeof this[name] !== 'function' && !name.startsWith('_') && name !== 'attributes') {
6969
serialized[name] = this[name];
7070
}
7171
}
Collapse file

‎server/instanceProxyHandler.js‎

Copy file name to clipboardExpand all lines: server/instanceProxyHandler.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const instanceProxyHandler = {
22
get(target, name) {
3-
if (!target[name]?.name?.startsWith('_') && !name.startsWith('_') && typeof (target[name]) === 'function' && name !== 'constructor') {
3+
if (!target[name]?.name?.startsWith('_') && !name.startsWith('_') && typeof target[name] === 'function' && name !== 'constructor') {
44
return (args) => {
55
const context = target._scope.generateContext({ ...target._attributes, ...args, self: target._self });
66
return target[name](context);
Collapse file

‎server/render.js‎

Copy file name to clipboardExpand all lines: server/render.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default function render(node, scope, next) {
3535

3636
for (let name in node.attributes) {
3737
if (!name.startsWith('on') && name !== 'html') {
38-
const type = typeof (node.attributes[name]);
38+
const type = typeof node.attributes[name];
3939
if (type !== 'object' && type !== 'function') {
4040
if (name != 'value' && node.attributes[name] === true) {
4141
element += ` ${name}`;
Collapse file

‎server/server.js‎

Copy file name to clipboardExpand all lines: server/server.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function createResponse(callback) {
8888
};
8989
res.getHeader = (x) => headers[x];
9090
res.redirect = function (_code, url) {
91-
if (typeof (_code) !== 'number') {
91+
if (typeof _code !== 'number') {
9292
code = 301;
9393
url = _code;
9494
} else {
Collapse file

‎server/template.js‎

Copy file name to clipboardExpand all lines: server/template.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default function ({ head, body, context, instances }) {
1313
const serializableContext = {};
1414
const blacklist = ['scope', 'router', 'page', 'environment', 'settings', 'worker', 'params', 'project', 'instances'];
1515
for (const [key, value] of Object.entries(context)) {
16-
if (!blacklist.includes(key) && typeof (value) !== 'function') {
16+
if (!blacklist.includes(key) && typeof value !== 'function') {
1717
serializableContext[key] = value;
1818
}
1919
}
Collapse file

‎shared/nodes.js‎

Copy file name to clipboardExpand all lines: shared/nodes.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ export function isFalse(node) {
99
}
1010

1111
export function isClass(node) {
12-
return typeof (node.type) === 'function' && node.type.prototype && typeof (node.type.prototype.render) === 'function';
12+
return typeof node.type === 'function' && node.type.prototype && typeof node.type.prototype.render === 'function';
1313
}
1414

1515
export function isFunction(node) {
16-
return typeof (node.type) === 'function';
16+
return typeof node.type === 'function';
1717
}
1818

1919
export function isText(node) {
Collapse file

‎tests/src/TwoWayBindings.njs‎

Copy file name to clipboardExpand all lines: tests/src/TwoWayBindings.njs
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ class TwoWayBindings extends Nullstack {
3636
<div>
3737
<input bind={this.zero} />
3838
<div data-number={this.number} />
39-
{!this.boolean && <div data-boolean-type={typeof (this.boolean)} />}
40-
{this.number > 1 && <div data-number-type={typeof (this.number)} />}
39+
{!this.boolean && <div data-boolean-type={typeof this.boolean} />}
40+
{this.number > 1 && <div data-number-type={typeof this.number} />}
4141
<input bind={this.number} oninput={this.updateCharacter} />
4242
<textarea bind={this.text} />
4343
<div data-character={this.character} />

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.