Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce typo count. #107

Merged
merged 1 commit into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/API.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
import { Channel, ChannelOpt } from './types/global/Channel'
import { DownloadDataOpt as IDownloadTextOpt } from './types/global/DownloadData'
import { DownloadURLOpt } from './types/global/DownloadURL'
import { PositionObserverCostructor } from './types/global/PositionObserver'
import { PositionObserverConstructor } from './types/global/PositionObserver'
import {
SpeechGrammarList,
SpeechGrammarListOpt,
Expand Down Expand Up @@ -268,7 +268,7 @@ export type API = {
exitPictureInPicture(): Promise<void>
pictureInPictureElement: Element
MutationObserver: { new (callback: MutationCallback): MutationObserver }
PositionObserver: PositionObserverCostructor
PositionObserver: PositionObserverConstructor
ResizeObserver: { new (callback: ResizeObserverCallback): ResizeObserver }
IntersectionObserver: {
new (
Expand Down
2 changes: 1 addition & 1 deletion src/Class/Graph/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1601,7 +1601,7 @@ export class Graph<I extends Dict<any> = any, O extends Dict<any> = any>
fork: boolean,
bubble: boolean
): void {
// console.log('_setPinSetFuncitonal', type, name, functional, fork, bubble)
// console.log('_setPinSetFunctional', type, name, functional, fork, bubble)

fork && this._fork(undefined, true, bubble)

Expand Down
4 changes: 2 additions & 2 deletions src/Class/Graph/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export type GraphAddUnitData = {
bubble?: boolean
position?: Position | undefined
pinPosition?: IOOf<Dict<Position>> | undefined
layoutPositon?: Position | undefined
layoutPosition?: Position | undefined
parentId?: string | null | undefined
merges?: GraphUnitMerges | undefined
plugs?: GraphUnitPlugs | undefined
Expand Down Expand Up @@ -147,7 +147,7 @@ export type GraphRemoveUnitData = {
bundle?: UnitBundleSpec
position?: Position
pinPosition?: IOOf<Dict<Position>>
layoutPositon?: Position
layoutPosition?: Position
parentId?: string | null
merges?: GraphMergesSpec
plugs?: GraphUnitPlugs
Expand Down
10 changes: 5 additions & 5 deletions src/client/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ export class Component<

attachText(type: string, text: string): void {
if (this._attachTextUnlisten[type]) {
this.dettachText(type)
this.detachText(type)
}

const base = this.getRootBase()
Expand All @@ -316,7 +316,7 @@ export class Component<
this._attachTextUnlisten[type] = callAll(unlistenAll)
}

dettachText(type: string): void {
detachText(type: string): void {
const unlisten = this._attachTextUnlisten[type]

if (unlisten) {
Expand Down Expand Up @@ -1413,7 +1413,7 @@ export class Component<
)
}

isHMTL(): boolean {
isHTML(): boolean {
return this.$element instanceof HTMLElement
}

Expand Down Expand Up @@ -1691,9 +1691,9 @@ export class Component<
}

public templateChildWrapper(child, svg, html, fallback) {
if (this.isHMTL() && child.isSVG()) {
if (this.isHTML() && child.isSVG()) {
return svg()
} else if (this.isSVG() && child.isHMTL()) {
} else if (this.isSVG() && child.isHTML()) {
return html()
} else {
return fallback()
Expand Down
2 changes: 1 addition & 1 deletion src/client/util/geometry/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export type Rect = {
height: number
}

export type Trasform = {
export type Transform = {
x: number
}

Expand Down
4 changes: 2 additions & 2 deletions src/docs/concept/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ The simplicity of programming in Unit comes from the very small number of repeat

The concept of a unit is essentially an advancement of the fundamental concept of a function, common to many Textual Programming Languages, such as JavaScript and C++. A function is supposed to be given an ordered list of arguments as input and it can return a single datum as output. A unit, on the other hand, can receive and send data at any time, in any order and through multiple inputs and outputs. We found that redefining the fundamental building block of Programming as a unit can exponentially reduce Software Complexity.

A code drawn in Unit is simply a Directed Graph. This is commonly the same representational model a software archictect might have in mind for understanding how programs work, or in better words, how inputs are progressively transformed into the desired outputs. This way, Unit removes steps that separate Software Architecture from Software Development. The pseudocode, the code and the program become one. Design and Development can be performed in the same place.
A code drawn in Unit is simply a Directed Graph. This is commonly the same representational model a software architect might have in mind for understanding how programs work, or in better words, how inputs are progressively transformed into the desired outputs. This way, Unit removes steps that separate Software Architecture from Software Development. The pseudocode, the code and the program become one. Design and Development can be performed in the same place.

The conception of Unit was motivated by the observable frustration the modern programmer goes through to express even simple constructs in written code. Ideas that are easy to express commonly map to disproportionate complexity and often need to be implemented from scratch, especially when one's feeling creative, which often leads to code duplication in a global scale, leading to global waste. While the existing ecosystem provides additional tooling to support development, they come with the added cost of frequent Context Switch. The developer is constantly forced to spend time in custom "setup", "configuration", "learning" and "integration" tasks, instead of focusing on Beauty and Functionality.

Systems built on top of traditional Textual Programming Languages became so complex and heterogeneous developers lost much of their ability to understand and control their own code, rendering a weak ecosystem where every individual piece of software cannot be decomposed neither reused, much less integrated with in a plug and play manner. This is a reflex of an industry that failed to incorporate many rather fundamental principles of Systems Programming and their intersection with Cognitive Psychology.

The current state of the art of Programming imposes a tall barrier of entry for people interested in making Small Software. Reading written code is known to be error-prone and time-consuming. Such dread is further augmented by the diffculty of understanding the architecture of a program in the big picture, which is a reflex of the paradigm mismatch between how systems are encoded and how they are represented.
The current state of the art of Programming imposes a tall barrier of entry for people interested in making Small Software. Reading written code is known to be error-prone and time-consuming. Such dread is further augmented by the difficulty of understanding the architecture of a program in the big picture, which is a reflex of the paradigm mismatch between how systems are encoded and how they are represented.

By making conceptually simple programs simple to express visually in Unit, the user can be quickly taught to build small useful machines that can, between many things, automate otherwise repetitive tasks, all by himself, a practice we call Personal Programming in contrast with Software Engineering, further blurring the line between User and Developer.

Expand Down
8 changes: 4 additions & 4 deletions src/docs/evolution/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ Currently, these are the most taped development frontlines:

## Language

The internal functioning of Unit is rulled by a collection of lower level classes that define reusable naturally occuring multi-input-multi-output state machines, which are the basis of the Unit system, such as [Unit](../../Class/Unit/index.ts), [Primitive](../../Class/Primitive/index.ts), [Functional](../../Class/Functional/index.ts) and [Graph](../../Class/Graph/index.ts). Every object in Unit extends [\$](../../$/index.ts) base class.
The internal functioning of Unit is ruled by a collection of lower level classes that define reusable naturally occurring multi-input-multi-output state machines, which are the basis of the Unit system, such as [Unit](../../Class/Unit/index.ts), [Primitive](../../Class/Primitive/index.ts), [Functional](../../Class/Functional/index.ts) and [Graph](../../Class/Graph/index.ts). Every object in Unit extends [\$](../../$/index.ts) base class.

## Primitives

Unit's primitives mostly grow in a few directions:

- Control (common, globally useful, flow control programming patterns)
- Web (new Web APIs and components)
- Node.js (lower level APIs unnavailable on the Web)
- Node.js (lower level APIs unavailable on the Web)
- System (allow the user to create and control sandboxed sub-systems)
- Extension (complementary APIs only available to Web extensions)

Each new API is to be wrapped into a carefully designed and well documented primitive state machine.

All currently available primitives live in the [system](/src/system) folder.

These are examples of primitive classes: [`add`](/src/system/f/arithmetic/Add/index.ts) (`+` operation), [`oscilator node`](/src/system/platform/api/media/audio/OscillatorNode/index.ts) (Web Audio API), and `peer transmitter` (simplified Web RTC).
These are examples of primitive classes: [`add`](/src/system/f/arithmetic/Add/index.ts) (`+` operation), [`oscillator node`](/src/system/platform/api/media/audio/OscillatorNode/index.ts) (Web Audio API), and `peer transmitter` (simplified Web RTC).

## Editor

Expand Down Expand Up @@ -58,7 +58,7 @@ Right now the collection is composed of mostly lower level functional units that

## Decomposition

Some components, such as the editor itself, have been written in TypeScript during the process of boostraping Unit.
Some components, such as the editor itself, have been written in TypeScript during the process of bootstrapping Unit.

Continuously abstracting away functionality from textually defined components in the form of units has many advantages:

Expand Down
6 changes: 3 additions & 3 deletions src/docs/start/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ To enter Add Mode (also Green Mode) you can either click on the "plus sign" mode

In Add Mode, it is possible to copy a unit (or the currently Selected Subgraph).

A unit can be shallow clonned with a Green Drag and Drop:
A unit can be shallow cloned with a Green Drag and Drop:

![](/public/gif/start/9.gif)

Expand Down Expand Up @@ -188,7 +188,7 @@ Draw a circle to create an empty unit. Draw a rectangle to create an empty unit

![](/public/gif/start/33.gif)

Drawing a contour around a group of nodes, will compose those nosdes.
Drawing a contour around a group of nodes, will compose those nodes.

![](/public/gif/start/42.gif)

Expand Down Expand Up @@ -218,7 +218,7 @@ To undo last action, press <kbd>Ctrl + Z</kbd>. To redo, press <kbd>Ctrl + Shift

![](/public/gif/start/38.gif)

## Trasncend
## Transcend

Pulling up the top "transcend" button will wrap the current graph in an editor.

Expand Down
4 changes: 2 additions & 2 deletions src/exception/APINotImplementedError.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export function apiNotSuportedError(name: string): string {
export function apiNotSupportedError(name: string): string {
return `${name} API not implemented`
}

export class APINotSupportedError extends Error {
constructor(name: string) {
super(apiNotSuportedError(name))
super(apiNotSupportedError(name))
}
}
8 changes: 4 additions & 4 deletions src/spec/actions/G.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export const makeAddUnitAction = (
bundle: UnitBundleSpec,
position?: Position | undefined,
pinPosition?: IOOf<Dict<Position>> | undefined,
layoutPositon?: Position | undefined,
layoutPosition?: Position | undefined,
parentId?: string | null | undefined,
merges?: GraphUnitMerges | undefined,
plugs?: GraphUnitPlugs | undefined
Expand All @@ -124,7 +124,7 @@ export const makeAddUnitAction = (
bundle,
position,
pinPosition,
layoutPositon,
layoutPosition,
parentId,
merges,
plugs,
Expand Down Expand Up @@ -277,7 +277,7 @@ export const makeRemoveUnitAction = (
bundle: UnitBundleSpec,
position?: Position,
pinPosition?: IOOf<Dict<Position>>,
layoutPositon?: Position,
layoutPosition?: Position,
parentId?: string | null,
merges?: GraphMergesSpec,
plugs?: GraphUnitPlugs
Expand All @@ -287,7 +287,7 @@ export const makeRemoveUnitAction = (
bundle,
position,
pinPosition,
layoutPositon,
layoutPosition,
parentId,
merges,
plugs,
Expand Down
6 changes: 3 additions & 3 deletions src/spec/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1597,7 +1597,7 @@ export function applyGenerics(
return value
}

function _isEmtpyString(str: string): boolean {
function _isEmptyString(str: string): boolean {
return !!/^ *$/.exec(str)
}

Expand Down Expand Up @@ -1695,7 +1695,7 @@ function _getDelimiterSeparated(
// push last element
const lastChildString = value.substring(lastStop, value.length)

if (!_isEmtpyString(lastChildString) || pushNext) {
if (!_isEmptyString(lastChildString) || pushNext) {
children.push(_getTree(lastChildString, keyValue, ignoreKeyword))
}

Expand Down Expand Up @@ -1879,7 +1879,7 @@ export function _getNextSiblingPath(
// Here is an idea for the mechanics:
// 1) Arrow key right or left -> go right or left
// 2) Arrow down -> go lower level
// 3) Arrow up -> go uper level
// 3) Arrow up -> go upper level

export function getNextSiblingPath(
value: string,
Expand Down
2 changes: 1 addition & 1 deletion src/system/core/common/LengthEquals/spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
},
"metadata": {
"icon": "ruler",
"description": "check whther the length of `a` is equal to `n`?",
"description": "check whether the length of `a` is equal to `n`?",
"complexity": 8,
"tags": ["core", "common"]
},
Expand Down
2 changes: 1 addition & 1 deletion src/system/core/common/LengthLessThan/spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
},
"metadata": {
"icon": "ruler",
"description": "check wether the length of `a` lesser than `b`",
"description": "check whether the length of `a` lesser than `b`",
"complexity": 8,
"tags": ["core", "common"]
},
Expand Down
2 changes: 1 addition & 1 deletion src/system/f/control/Iterate/spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"metadata": {
"icon": "undo",
"description": "interatively update a single value",
"description": "iteratively update a single value",
"complexity": 3,
"tags": ["f", "control"]
},
Expand Down
2 changes: 1 addition & 1 deletion src/system/f/meta/New/spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"metadata": {
"icon": "circle",
"description": "intantiate `class`",
"description": "instantiate `class`",
"complexity": 3,
"tags": ["f", "meta"]
},
Expand Down
2 changes: 1 addition & 1 deletion src/system/f/string/ToLowerCase/spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"metadata": {
"icon": "ruler",
"description": "conver string to lower case",
"description": "convert string to lower case",
"link": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase",
"complexity": 3,
"tags": ["f", "string"]
Expand Down
2 changes: 1 addition & 1 deletion src/system/f/time/Interval/spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"ms": {
"type": "number",
"metadata": {
"description": "same as the inputed `ms`"
"description": "same as the inputted `ms`"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/system/f/time/Timer/spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"ms": {
"type": "number",
"metadata": {
"description": "same as the inputed `ms`"
"description": "same as the inputted `ms`"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/system/platform/api/alert/Alert/spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"outputs": {},
"metadata": {
"icon": "tilde",
"description": "diplay a dialog with an optional message and wait until user dismisses it",
"description": "display a dialog with an optional message and wait until user dismisses it",
"complexity": 3,
"tags": ["platform", "api", "base64"]
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Functional } from '../../../../../Class/Functional'
import { Done } from '../../../../../Class/Functional/Done'
import { apiNotSuportedError } from '../../../../../exception/APINotImplementedError'
import { apiNotSupportedError } from '../../../../../exception/APINotImplementedError'
import { System } from '../../../../../system'
import { ID_REQUEST_ANIMATION_FRAME } from '../../../../_ids'

Expand Down Expand Up @@ -43,7 +43,7 @@ export default class RequestAnimationFrame extends Functional<I, O> {
done({ a })
})
} else {
done(undefined, apiNotSuportedError('Request Animation Frame'))
done(undefined, apiNotSupportedError('Request Animation Frame'))
samuelmtimbo marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/system/platform/api/base64/Decode/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default class Decode extends Functional<I, O> {
try {
a = atob(b)
} catch {
done(undefined, 'string not correctly enconded')
done(undefined, 'string not correctly encoded')

return
}
Expand Down
2 changes: 1 addition & 1 deletion src/system/platform/api/crypto/ImportJwtKey/spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"metadata": {
"icon": "lock",
"description": "parse cryto jwk `key` given knowledge of `format`, `algorithm`, `extractable` and `keyUsages`",
"description": "parse crypto jwk `key` given knowledge of `format`, `algorithm`, `extractable` and `keyUsages`",
"link": "https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey",
"complexity": 3,
"tags": ["platform", "api", "crypto"]
Expand Down
2 changes: 1 addition & 1 deletion src/system/platform/api/crypto/ImportKey/spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
"metadata": {
"icon": "lock",
"description": "parse cryto `key` given knowledge of `format`, `algorithm`, `extractable` and `keyUsages`",
"description": "parse crypto `key` given knowledge of `format`, `algorithm`, `extractable` and `keyUsages`",
"link": "https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey",
"complexity": 3,
"tags": ["platform", "api", "crypto"]
Expand Down
4 changes: 2 additions & 2 deletions src/system/platform/api/file/FileReader/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { $ } from '../../../../../Class/$'
import { Done } from '../../../../../Class/Functional/Done'
import { Holder } from '../../../../../Class/Holder'
import { apiNotSuportedError } from '../../../../../exception/APINotImplementedError'
import { apiNotSupportedError } from '../../../../../exception/APINotImplementedError'
import { System } from '../../../../../system'
import { FR } from '../../../../../types/interface/FR'
import { wrapFileReader } from '../../../../../wrap/FileReader'
Expand Down Expand Up @@ -45,7 +45,7 @@ export default class FileReader extends Holder<I, O> {
} = this.__system

if (!FileReader) {
done(undefined, apiNotSuportedError('FileReader'))
done(undefined, apiNotSupportedError('FileReader'))

return
}
Expand Down
4 changes: 2 additions & 2 deletions src/system/platform/api/media/ImageCapture/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Done } from '../../../../../Class/Functional/Done'
import { Holder } from '../../../../../Class/Holder'
import { apiNotSuportedError } from '../../../../../exception/APINotImplementedError'
import { apiNotSupportedError } from '../../../../../exception/APINotImplementedError'
import { System } from '../../../../../system'
import { IC } from '../../../../../types/interface/IC'
import { MST } from '../../../../../types/interface/MST'
Expand Down Expand Up @@ -51,7 +51,7 @@ export default class ImageCapture_ extends Holder<I, O> {
} = this.__system

if (!ImageCapture) {
done(undefined, apiNotSuportedError('Image Capture'))
done(undefined, apiNotSupportedError('Image Capture'))

return
}
Expand Down
Loading