Skip to content

Commit

Permalink
Typo corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
mcfriend99 committed Oct 25, 2024
1 parent 6e9a2d0 commit f5b4a1d
Show file tree
Hide file tree
Showing 20 changed files with 61 additions and 59 deletions.
14 changes: 8 additions & 6 deletions libs/args.b
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,11 @@ def _get_real_value(item, value) {
else if item.type == STRING return to_string(value)
else if item.type == LIST return is_list(value) ? value : [value]
else if item.type == CHOICE {
if is_list(item.choices)
return item.choices.contains(value) ? value : value
else return item.choices.contains(value) ? item.choices[value] : value
if is_list(item.choices) {
return item.choices.contains(value) ? value : value
} else {
return item.choices.contains(value) ? item.choices[value] : value
}
}
return value
}
Expand Down Expand Up @@ -513,7 +515,7 @@ class Parser < _Optionable {

line += self._opt_line(opt)

# We want to separate the longtest option names at least 12
# We want to separate the longest option names at least 12
# characters away from the help texts.
line = line.rpad(width + 5)

Expand All @@ -528,7 +530,7 @@ class Parser < _Optionable {

line += self._opt_line(cmd)

# We want to separate the longtest option names at least 12
# We want to separate the longest option names at least 12
# characters away from the help texts.
line = line.rpad(width + 20)

Expand Down Expand Up @@ -663,7 +665,7 @@ class Parser < _Optionable {
* blade test.b install 5 --verbose
* ```
*
* may yeild such a result as similar to the one below.
* may yield such a result as similar to the one below.
*
* ```
* {options: {verbose: true}, command: {name: install, value: 5}}
Expand Down
2 changes: 1 addition & 1 deletion libs/array.b
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @module array
*
* This moddule provides multiple classes for working with arrays of twos-complement
* This module provides multiple classes for working with arrays of twos-complement
* integers in the platform byte order. The classes provided in this module complement
* the _bytes()_ object and allow higher other binary data manipulation.
*
Expand Down
2 changes: 1 addition & 1 deletion libs/colors.b
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ def rgb_to_xyz(r, g, b) {
y = (r * 0.2126729) + (g * 0.7151522) + (b * 0.072175),
z = (r * 0.0193339) + (g * 0.119192) + (b * 0.9503041)

return [x * 100, y * 100, z * 100];
return [x * 100, y * 100, z * 100]
}

/**
Expand Down
2 changes: 1 addition & 1 deletion libs/date.b
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ class Date {
}

/**
* Returns the number of days in the year preceeding the first
* Returns the number of days in the year preceding the first
* day of the month.
*
* Example,
Expand Down
32 changes: 16 additions & 16 deletions libs/hash.b
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def whirlpool(str) {
}

/**
* Returns the snefru cyrptographic hash of the given string or bytes.
* Returns the Snefru cryptographic hash of the given string or bytes.
*
* @param string|bytes str
* @returns string
Expand All @@ -223,7 +223,7 @@ def snefru(str) {
}

/**
* Returns the siphash cyrptographic hash of the given string or bytes.
* Returns the SipHash cryptographic hash of the given string or bytes.
*
* @param string|bytes key
* @param string|bytes str
Expand All @@ -236,9 +236,9 @@ def siphash(key, str) {
raise Exception('str must be string or bytes')
}

if key.length() > 16
if key.length() > 16 {
raise Exception('key must be maximum of 16 characters/bytes long')
else if key.length() < 16 {
} else if key.length() < 16 {
if is_bytes(key) key = key.to_string()
key = key.rpad(16, '\0')
}
Expand All @@ -250,7 +250,7 @@ def siphash(key, str) {
}

/**
* Returns the gost cyrptographic hash of the given string or bytes.
* Returns the Gost cryptographic hash of the given string or bytes.
*
* @param string|bytes str
* @returns string
Expand Down Expand Up @@ -311,7 +311,7 @@ def hmac(method, key, str) {
}

/**
* Returns the HMAC-MD2 cyrptographic hash of the given string or bytes.
* Returns the HMAC-MD2 cryptographic hash of the given string or bytes.
*
* @param string|bytes key
* @param string|bytes str
Expand All @@ -322,7 +322,7 @@ def hmac_md2(key, str) {
}

/**
* Returns the HMAC-MD4 cyrptographic hash of the given string or bytes.
* Returns the HMAC-MD4 cryptographic hash of the given string or bytes.
*
* @param string|bytes key
* @param string|bytes str
Expand All @@ -333,7 +333,7 @@ def hmac_md4(key, str) {
}

/**
* Returns the HMAC-MD5 cyrptographic hash of the given string or bytes.
* Returns the HMAC-MD5 cryptographic hash of the given string or bytes.
*
* @param string|bytes key
* @param string|bytes str
Expand All @@ -344,7 +344,7 @@ def hmac_md5(key, str) {
}

/**
* Returns the HMAC-SHA1 cyrptographic hash of the given string or bytes.
* Returns the HMAC-SHA1 cryptographic hash of the given string or bytes.
*
* @param string|bytes key
* @param string|bytes str
Expand All @@ -355,7 +355,7 @@ def hmac_sha1(key, str) {
}

/**
* Returns the HMAC-SHA224 cyrptographic hash of the given string or bytes.
* Returns the HMAC-SHA224 cryptographic hash of the given string or bytes.
*
* @param string|bytes key
* @param string|bytes str
Expand All @@ -366,7 +366,7 @@ def hmac_sha224(key, str) {
}

/**
* Returns the HMAC-SHA256 cyrptographic hash of the given string or bytes.
* Returns the HMAC-SHA256 cryptographic hash of the given string or bytes.
*
* @param string|bytes key
* @param string|bytes str
Expand All @@ -377,7 +377,7 @@ def hmac_sha256(key, str) {
}

/**
* Returns the HMAC-SHA384 cyrptographic hash of the given string or bytes.
* Returns the HMAC-SHA384 cryptographic hash of the given string or bytes.
*
* @param string|bytes key
* @param string|bytes str
Expand All @@ -388,7 +388,7 @@ def hmac_sha384(key, str) {
}

/**
* Returns the HMAC-SHA512 cyrptographic hash of the given string or bytes.
* Returns the HMAC-SHA512 cryptographic hash of the given string or bytes.
*
* @param string|bytes key
* @param string|bytes str
Expand All @@ -399,7 +399,7 @@ def hmac_sha512(key, str) {
}

/**
* Returns the HMAC-WHIRLPOOL cyrptographic hash of the given string or bytes.
* Returns the HMAC-WHIRLPOOL cryptographic hash of the given string or bytes.
*
* @param string|bytes key
* @param string|bytes str
Expand All @@ -410,7 +410,7 @@ def hmac_whirlpool(key, str) {
}

/**
* Returns the HMAC-SNEFRU cyrptographic hash of the given string or bytes.
* Returns the HMAC-SNEFRU cryptographic hash of the given string or bytes.
*
* @param string|bytes key
* @param string|bytes str
Expand All @@ -421,7 +421,7 @@ def hmac_snefru(key, str) {
}

/**
* Returns the HMAC-GOST cyrptographic hash of the given string or bytes.
* Returns the HMAC-GOST cryptographic hash of the given string or bytes.
*
* @param string|bytes key
* @param string|bytes str
Expand Down
2 changes: 1 addition & 1 deletion libs/io.b
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ class TTY {
* Flushes the standard output and standard error interface
*/
flush() {
_io.TTY.flush(self.std);
_io.TTY.flush(self.std)
}
}

Expand Down
2 changes: 1 addition & 1 deletion libs/markdown/ruler.b
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* - enable/disable rules
* - add/replace rules
* - allow assign rules to additional named chains (in the same)
* - cacheing lists of active rules
* - caching lists of active rules
*
* You will not need use this class directly until write plugins. For simple
* rules control use [[markdown.disable]], [[markdown.enable]] and
Expand Down
2 changes: 1 addition & 1 deletion libs/markdown/token.b
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class Token {
var idx = self.attr_index(name)

if idx < 0 {
self.attr_push([ name, value ]);
self.attr_push([ name, value ])
} else {
self.attrs[idx][1] = self.attrs[idx][1] + ' ' + value
}
Expand Down
12 changes: 6 additions & 6 deletions libs/math.b
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @module math
*
* This module contains functions and constants to make trigonometric and
* non-trignonometric mathematics a breeze. The module also defines a couple
* non-trigonometric mathematics a breeze. The module also defines a couple
* of commonly used scientific and mathematical constants such as `PI`.
*
* @copyright 2021, Ore Richard Muyiwa and Blade contributors
Expand Down Expand Up @@ -282,7 +282,7 @@ def atan2(x, y) {
}

/**
* Returns the hyperbolic arcsine (in radians) of number n.
* Returns the hyperbolic arc-sine (in radians) of number n.
*
* Example:
*
Expand All @@ -299,7 +299,7 @@ def asinh(n) {
}

/**
* Returns the hyperbolic arccosine (in radians) of number n.
* Returns the hyperbolic arc-cosine (in radians) of number n.
*
* Example:
*
Expand All @@ -316,7 +316,7 @@ def acosh(n) {
}

/**
* Returns the hyperbolic arctangent (in radians) of number n.
* Returns the hyperbolic arc-tangent (in radians) of number n.
*
* Example:
*
Expand Down Expand Up @@ -473,7 +473,7 @@ def log10(n) {
* If you calculate log(1 + 1.1111111111e-15) you should get an answer
* close to 1.1111111111e-15.
* Instead, you will end up taking the logarithm of 1.00000000000000111022
* (the roundoff is in binary so sometimes it gets ugly), so you get the answer
* (the round-off is in binary so sometimes it gets ugly), so you get the answer
* 1.11022...e-15, with only 3 correct digits.
* If, instead, you calculate log1p(1.1111111111e-15) you will get a much
* more accurate answer 1.1111111110999995e-15 with 15 correct digits of precision
Expand Down Expand Up @@ -649,7 +649,7 @@ def trunc(n) {
}

/**
* Returns the square root of a nunmber.
* Returns the square root of a number.
*
* Example:
*
Expand Down
2 changes: 1 addition & 1 deletion libs/mime.b
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ def detect_from_header(file) {
* Performs mimetype detection on a file.
*
* this method is capable of detecting file mimetypes even
* in the abscence of an extension.
* in the absence of an extension.
*
* If the file is opened in binary mode, it first attempt the more
* accurate header check. If the header check returns a generic result
Expand Down
4 changes: 2 additions & 2 deletions libs/os.b
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def set_env(name, value, overwrite) {
}

/**
* Creates the given directory with the specified permission and optionaly
* Creates the given directory with the specified permission and optionally
* add new files into it if any is given.
*
* @note if the directory already exists, it returns `false` otherwise, it returns `true`.
Expand Down Expand Up @@ -350,7 +350,7 @@ def exit(code) {
}

/**
* Concatenates the given paths together into a format that is valied on the
* Concatenates the given paths together into a format that is valid on the
* current operating system.
*
* Example,
Expand Down
2 changes: 1 addition & 1 deletion libs/reflect.b
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ def run_script(path) {

var content = fh.read()

# for now, returing the call without assigning to a variable is failing.
# for now, returning the call without assigning to a variable is failing.
_reflect.runscript(path, content)
}

Expand Down
6 changes: 3 additions & 3 deletions libs/socket.b
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* ### What's a Socket
*
* Sockets are bidrectional communication medias for information exchange between
* Sockets are bidirectional communication medias for information exchange between
* various processes within the same machine or different machines.
*
* There are three important concepts that must important to know when working with
Expand All @@ -27,7 +27,7 @@
* 3. `Protocol`: This is to identify the variant protocol on which one or more
* network protocols are based on. Typically `0` or any of the `IP_` constants.
*
* A simple socket may be instanciated as follows:
* A simple socket may be instantiated as follows:
*
* ```blade
* import socket { Socket }
Expand Down Expand Up @@ -66,7 +66,7 @@
* ```
*
* The above example simply replies the client with `You sent: ` + whatever the client
* acutally sent.
* actually sent.
*
* Due to resource limitations, its good practice to always ensure to close sockets when
* done with it. Doing this is pretty simple.
Expand Down
2 changes: 1 addition & 1 deletion libs/struct.b
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @module struct
*
* This moddule provides functions for converting between Blade values and C
* This module provides functions for converting between Blade values and C
* structs and vice-versa in the binary format.
*
* @copyright 2022, Ore Richard Muyiwa and Blade contributors
Expand Down
2 changes: 1 addition & 1 deletion libs/template/constants.b
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import os

var DEFUALT_ROOT_DIR = os.join_paths(os.cwd(), 'templates')
var DEFAULT_ROOT_DIR = os.join_paths(os.cwd(), 'templates')

var VAR_RE = '/(?<!%)\{\{\s*(?P<variable>([a-z_][a-z0-9_\-|="\']*(\.[a-z0-9_\-|=]+((["\'])([^\'"]+)\5)?)*))\s*\}\}/i'
var FUNCTION_RE = '/(?<!%)\{\!\s*(?P<fn>[a-z0-9_]+)\s*\!\}/i'
Expand Down
2 changes: 1 addition & 1 deletion libs/template/index.b
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ class Template {
var _elements = {}

# root directory
var _root_dir = constants.DEFUALT_ROOT_DIR
var _root_dir = constants.DEFAULT_ROOT_DIR

# auto_init control
var _auto_init = false
Expand Down
Loading

0 comments on commit f5b4a1d

Please sign in to comment.