wip
This commit is contained in:
11
node_modules/.package-lock.json
generated
vendored
11
node_modules/.package-lock.json
generated
vendored
@@ -1,13 +1,6 @@
|
||||
{
|
||||
"name": "mvp-django-react",
|
||||
"name": "cash-stacks",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"node_modules/@dank-inc/data-buddy": {
|
||||
"version": "0.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@dank-inc/data-buddy/-/data-buddy-0.1.3.tgz",
|
||||
"integrity": "sha512-GreH0gs1Wf/8thCt53FrzX0ngMuIhrTBZJWa6tlqLIST4EgKgJN6IPei1o7bOqKPFmLIMS/DG6o1b/QAC57oXw==",
|
||||
"license": "MIT"
|
||||
}
|
||||
}
|
||||
"packages": {}
|
||||
}
|
||||
|
7
node_modules/@dank-inc/data-buddy/README.md
generated
vendored
7
node_modules/@dank-inc/data-buddy/README.md
generated
vendored
@@ -1,7 +0,0 @@
|
||||
# Data Buddy
|
||||
|
||||
Need a little mock data thingy?
|
||||
|
||||
# Look no further!
|
||||
|
||||
I will document this someday
|
13
node_modules/@dank-inc/data-buddy/lib/index.d.ts
generated
vendored
13
node_modules/@dank-inc/data-buddy/lib/index.d.ts
generated
vendored
@@ -1,13 +0,0 @@
|
||||
declare type DataRecord = {
|
||||
id: string;
|
||||
};
|
||||
export declare type DataBuddyParams<T extends DataRecord> = T[];
|
||||
export declare class DataBuddy<T extends DataRecord> {
|
||||
data: T[];
|
||||
constructor(records: T[]);
|
||||
get: () => T[];
|
||||
getOne: (id: string) => T | null;
|
||||
update: (id: string, params: Partial<T>) => T | false;
|
||||
delete: (id: string) => boolean;
|
||||
}
|
||||
export {};
|
43
node_modules/@dank-inc/data-buddy/lib/index.js
generated
vendored
43
node_modules/@dank-inc/data-buddy/lib/index.js
generated
vendored
@@ -1,43 +0,0 @@
|
||||
"use strict";
|
||||
var __assign = (this && this.__assign) || function () {
|
||||
__assign = Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.DataBuddy = void 0;
|
||||
var DataBuddy = (function () {
|
||||
function DataBuddy(records) {
|
||||
var _this = this;
|
||||
this.get = function () {
|
||||
return _this.data;
|
||||
};
|
||||
this.getOne = function (id) {
|
||||
return _this.data.find(function (record) { return record.id === id; }) || null;
|
||||
};
|
||||
this.update = function (id, params) {
|
||||
var index = _this.data.findIndex(function (record) { return record.id === id; });
|
||||
if (!index)
|
||||
return false;
|
||||
var record = _this.data[index];
|
||||
_this.data[index] = __assign(__assign({}, record), params);
|
||||
return _this.data[index];
|
||||
};
|
||||
this.delete = function (id) {
|
||||
var index = _this.data.findIndex(function (record) { return record.id === id; });
|
||||
if (!index)
|
||||
return false;
|
||||
_this.data.splice(index, 1);
|
||||
return true;
|
||||
};
|
||||
this.data = records;
|
||||
}
|
||||
return DataBuddy;
|
||||
}());
|
||||
exports.DataBuddy = DataBuddy;
|
24
node_modules/@dank-inc/data-buddy/package.json
generated
vendored
24
node_modules/@dank-inc/data-buddy/package.json
generated
vendored
@@ -1,24 +0,0 @@
|
||||
{
|
||||
"name": "@dank-inc/data-buddy",
|
||||
"version": "0.1.3",
|
||||
"author": "Elijah Lucian",
|
||||
"license": "MIT",
|
||||
"description": "Need a little mock api data state buddy?",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/dank-inc/data-buddy"
|
||||
},
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"lint": "tsc --noEmit",
|
||||
"compile": "rm -rf lib && tsc",
|
||||
"deploy": "npm run compile && npm publish",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^4.2.4"
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user