mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 07:14:47 -05:00
chore: fixed various misspellings and other typos (#8691)
This commit is contained in:
parent
fd9b0202c1
commit
b8bc24d167
27 changed files with 67 additions and 67 deletions
14
Releases.md
14
Releases.md
|
@ -408,7 +408,7 @@ Changes in std version 0.69.0:
|
|||
- fix: Don't expose globalThis.__bootstrap (#7344)
|
||||
- fix: Handle bad redirects more gracefully (#7342)
|
||||
- fix: Handling of + character in URLSearchParams (#7314)
|
||||
- fix: Regex for TS refereces and deno-types (#7333)
|
||||
- fix: Regex for TS references and deno-types (#7333)
|
||||
- fix: Set maximum size of thread pool to 31 (#7290)
|
||||
- fix: Support missing features in --no-check (#7289)
|
||||
- fix: Use millisecond precision for Deno.futime and Deno.utime (#7299)
|
||||
|
@ -629,7 +629,7 @@ Changes in std version 0.61.0:
|
|||
- fix(std/http): Properly return port 80 in \_parseAddrFromStr (#6635)
|
||||
- fix(std/mime): Boundary random hex values (#6646)
|
||||
- fix(std/node): Add encoding argument to Buffer.byteLength (#6639)
|
||||
- fix(std/tesing/asserts): AssertEquals/NotEquals should use milliseconds in
|
||||
- fix(std/testing/asserts): AssertEquals/NotEquals should use milliseconds in
|
||||
Date (#6644)
|
||||
- fix(std/wasi): Return errno::success from fd_tell (#6636)
|
||||
|
||||
|
@ -1128,7 +1128,7 @@ Read more about this release at https://deno.land/v1
|
|||
### v0.41.0 / 2020.04.16
|
||||
|
||||
- BREAKING: Improve readdir() and FileInfo interfaces (#4763)
|
||||
- BREAKING: Remove depracated APIs for mkdir and mkdirSync (#4615)
|
||||
- BREAKING: Remove deprecated APIs for mkdir and mkdirSync (#4615)
|
||||
- BREAKING: Make fetch API more web compatible (#4687)
|
||||
- BREAKING: Remove std/testing/format.ts (#4749)
|
||||
- BREAKING: Migrate std/types to deno.land/x/types/ (#4713, #4771)
|
||||
|
@ -1282,7 +1282,7 @@ Read more about this release at https://deno.land/v1
|
|||
- feat: Add Deno.umask (#4290)
|
||||
- feat: Add global --quiet flag (#4135)
|
||||
- feat: Improvements to std/flags. (#4279)
|
||||
- feat: Make internel error frames dimmer (#4201)
|
||||
- feat: Make internal error frames dimmer (#4201)
|
||||
- feat: Support async function and EventListenerObject as listeners (#4240)
|
||||
- feat: add actual error class to fail message (#4305)
|
||||
- feat: seek should return cursor position (#4211)
|
||||
|
@ -1310,7 +1310,7 @@ Read more about this release at https://deno.land/v1
|
|||
- refactor: Rename Option -> Options (#4226)
|
||||
- refactor: cleanup compiler runtimes (#4230)
|
||||
- refactor: preliminary cleanup of Deno.runTests() (#4237)
|
||||
- refactor: reduce unnecesarry output in cli/js tests (#4182)
|
||||
- refactor: reduce unnecessary output in cli/js tests (#4182)
|
||||
- refactor: reorganize cli/js (#4317, #4316, #4310, #4250, #4302, #4283, #4264)
|
||||
- refactor: rewrite testPerm into unitTest (#4231)
|
||||
- refactor: uncomment tests broken tests, use skip (#4311)
|
||||
|
@ -1605,7 +1605,7 @@ Read more about this release at https://deno.land/v1
|
|||
- feat: Add ResourceTable in core (#3150)
|
||||
- feat: Re-enable standard stream support for fetch bodies (#3192)
|
||||
- feat: Add CustomInspect for Headers (#3130)
|
||||
- fix: Cherry-pick depot_tools 6a1d778 to fix macOS Cataliona issues (#3175)
|
||||
- fix: Cherry-pick depot_tools 6a1d778 to fix macOS Catalina issues (#3175)
|
||||
- fix: Remove runtime panics in op dispatch (#3176, #3202, #3131)
|
||||
- fix: BufReader.readString to actually return Deno.EOF at end (#3191)
|
||||
- perf: faster TextDecoder (#3180, #3204)
|
||||
|
@ -1986,7 +1986,7 @@ In deno:
|
|||
In deno_std
|
||||
|
||||
- Clean up HTTP async iterator code (denoland/deno_std#411)
|
||||
- fix: add exnext lib to tsconfig.json (denoland/deno_std#416)
|
||||
- fix: add esnext lib to tsconfig.json (denoland/deno_std#416)
|
||||
- feat(fs): add copy/copySync (denoland/deno_std#278)
|
||||
- feat: add Tar and Untar classes (denoland/deno_std#388)
|
||||
- ws: make acceptable() more robust (denoland/deno_std#404)
|
||||
|
|
2
cli/dts/README.md
vendored
2
cli/dts/README.md
vendored
|
@ -4,7 +4,7 @@ The files in this directory are mostly from the TypeScript repository. We
|
|||
currently (unfortunately) have a rather manual process for upgrading TypeScript.
|
||||
It works like this currently:
|
||||
|
||||
1. Checkout typescript repo in a seperate directory.
|
||||
1. Checkout typescript repo in a separate directory.
|
||||
2. Copy typescript.js into Deno repo.
|
||||
3. Copy d.ts files into dts directory.
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ public class DenoWinRunner
|
|||
/// </summary>
|
||||
/// <param name="pathToDenoExe">Path to the Deno.exe file. Can be absolute or relative</param>
|
||||
/// <param name="pathToTestScript">Path to the script file Deno should run.</param>
|
||||
/// <param name="constraints">The contrainsts to apply to the Deno process</param>
|
||||
/// <param name="constraints">The constraints to apply to the Deno process</param>
|
||||
/// <param name="timeoutMilliseconds">How long to wait for the Deno process to exit</param>
|
||||
/// <returns>The deno.exe exit code, or an exit code provided by the test runner</returns>
|
||||
public static int RunDenoScript(string pathToDenoExe, string pathToTestScript, DenoConstraints constraints, uint timeoutMilliseconds = 1000)
|
||||
|
@ -66,7 +66,7 @@ public class DenoWinRunner
|
|||
{
|
||||
SetStdHandle(STD_INPUT_HANDLE, (IntPtr)null);
|
||||
}
|
||||
|
||||
|
||||
if (constraints.HasFlag(DenoConstraints.NoStdout))
|
||||
{
|
||||
SetStdHandle(STD_OUTPUT_HANDLE, (IntPtr)null);
|
||||
|
@ -76,13 +76,13 @@ public class DenoWinRunner
|
|||
{
|
||||
SetStdHandle(STD_ERROR_HANDLE, (IntPtr)null);
|
||||
}
|
||||
|
||||
|
||||
Process process = new Process { StartInfo = startInfo };
|
||||
process.Start();
|
||||
|
||||
Task<string> stdErrTask = startInfo.RedirectStandardError ?
|
||||
Task<string> stdErrTask = startInfo.RedirectStandardError ?
|
||||
process.StandardError.ReadToEndAsync() : Task.FromResult<string>(null);
|
||||
Task<string> stdOutTask = startInfo.RedirectStandardOutput ?
|
||||
Task<string> stdOutTask = startInfo.RedirectStandardOutput ?
|
||||
process.StandardOutput.ReadToEndAsync() : Task.FromResult<string>(null);
|
||||
|
||||
if (!process.WaitForExit((int)timeoutMilliseconds))
|
||||
|
@ -124,4 +124,4 @@ public class DenoWinRunner
|
|||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ const listener = Deno.listen({ hostname, port: Number(port) });
|
|||
console.log("listening on", addr);
|
||||
listener.accept().then(
|
||||
async (conn): Promise<void> => {
|
||||
console.log("recieved bytes:", await Deno.copy(conn, conn));
|
||||
console.log("received bytes:", await Deno.copy(conn, conn));
|
||||
conn.close();
|
||||
listener.close();
|
||||
},
|
||||
|
|
|
@ -43,5 +43,5 @@ For testing purposes we need following files:
|
|||
- `RootCA.crt`
|
||||
- `RootCA.key`
|
||||
- `RootCA.pem`
|
||||
- `locahost.crt`
|
||||
- `locahost.key`
|
||||
- `localhost.crt`
|
||||
- `localhost.key`
|
||||
|
|
|
@ -34,6 +34,6 @@ path = "examples/http_bench_bin_ops.rs"
|
|||
name = "http_bench_json_ops"
|
||||
path = "examples/http_bench_json_ops.rs"
|
||||
|
||||
# These dependendencies are only used for the 'http_bench_*_ops' examples.
|
||||
# These dependencies are only used for the 'http_bench_*_ops' examples.
|
||||
[dev-dependencies]
|
||||
tokio = { version = "0.3.5", features = ["full"] }
|
||||
|
|
|
@ -22,7 +22,7 @@ canary release by running:
|
|||
deno upgrade --canary
|
||||
```
|
||||
|
||||
To update to a specifc canary, pass the commit has in the `--version` option:
|
||||
To update to a specific canary, pass the commit has in the `--version` option:
|
||||
|
||||
```
|
||||
deno upgrade --canary --version=973af61d8bb03c1709f61e456581d58386ed4952
|
||||
|
|
|
@ -283,7 +283,7 @@ comment. If it needs further comments it is not a good example.
|
|||
|
||||
Currently, the building process uses `dlint` to validate linting problems in the
|
||||
code. If the task requires code that is non-conformant to linter use
|
||||
`deno-lint-ignore <code>` directive to supress the warning.
|
||||
`deno-lint-ignore <code>` directive to suppress the warning.
|
||||
|
||||
```typescript
|
||||
// deno-lint-ignore no-explicit-any
|
||||
|
@ -349,7 +349,7 @@ export function foo(): string {
|
|||
programs can rely on. We want to guarantee to users that this code does not
|
||||
include potentially unreviewed third party code.
|
||||
|
||||
#### Document and maintain browser compatiblity.
|
||||
#### Document and maintain browser compatibility.
|
||||
|
||||
If a module is browser compatible, include the following in the JSDoc at the top
|
||||
of the module:
|
||||
|
|
|
@ -63,7 +63,7 @@ from a locally stored arithmetic module. The same functionality can be created
|
|||
by importing `add` and `multiply` methods from a remote module too.
|
||||
|
||||
In this case the Ramda module is referenced, including the version number. Also
|
||||
note a JavaScript module is imported directly into a TypeSript module, Deno has
|
||||
note a JavaScript module is imported directly into a TypeScript module, Deno has
|
||||
no problem handling this.
|
||||
|
||||
**Command:** `deno run ./remote.ts`
|
||||
|
@ -115,6 +115,6 @@ export function multiply(a: number, b: number): number {
|
|||
```
|
||||
|
||||
All functions, classes, constants and variables which need to be accessible
|
||||
inside external modules must be exported. Either by prepending them with the
|
||||
inside external modules must be exported. Either by pretending them with the
|
||||
`export` keyword or including them in an export statement at the bottom of the
|
||||
file.
|
||||
|
|
|
@ -11,7 +11,7 @@ the `type: "module"` option when creating a new worker.
|
|||
|
||||
Relative module specifiers are
|
||||
[not supported](https://github.com/denoland/deno/issues/5216) at the moment. You
|
||||
can instead use the `URL` contructor and `import.meta.url` to easily create a
|
||||
can instead use the `URL` constructor and `import.meta.url` to easily create a
|
||||
specifier for some nearby script.
|
||||
|
||||
```ts
|
||||
|
|
|
@ -106,7 +106,7 @@ function foo(): any {
|
|||
}
|
||||
```
|
||||
|
||||
Ignore directive must be placed before first stament or declaration:
|
||||
Ignore directive must be placed before first statement or declaration:
|
||||
|
||||
```ts
|
||||
// Copyright 2020 the Deno authors. All rights reserved. MIT license.
|
||||
|
|
|
@ -2482,7 +2482,7 @@
|
|||
try {
|
||||
transformStreamDefaultControllerEnqueue(
|
||||
controller,
|
||||
// it defaults to no tranformation, so I is assumed to be O
|
||||
// it defaults to no transformation, so I is assumed to be O
|
||||
chunk,
|
||||
);
|
||||
} catch (e) {
|
||||
|
|
|
@ -237,10 +237,10 @@
|
|||
|
||||
set(name, value) {
|
||||
requiredArguments("Headers.set", arguments.length, 2);
|
||||
const [newname, newvalue] = normalizeParams(name, value);
|
||||
validateName(newname);
|
||||
validateValue(newvalue);
|
||||
dataSet(this[headersData], newname, newvalue);
|
||||
const [newName, newValue] = normalizeParams(name, value);
|
||||
validateName(newName);
|
||||
validateValue(newValue);
|
||||
dataSet(this[headersData], newName, newValue);
|
||||
}
|
||||
|
||||
get [Symbol.toStringTag]() {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
((window) => {
|
||||
const { EventTarget } = window;
|
||||
|
||||
const illegalConstructorKey = Symbol("illegalConstuctorKey");
|
||||
const illegalConstructorKey = Symbol("illegalConstructorKey");
|
||||
|
||||
class Window extends EventTarget {
|
||||
constructor(key = null) {
|
||||
|
|
|
@ -84,13 +84,13 @@ export function weekOfYear(date: Date): number {
|
|||
}
|
||||
|
||||
/**
|
||||
* Parse a date to return a IMF formated string date
|
||||
* Parse a date to return a IMF formatted string date
|
||||
* RFC: https://tools.ietf.org/html/rfc7231#section-7.1.1.1
|
||||
* IMF is the time format to use when generating times in HTTP
|
||||
* headers. The time being formatted must be in UTC for Format to
|
||||
* generate the correct format.
|
||||
* @param date Date to parse
|
||||
* @return IMF date formated string
|
||||
* @return IMF date formatted string
|
||||
*/
|
||||
export function toIMF(date: Date): string {
|
||||
function dtPad(v: string, lPad = 2): string {
|
||||
|
@ -233,16 +233,16 @@ function calculateMonthsDifference(bigger: number, smaller: number): number {
|
|||
const smallerDate = new Date(smaller);
|
||||
const yearsDiff = biggerDate.getFullYear() - smallerDate.getFullYear();
|
||||
const monthsDiff = biggerDate.getMonth() - smallerDate.getMonth();
|
||||
const calendarDiffrences = Math.abs(yearsDiff * 12 + monthsDiff);
|
||||
const calendarDifferences = Math.abs(yearsDiff * 12 + monthsDiff);
|
||||
const compareResult = biggerDate > smallerDate ? 1 : -1;
|
||||
biggerDate.setMonth(
|
||||
biggerDate.getMonth() - compareResult * calendarDiffrences,
|
||||
biggerDate.getMonth() - compareResult * calendarDifferences,
|
||||
);
|
||||
const isLastMonthNotFull = biggerDate > smallerDate
|
||||
? 1
|
||||
: -1 === -compareResult
|
||||
? 1
|
||||
: 0;
|
||||
const months = compareResult * (calendarDiffrences - isLastMonthNotFull);
|
||||
const months = compareResult * (calendarDifferences - isLastMonthNotFull);
|
||||
return months === 0 ? 0 : months;
|
||||
}
|
||||
|
|
|
@ -357,8 +357,8 @@ Deno.test({
|
|||
name: "[std/datetime] difference",
|
||||
fn(): void {
|
||||
const denoInit = new Date("2018/5/14");
|
||||
const denoRelaseV1 = new Date("2020/5/13");
|
||||
let difference = datetime.difference(denoRelaseV1, denoInit, {
|
||||
const denoReleaseV1 = new Date("2020/5/13");
|
||||
let difference = datetime.difference(denoReleaseV1, denoInit, {
|
||||
units: ["days", "months", "years"],
|
||||
});
|
||||
assertEquals(difference.days, 730);
|
||||
|
|
|
@ -187,7 +187,7 @@ function is as follows:
|
|||
| :--: | :--------: | :--------: |
|
||||
| Deno | rust | typescript |
|
||||
|
||||
- **`options`** are options for the delimiter-seprated output.
|
||||
- **`options`** are options for the delimiter-separated output.
|
||||
|
||||
- **`headers?: boolean`**: Whether or not to include the row of headers.
|
||||
Default: `true`
|
||||
|
@ -538,18 +538,18 @@ console.log(encode(binaryData));
|
|||
// => LpTqp
|
||||
```
|
||||
|
||||
### Specifying a standard and delimeter
|
||||
### Specifying a standard and delimiter
|
||||
|
||||
By default all functions are using the most popular Adobe version of ascii85 and
|
||||
not adding any delimeter. However, there are three more standards supported -
|
||||
btoa (different delimeter and additional compression of 4 bytes equal to 32),
|
||||
not adding any delimiter. However, there are three more standards supported -
|
||||
btoa (different delimiter and additional compression of 4 bytes equal to 32),
|
||||
[Z85](https://rfc.zeromq.org/spec/32/) and
|
||||
[RFC 1924](https://tools.ietf.org/html/rfc1924). It's possible to use a
|
||||
different encoding by specifying it in `options` object as a second parameter.
|
||||
|
||||
Similarly, it's possible to make `encode` add a delimeter (`<~` and `~>` for
|
||||
Adobe, `xbtoa Begin` and `xbtoa End` with newlines between the delimeters and
|
||||
encoded data for btoa. Checksums for btoa are not supported. Delimeters are not
|
||||
Similarly, it's possible to make `encode` add a delimiter (`<~` and `~>` for
|
||||
Adobe, `xbtoa Begin` and `xbtoa End` with newlines between the delimiters and
|
||||
encoded data for btoa. Checksums for btoa are not supported. Delimiters are not
|
||||
supported by other encodings.)
|
||||
|
||||
encoding examples:
|
||||
|
@ -562,9 +562,9 @@ import {
|
|||
const binaryData = new Uint8Array([136, 180, 79, 24]);
|
||||
console.log(encode(binaryData));
|
||||
// => LpTqp
|
||||
console.log(encode(binaryData, { standard: "Adobe", delimeter: true }));
|
||||
console.log(encode(binaryData, { standard: "Adobe", delimiter: true }));
|
||||
// => <~LpTqp~>
|
||||
console.log(encode(binaryData, { standard: "btoa", delimeter: true }));
|
||||
console.log(encode(binaryData, { standard: "btoa", delimiter: true }));
|
||||
/* => xbtoa Begin
|
||||
LpTqp
|
||||
xbtoa End */
|
||||
|
|
|
@ -23,5 +23,5 @@ const string = stringify(test);
|
|||
if (Deno.inspect(test) === Deno.inspect(parse(string))) {
|
||||
console.log("In-Out as expected.");
|
||||
} else {
|
||||
console.log("Someting went wrong.");
|
||||
console.log("Something went wrong.");
|
||||
}
|
||||
|
|
|
@ -942,7 +942,7 @@ function readBlockScalar(state: LoaderState, nodeIndent: number): boolean {
|
|||
}
|
||||
}
|
||||
|
||||
// Break this `while` cycle and go to the funciton's epilogue.
|
||||
// Break this `while` cycle and go to the function's epilogue.
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ function representYamlFloat(object: Any, style?: StyleVariant): Any {
|
|||
const res = object.toString(10);
|
||||
|
||||
// JS stringifier can build scientific format without dots: 5e-100,
|
||||
// while YAML requres dot: 5.e-100. Fix it with simple hack
|
||||
// while YAML requires dot: 5.e-100. Fix it with simple hack
|
||||
|
||||
return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace("e", ".e") : res;
|
||||
}
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
export type Ascii85Standard = "Adobe" | "btoa" | "RFC 1924" | "Z85";
|
||||
/**
|
||||
* encoding/decoding options
|
||||
* @property standard - characterset and delimeter (if supported and used). Defaults to Adobe
|
||||
* @property delimeter - whether to use a delimeter (if supported) - "<~" and "~>" by default
|
||||
* @property standard - characterset and delimiter (if supported and used). Defaults to Adobe
|
||||
* @property delimiter - whether to use a delimiter (if supported) - "<~" and "~>" by default
|
||||
*/
|
||||
export interface Ascii85Options {
|
||||
standard?: Ascii85Standard;
|
||||
|
@ -20,7 +20,7 @@ const Z85 =
|
|||
* @param uint8 input to encode
|
||||
* @param [options] encoding options
|
||||
* @param [options.standard=Adobe] encoding standard (Adobe, btoa, RFC 1924 or Z85)
|
||||
* @param [options.delimeter] whether to use a delimeter, if supported by encoding standard
|
||||
* @param [options.delimiter] whether to use a delimiter, if supported by encoding standard
|
||||
*/
|
||||
export function encode(uint8: Uint8Array, options?: Ascii85Options): string {
|
||||
const standard = options?.standard ?? "Adobe";
|
||||
|
|
|
@ -3,7 +3,7 @@ import { assertEquals } from "../testing/asserts.ts";
|
|||
import { Ascii85Standard, decode, encode } from "./ascii85.ts";
|
||||
type TestCases = Partial<{ [index in Ascii85Standard]: string[][] }>;
|
||||
const utf8encoder = new TextEncoder();
|
||||
const testCasesNoDelimeter: TestCases = {
|
||||
const testCasesNoDelimiter: TestCases = {
|
||||
Adobe: [
|
||||
["test", "FCfN8"],
|
||||
["ascii85", "@<5pmBfIs"],
|
||||
|
@ -76,7 +76,7 @@ const testCasesNoDelimeter: TestCases = {
|
|||
[" ", "arR^H"],
|
||||
],
|
||||
};
|
||||
const testCasesDelimeter: TestCases = {
|
||||
const testCasesDelimiter: TestCases = {
|
||||
Adobe: [
|
||||
["test", "<~FCfN8~>"],
|
||||
["ascii85", "<~@<5pmBfIs~>"],
|
||||
|
@ -116,7 +116,7 @@ const testCasesDelimeter: TestCases = {
|
|||
],
|
||||
};
|
||||
|
||||
for (const [standard, tests] of Object.entries(testCasesNoDelimeter)) {
|
||||
for (const [standard, tests] of Object.entries(testCasesNoDelimiter)) {
|
||||
if (tests === undefined) continue;
|
||||
Deno.test({
|
||||
name: `[encoding/ascii85] encode ${standard}`,
|
||||
|
@ -144,10 +144,10 @@ for (const [standard, tests] of Object.entries(testCasesNoDelimeter)) {
|
|||
},
|
||||
});
|
||||
}
|
||||
for (const [standard, tests] of Object.entries(testCasesDelimeter)) {
|
||||
for (const [standard, tests] of Object.entries(testCasesDelimiter)) {
|
||||
if (tests === undefined) continue;
|
||||
Deno.test({
|
||||
name: `[encoding/ascii85] encode ${standard} with delimeter`,
|
||||
name: `[encoding/ascii85] encode ${standard} with delimiter`,
|
||||
fn(): void {
|
||||
for (const [bin, b85] of tests) {
|
||||
assertEquals(
|
||||
|
@ -162,7 +162,7 @@ for (const [standard, tests] of Object.entries(testCasesDelimeter)) {
|
|||
});
|
||||
|
||||
Deno.test({
|
||||
name: `[encoding/ascii85] decode ${standard} with delimeter`,
|
||||
name: `[encoding/ascii85] decode ${standard} with delimiter`,
|
||||
fn(): void {
|
||||
for (const [bin, b85] of tests) {
|
||||
assertEquals(
|
||||
|
|
|
@ -193,7 +193,7 @@ export function putVarbig(
|
|||
return sizeof(o.dataType);
|
||||
}
|
||||
|
||||
/** Decodes a number from `r`, comsuming `sizeof(o.dataType)` bytes. If less than `sizeof(o.dataType)` bytes were read, throws `Deno.errors.unexpectedEof`.
|
||||
/** Decodes a number from `r`, consuming `sizeof(o.dataType)` bytes. If less than `sizeof(o.dataType)` bytes were read, throws `Deno.errors.unexpectedEof`.
|
||||
*
|
||||
* `o.dataType` defaults to `"int32"`. */
|
||||
export async function readVarnum(
|
||||
|
@ -205,7 +205,7 @@ export async function readVarnum(
|
|||
return varnum(scratch, o) as number;
|
||||
}
|
||||
|
||||
/** Decodes a bigint from `r`, comsuming `sizeof(o.dataType)` bytes. If less than `sizeof(o.dataType)` bytes were read, throws `Deno.errors.unexpectedEof`.
|
||||
/** Decodes a bigint from `r`, consuming `sizeof(o.dataType)` bytes. If less than `sizeof(o.dataType)` bytes were read, throws `Deno.errors.unexpectedEof`.
|
||||
*
|
||||
* `o.dataType` defaults to `"int64"`. */
|
||||
export async function readVarbig(
|
||||
|
|
|
@ -17,7 +17,7 @@ function getEscapedString(value: unknown, sep: string): string {
|
|||
if (typeof value === "object") str = JSON.stringify(value);
|
||||
else str = String(value);
|
||||
|
||||
// Is regex.test more performant here? If so, how to dynamically create?
|
||||
// Is regex.test more performance here? If so, how to dynamically create?
|
||||
// https://stackoverflow.com/questions/3561493/
|
||||
if (str.includes(sep) || str.includes(NEWLINE) || str.includes(QUOTE)) {
|
||||
return `${QUOTE}${str.replaceAll(QUOTE, `${QUOTE}${QUOTE}`)}${QUOTE}`;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
// license that can be found in the LICENSE file.
|
||||
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
||||
|
||||
const hextable = new TextEncoder().encode("0123456789abcdef");
|
||||
const hexTable = new TextEncoder().encode("0123456789abcdef");
|
||||
|
||||
/**
|
||||
* ErrInvalidByte takes an invalid byte and returns an Error.
|
||||
|
@ -52,8 +52,8 @@ export function encode(src: Uint8Array): Uint8Array {
|
|||
const dst = new Uint8Array(encodedLen(src.length));
|
||||
for (let i = 0; i < dst.length; i++) {
|
||||
const v = src[i];
|
||||
dst[i * 2] = hextable[v >> 4];
|
||||
dst[i * 2 + 1] = hextable[v & 0x0f];
|
||||
dst[i * 2] = hexTable[v >> 4];
|
||||
dst[i * 2 + 1] = hexTable[v & 0x0f];
|
||||
}
|
||||
return dst;
|
||||
}
|
||||
|
|
|
@ -679,7 +679,7 @@ class Dumper {
|
|||
const min = dtPad(value.getUTCMinutes().toString());
|
||||
const s = dtPad(value.getUTCSeconds().toString());
|
||||
const ms = dtPad(value.getUTCMilliseconds().toString(), 3);
|
||||
// formated date
|
||||
// formatted date
|
||||
const fData = `${value.getUTCFullYear()}-${m}-${d}T${h}:${min}:${s}.${ms}`;
|
||||
return `${this._declaration(keys)}${fData}`;
|
||||
}
|
||||
|
|
|
@ -258,7 +258,7 @@ class Readable extends Stream {
|
|||
|
||||
//TODO(Soremwar)
|
||||
//Part of doEnd condition
|
||||
//In node, output/inout are a duplex Stream
|
||||
//In node, output/input are a duplex Stream
|
||||
// &&
|
||||
// dest !== stdout &&
|
||||
// dest !== stderr
|
||||
|
|
Loading…
Reference in a new issue