Commit 651d0c85 authored by Aral Balkan's avatar Aral Balkan
Browse files

Refactor last change to improve clarity and remove log statement

parent 2f338e04
......@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [2.0.4] - 2021-07-30
### Improved
- Minor: Refactored change in last release for clarity (“naming things is hard”). Removed log statement.
## [2.0.3] - 2021-07-30
### Fixed
......
......@@ -159,14 +159,13 @@ export default class JSTable extends EventEmitter {
// one exported in the first line of the table and populate it with
// the initial/compacted data provided for it on that line.
const matchLastNewline = /\n$/
const indexOfFirstNewline = matchLastNewline.exec(table).index
const initialData = table.substr(0, indexOfFirstNewline).replace('export const ', '')
const indexOfLastNewlineOnFirstLine = matchLastNewline.exec(table).index
const initialData = table.substr(0, indexOfLastNewlineOnFirstLine).replace('export const ', '')
let _
log(initialData)
eval(initialData)
// Remove the first line.
table = table.substr(indexOfFirstNewline)
table = table.substr(indexOfLastNewlineOnFirstLine)
// Evaluate the remaining JavaScript operations in the log.
eval(table)
......
{
"name": "@small-tech/jsdb",
"version": "2.0.3",
"version": "2.0.4",
"description": "A zero-dependency, transparent, in-memory, streaming write-on-update JavaScript database for Small Web applications that persists to a JavaScript transaction log.",
"keywords": [
"js",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment