diff --git a/notNeededPackages.json b/notNeededPackages.json index 3047c33dfc..2033c37c5f 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -2760,6 +2760,12 @@ "sourceRepoURL": "https://github.com/nock/nock", "asOfVersion": "11.1.0" }, + { + "libraryName": "node-json-db", + "typingsPackageName": "node-json-db", + "sourceRepoURL": "https://github.com/Belphemur/node-json-db", + "asOfVersion": "0.9.2" + }, { "libraryName": "node-cache", "typingsPackageName": "node-cache", diff --git a/types/node-json-db/index.d.ts b/types/node-json-db/index.d.ts deleted file mode 100644 index 9a6dfa6160..0000000000 --- a/types/node-json-db/index.d.ts +++ /dev/null @@ -1,57 +0,0 @@ -// Type definitions for node-json-db -// Project: https://github.com/Belphemur/node-json-db -// Definitions by: Ilya Kuznetsov -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare class JsonDB { - /** - * Create the JSON database - * @param filename where to save the data base - * @param saveOnPush saving on modification of the data - * @param humanReadable is the json file humand readable - * @returns {JsonDB} - * @constructor - */ - constructor(filename: string, saveOnPush?: boolean, humanReadable?: boolean); - - /** - * Get the deta stored in the data base - * @param dataPath path leading to the data - * @returns {*} - */ - getData(dataPath: string): any; - - /** - * Pushing data into the database - * @param dataPath path leading to the data - * @param data data to push - * @param override overriding or not the data, if not, it will merge them - */ - push(dataPath: string, data: any, override?: boolean): void; - - /** - * Delete the data - * @param dataPath path leading to the data - */ - delete(dataPath: string): void; - - /** - * Reload the database from the file - */ - reload(): void; - - /** - * Manually load the database - * It is automatically called when the first getData is done - */ - load(): void; - - /** - * Manually save the database - * By default you can't save the database if it's not loaded - * @param force force the save of the database - */ - save(force?: boolean): void; -} - -export = JsonDB; diff --git a/types/node-json-db/node-json-db-tests.ts b/types/node-json-db/node-json-db-tests.ts deleted file mode 100644 index ac7d3e37e0..0000000000 --- a/types/node-json-db/node-json-db-tests.ts +++ /dev/null @@ -1,75 +0,0 @@ -import JsonDB = require('node-json-db'); - -// The second argument is used to tell the DB to save after each push -// If you put false, you'll have to call the save() method. -// The third argument is to ask JsonDB to save the database in an human readable format. (default false) -let db = new JsonDB("myDataBase", true, false); - -// Pushing the data into the database -// With the wanted DataPath -// By default the push will override the old value -db.push("/test1", "super test"); - -// It also create automatically the hierarchy when pushing new data for a DataPath that doesn't exists -db.push("/test2/my/test", 5); - -// You can also push directly objects -db.push("/test3", { - test: "test", - json: { - test: ["test"] - } -}); - -// If you don't want to override the data but to merge them -// The merge is recursive and work with Object and Array. -db.push("/test3", { - new: "cool", - json: { - important: 5 - } -}, false); -/* -This give you this results : -{ - "test":"test", - "json":{ - "test":[ - "test" - ], - "important":5 - }, - "new":"cool" -} -*/ - -// You can't merge primitive. -// If you do this: -db.push("/test2/my/test/", 10, false); -// the data will be overriden - -// Get the data from the root -var data = db.getData("/"); - -//From a particular DataPath -var data = db.getData("/test1"); - -// If you try to get some data from a DataPath that doesn't exists -// You'll get an Error -try { - var data = db.getData("/test1/test/dont/work"); -} catch(error) { - // The error will tell you where the DataPath stopped. In this case test1 - // Since /test1/test does't exist. - console.error(error); -} - -// Deleting data -db.delete("/test1"); - -// Save the data (useful if you disable the saveOnPush) -db.save(); - -// In case you have a exterior change to the databse file and want to reload it -// use this method -db.reload(); \ No newline at end of file diff --git a/types/node-json-db/tsconfig.json b/types/node-json-db/tsconfig.json deleted file mode 100644 index 1372add5aa..0000000000 --- a/types/node-json-db/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "node-json-db-tests.ts" - ] -} \ No newline at end of file diff --git a/types/node-json-db/tslint.json b/types/node-json-db/tslint.json deleted file mode 100644 index 3d59f55fda..0000000000 --- a/types/node-json-db/tslint.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "npm-naming": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } -}