CarrollCloud / js-value-wrappers (public) (License: GPLv3) (since 2018-06-24) (hash sha1)
Wrappers are classes that contain a specific value, and have methods to work on said value.
Example: Dimension to store length values, contains methods to convert and display the dimension in various ways.
List of commits:
Subject Hash Author Date (UTC)
Updated to es2017 for output and es2015 modules. 0da36b29ab4a0c98291c041a43ba968a4c7626e6 Carroll 2018-06-30 20:14:54
Index is simply for the npm entrypoint. 0028d75bb694d64078f0208160944b09870db975 Carroll 2018-06-24 02:12:00
DimWrapper is to hold a dimension. 46e9f9f9123b270f2ce4d3cc84d73f55c4cdf8ba Carroll 2018-06-24 02:11:47
NumericWrapper is to hold a number. Go figure. 2daf55f2e94126859ed26bdc9cb9e4e3f33541eb Carroll 2018-06-24 02:05:19
Wrapper is the base class for this package. 552caf51d2c7e4400dafe788e632972cd860b97e Carroll 2018-06-24 02:03:47
Uploading metadata 6ec5ca0bf2000ad865e4f64ddc26e2e64a0d6a99 Carroll 2018-06-24 02:02:09
Commit 0da36b29ab4a0c98291c041a43ba968a4c7626e6 - Updated to es2017 for output and es2015 modules.
Author: Carroll
Author date (UTC): 2018-06-30 20:14
Committer name: Carroll
Committer date (UTC): 2018-06-30 20:14
Parent(s): 0028d75bb694d64078f0208160944b09870db975
Signing key:
Tree: 172927b581831b81a5c18a74389d9cfdd721a399
File Lines added Lines deleted
lib/index.d.ts 3 4
lib/index.js 4 9
lib/wrappers/DimWrapper.js 2 5
lib/wrappers/NumericWrapper.js 3 7
lib/wrappers/Wrapper.js 1 4
src/index.ts 4 7
tsconfig.json 2 2
File lib/index.d.ts changed (mode: 100644) (index 78ca4f1..4f531e5)
1 import { Wrapper } from "./wrappers/Wrapper";
2 import { NumericWrapper } from "./wrappers/NumericWrapper";
3 import { DimWrapper } from "./wrappers/DimWrapper";
4 export { Wrapper, NumericWrapper, DimWrapper };
1 export { Wrapper } from "./wrappers/Wrapper";
2 export { NumericWrapper } from "./wrappers/NumericWrapper";
3 export { DimWrapper } from "./wrappers/DimWrapper";
File lib/index.js changed (mode: 100644) (index b8bc07c..23f40c6)
1 "use strict";
2 Object.defineProperty(exports, "__esModule", { value: true });
3 /* Import everything we want to export */
4 const Wrapper_1 = require("./wrappers/Wrapper");
5 exports.Wrapper = Wrapper_1.Wrapper;
6 const NumericWrapper_1 = require("./wrappers/NumericWrapper");
7 exports.NumericWrapper = NumericWrapper_1.NumericWrapper;
8 const DimWrapper_1 = require("./wrappers/DimWrapper");
9 exports.DimWrapper = DimWrapper_1.DimWrapper;
1 /* Export all front-facing classes */
2 export { Wrapper } from "./wrappers/Wrapper";
3 export { NumericWrapper } from "./wrappers/NumericWrapper";
4 export { DimWrapper } from "./wrappers/DimWrapper";
File lib/wrappers/DimWrapper.js changed (mode: 100644) (index 41fc976..9b7a2c7)
1 "use strict";
2 Object.defineProperty(exports, "__esModule", { value: true });
3 const NumericWrapper_1 = require("./NumericWrapper");
1 import { NumericWrapper } from "./NumericWrapper";
4 2 /** /**
5 3 * Stores a dimension value and provides various methods for operating on it. * Stores a dimension value and provides various methods for operating on it.
6 4 * The value is stored in meters to keep the system consistent. * The value is stored in meters to keep the system consistent.
7 5 * There are various outputs for this dimension. * There are various outputs for this dimension.
8 6 */ */
9 class DimWrapper extends NumericWrapper_1.NumericWrapper {
7 export class DimWrapper extends NumericWrapper {
10 8 /** Creates a new instance of wrapper with the given value */ /** Creates a new instance of wrapper with the given value */
11 9 constructor(value, unit) { constructor(value, unit) {
12 10 //Convert the value to meters //Convert the value to meters
 
... ... class DimWrapper extends NumericWrapper_1.NumericWrapper {
113 111 DimWrapper.inchInMeter = 39.37008; DimWrapper.inchInMeter = 39.37008;
114 112 /** Number of feet in a meter */ /** Number of feet in a meter */
115 113 DimWrapper.footInMeter = 3.28084; DimWrapper.footInMeter = 3.28084;
116 exports.DimWrapper = DimWrapper;
File lib/wrappers/NumericWrapper.js changed (mode: 100644) (index 3a3292d..2ece57b)
1 "use strict";
2 Object.defineProperty(exports, "__esModule", { value: true });
3 const Wrapper_1 = require("./Wrapper");
1 import { Wrapper } from "./Wrapper";
4 2 /** /**
5 3 * Stores numeric information in a wrapper, and provides ways to modify the value * Stores numeric information in a wrapper, and provides ways to modify the value
6 4 */ */
7 class NumericWrapper extends Wrapper_1.Wrapper {
5 export class NumericWrapper extends Wrapper {
8 6 /** Creates a new instance of wrapper with the given value */ /** Creates a new instance of wrapper with the given value */
9 7 constructor(value) { constructor(value) {
10 8 super(value); super(value);
 
... ... class NumericWrapper extends Wrapper_1.Wrapper {
29 27 } }
30 28 /** Applies the exponent */ /** Applies the exponent */
31 29 applyExponent(value) { applyExponent(value) {
32 (_a = this).value = Math.pow(_a.value, value);
33 var _a;
30 this.value **= value;
34 31 } }
35 32 } }
36 exports.NumericWrapper = NumericWrapper;
File lib/wrappers/Wrapper.js changed (mode: 100644) (index d2a3cc5..6205755)
1 "use strict";
2 Object.defineProperty(exports, "__esModule", { value: true });
3 1 /** /**
4 2 * Base Wrapper object * Base Wrapper object
5 3 * A wrapper is to store base values and contains methods to operate on them. * A wrapper is to store base values and contains methods to operate on them.
6 4 * Using CarrollCloud database, these will be wrapped and unwrapped during serializaiton of classed objects * Using CarrollCloud database, these will be wrapped and unwrapped during serializaiton of classed objects
7 5 */ */
8 class Wrapper {
6 export class Wrapper {
9 7 /** Creates a new instance of wrapper with the given value */ /** Creates a new instance of wrapper with the given value */
10 8 constructor(value) { constructor(value) {
11 9 this.value = value; this.value = value;
 
... ... class Wrapper {
19 17 return this.value; return this.value;
20 18 } }
21 19 } }
22 exports.Wrapper = Wrapper;
File src/index.ts changed (mode: 100644) (index 73a57b5..d46f374)
1 /* Import everything we want to export */
2 import { Wrapper } from "./wrappers/Wrapper"
3 import { NumericWrapper } from "./wrappers/NumericWrapper"
4 import { DimWrapper } from "./wrappers/DimWrapper"
5
6 /* Now, we export these classes */
7 export { Wrapper, NumericWrapper, DimWrapper }
1 /* Export all front-facing classes */
2 export { Wrapper } from "./wrappers/Wrapper"
3 export { NumericWrapper } from "./wrappers/NumericWrapper"
4 export { DimWrapper } from "./wrappers/DimWrapper"
File tsconfig.json changed (mode: 100644) (index f6caf9c..f742ecd)
1 1 { {
2 2 "compilerOptions": { "compilerOptions": {
3 3 /* Basic Options */ /* Basic Options */
4 "target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
5 "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
4 "target": "ES2017", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
5 "module": "es2015", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
6 6 // "lib": [], /* Specify library files to be included in the compilation. */ // "lib": [], /* Specify library files to be included in the compilation. */
7 7 // "allowJs": true, /* Allow javascript files to be compiled. */ // "allowJs": true, /* Allow javascript files to be compiled. */
8 8 // "checkJs": true, /* Report errors in .js files. */ // "checkJs": true, /* Report errors in .js files. */
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/CarrollCloud/js-value-wrappers

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/CarrollCloud/js-value-wrappers

Clone this repository using git:
git clone git://git.rocketgit.com/user/CarrollCloud/js-value-wrappers

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main