Permalink
Browse files

fixing case sens bug

  • Loading branch information...
1 parent 9a8c202 commit 271e2e7cb7e0c94fe2786b6cf2b3e5231d88afc9 @brianleroux brianleroux committed Nov 30, 2009
Showing with 0 additions and 138 deletions.
  1. +0 −69 src/Lawnchair.js
  2. +0 −69 src/lawnchair.js
View
@@ -1,69 +0,0 @@
-/**
- * Lawnchair
- * =========
- * A lightweight JSON document store.
- *
- */
-var Lawnchair = function(opts) {
- this.init(opts);
-}
-
-Lawnchair.prototype = {
-
- init:function(opts) {
- var adaptors = {
- 'webkit':WebkitSQLiteAdaptor,
- 'gears':GearsSqliteAdaptor
- }
-
- this.adaptor = opts.adaptor ? new adaptors[opts.adaptor](opts) : new WebkitSQLiteAdaptor(opts);
- },
-
- // Save an object to the store. If a key is present then update. Otherwise create a new record.
- save:function(obj, callback) {this.adaptor.save(obj, callback)},
-
- // Invokes a callback on an object with the matching key.
- get:function(key, callback) {this.adaptor.get(key, callback)},
-
- // Returns all rows to a callback.
- all:function(callback) {this.adaptor.all(callback)},
-
- // Removes a json object from the store.
- remove:function(keyOrObj) {this.adaptor.remove(keyOrObj)},
-
- // Removes all documents from a store and returns self.
- nuke:function() {return this.adaptor.nuke()},
-
- /**
- * Iterator that accepts two paramters (methods or eval strings):
- *
- * - conditional test for a record
- * - callback to invoke on matches
- *
- */
- find:function(condition, callback) {
- var is = (typeof condition == 'string') ? function(r){return eval(condition)} : condition;
- var cb = this.adaptor.terseToVerboseCallback(callback);
-
- this.each(function(record, index) {
- if (is(record)) cb(record, index); // thats hot
- });
- },
-
-
- /**
- * Classic iterator.
- * - Passes the record and the index as the second parameter to the callback.
- * - Accepts a string for eval or a method to be invoked for each document in the collection.
- */
- each:function(callback) {
- var cb = this.adaptor.terseToVerboseCallback(callback);
- this.all(function(results) {
- var l = results.length;
- for (var i = 0; i < l; i++) {
- cb(results[i], i)
- }
- });
- }
-// --
-};
View
@@ -1,69 +0,0 @@
-/**
- * Lawnchair
- * =========
- * A lightweight JSON document store.
- *
- */
-var Lawnchair = function(opts) {
- this.init(opts);
-}
-
-Lawnchair.prototype = {
-
- init:function(opts) {
- var adaptors = {
- 'webkit':WebkitSQLiteAdaptor,
- 'gears':GearsSqliteAdaptor
- }
-
- this.adaptor = opts.adaptor ? new adaptors[opts.adaptor](opts) : new WebkitSQLiteAdaptor(opts);
- },
-
- // Save an object to the store. If a key is present then update. Otherwise create a new record.
- save:function(obj, callback) {this.adaptor.save(obj, callback)},
-
- // Invokes a callback on an object with the matching key.
- get:function(key, callback) {this.adaptor.get(key, callback)},
-
- // Returns all rows to a callback.
- all:function(callback) {this.adaptor.all(callback)},
-
- // Removes a json object from the store.
- remove:function(keyOrObj) {this.adaptor.remove(keyOrObj)},
-
- // Removes all documents from a store and returns self.
- nuke:function() {return this.adaptor.nuke()},
-
- /**
- * Iterator that accepts two paramters (methods or eval strings):
- *
- * - conditional test for a record
- * - callback to invoke on matches
- *
- */
- find:function(condition, callback) {
- var is = (typeof condition == 'string') ? function(r){return eval(condition)} : condition;
- var cb = this.adaptor.terseToVerboseCallback(callback);
-
- this.each(function(record, index) {
- if (is(record)) cb(record, index); // thats hot
- });
- },
-
-
- /**
- * Classic iterator.
- * - Passes the record and the index as the second parameter to the callback.
- * - Accepts a string for eval or a method to be invoked for each document in the collection.
- */
- each:function(callback) {
- var cb = this.adaptor.terseToVerboseCallback(callback);
- this.all(function(results) {
- var l = results.length;
- for (var i = 0; i < l; i++) {
- cb(results[i], i)
- }
- });
- }
-// --
-};

0 comments on commit 271e2e7

Please sign in to comment.