type-store 0.2.41 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -22
- package/README.md +30 -30
- package/package.json +44 -44
- package/type-store.js +12 -2
package/LICENSE
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2016 Codenautas <codenautas@googlegroups.com>
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
22
|
-
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2016 Codenautas <codenautas@googlegroups.com>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
package/README.md
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
# type-store
|
|
2
|
-
type ecosystem
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-

|
|
6
|
-
[](https://npmjs.org/package/type-store)
|
|
7
|
-
[](https://npmjs.org/package/type-store)
|
|
8
|
-
[](https://travis-ci.org/codenautas/type-store)
|
|
9
|
-
[](https://coveralls.io/r/codenautas/type-store)
|
|
10
|
-
[](https://david-dm.org/codenautas/type-store)
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
language: 
|
|
14
|
-
also available in:
|
|
15
|
-
[](LEEME.md)
|
|
16
|
-
|
|
17
|
-
# Install
|
|
18
|
-
```sh
|
|
19
|
-
$ npm install type-store
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
# Goal
|
|
23
|
-
|
|
24
|
-
# Usage
|
|
25
|
-
# Usage
|
|
26
|
-
|
|
27
|
-
## License
|
|
28
|
-
|
|
29
|
-
[MIT](LICENSE)
|
|
30
|
-
|
|
1
|
+
# type-store
|
|
2
|
+
type ecosystem
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
[](https://npmjs.org/package/type-store)
|
|
7
|
+
[](https://npmjs.org/package/type-store)
|
|
8
|
+
[](https://travis-ci.org/codenautas/type-store)
|
|
9
|
+
[](https://coveralls.io/r/codenautas/type-store)
|
|
10
|
+
[](https://david-dm.org/codenautas/type-store)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
language: 
|
|
14
|
+
also available in:
|
|
15
|
+
[](LEEME.md)
|
|
16
|
+
|
|
17
|
+
# Install
|
|
18
|
+
```sh
|
|
19
|
+
$ npm install type-store
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
# Goal
|
|
23
|
+
|
|
24
|
+
# Usage
|
|
25
|
+
# Usage
|
|
26
|
+
|
|
27
|
+
## License
|
|
28
|
+
|
|
29
|
+
[MIT](LICENSE)
|
|
30
|
+
|
package/package.json
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "type-store",
|
|
3
|
-
"description": "type ecosystem",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"author": "Codenautas <codenautas@googlegroups.com>",
|
|
6
|
-
"repository": "codenautas/type-store",
|
|
7
|
-
"license": "MIT",
|
|
8
|
-
"main": "type-store.js",
|
|
9
|
-
"files": [
|
|
10
|
-
"type-store.js",
|
|
11
|
-
"postgres-interval4client.js"
|
|
12
|
-
],
|
|
13
|
-
"dependencies": {
|
|
14
|
-
"big.js": "
|
|
15
|
-
"best-globals": "
|
|
16
|
-
"js-to-html": "
|
|
17
|
-
"json4all": "
|
|
18
|
-
"like-ar": "
|
|
19
|
-
},
|
|
20
|
-
"devDependencies": {
|
|
21
|
-
"expect.js": "
|
|
22
|
-
"istanbul": "
|
|
23
|
-
"mocha": "
|
|
24
|
-
"postgres-interval": "
|
|
25
|
-
"discrepances": "
|
|
26
|
-
},
|
|
27
|
-
"engines": {
|
|
28
|
-
"node": ">=
|
|
29
|
-
},
|
|
30
|
-
"scripts": {
|
|
31
|
-
"start": "node example/server.js",
|
|
32
|
-
"test": "mocha --reporter spec --bail --check-leaks test/",
|
|
33
|
-
"test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/",
|
|
34
|
-
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
|
|
35
|
-
"test-nc": "mocha --reporter spec --bail --check-leaks --no-colors test/"
|
|
36
|
-
},
|
|
37
|
-
"qa-control": {
|
|
38
|
-
"package-version": "0.3.0",
|
|
39
|
-
"coverage": 90,
|
|
40
|
-
"run-in": "both",
|
|
41
|
-
"stability": "extending",
|
|
42
|
-
"type": "lib"
|
|
43
|
-
}
|
|
44
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "type-store",
|
|
3
|
+
"description": "type ecosystem",
|
|
4
|
+
"version": "0.3.0",
|
|
5
|
+
"author": "Codenautas <codenautas@googlegroups.com>",
|
|
6
|
+
"repository": "codenautas/type-store",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"main": "type-store.js",
|
|
9
|
+
"files": [
|
|
10
|
+
"type-store.js",
|
|
11
|
+
"postgres-interval4client.js"
|
|
12
|
+
],
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"big.js": "^6.2.1",
|
|
15
|
+
"best-globals": "^1.0.4",
|
|
16
|
+
"js-to-html": "^1.3.2",
|
|
17
|
+
"json4all": "^1.1.0",
|
|
18
|
+
"like-ar": "^0.3.6"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"expect.js": "^0.3.1",
|
|
22
|
+
"istanbul": "^0.4.5",
|
|
23
|
+
"mocha": "^10.2.0",
|
|
24
|
+
"postgres-interval": "^4.0.0",
|
|
25
|
+
"discrepances": "^0.2.6"
|
|
26
|
+
},
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">= 14"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"start": "node example/server.js",
|
|
32
|
+
"test": "mocha --reporter spec --bail --check-leaks test/",
|
|
33
|
+
"test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/",
|
|
34
|
+
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
|
|
35
|
+
"test-nc": "mocha --reporter spec --bail --check-leaks --no-colors test/"
|
|
36
|
+
},
|
|
37
|
+
"qa-control": {
|
|
38
|
+
"package-version": "0.3.0",
|
|
39
|
+
"coverage": 90,
|
|
40
|
+
"run-in": "both",
|
|
41
|
+
"stability": "extending",
|
|
42
|
+
"type": "lib"
|
|
43
|
+
}
|
|
44
|
+
}
|
package/type-store.js
CHANGED
|
@@ -134,7 +134,7 @@ TypeBase.prototype.toHtml=function toHtml(typedValue){
|
|
|
134
134
|
return html.span(attr, part);
|
|
135
135
|
},
|
|
136
136
|
function Parts(parts, className, otherAttrs){
|
|
137
|
-
var attrs=otherAttrs?changing(
|
|
137
|
+
var attrs=otherAttrs?changing({class:className},otherAttrs):{class:className};
|
|
138
138
|
return html.span(attrs, parts);
|
|
139
139
|
}
|
|
140
140
|
);
|
|
@@ -376,7 +376,7 @@ TypeStore.typeNumber.prototype.toLocalParts=function toLocalParts(typedValue,fPa
|
|
|
376
376
|
rta.push(fPart(decimals,"number-decimals"));
|
|
377
377
|
}
|
|
378
378
|
});
|
|
379
|
-
return fParts(rta,"number");
|
|
379
|
+
return fParts(rta, "number", {"number-sign":typedValue>0?"positive":typedValue<0?"negative":"zero"});
|
|
380
380
|
};
|
|
381
381
|
TypeStore.typeNumber.prototype.isValidTypedData=function isValidTypedData(typedData){
|
|
382
382
|
return typedData==null || typeof typedData === 'number' || typedData instanceof Big;
|
|
@@ -586,6 +586,16 @@ TypeStore.type.date.prototype.fromExcelCell=function fromExcelCell(cell){
|
|
|
586
586
|
throw err;
|
|
587
587
|
}
|
|
588
588
|
}
|
|
589
|
+
/*
|
|
590
|
+
Ojo con: https://www.npmjs.com/package/xlsx#utility-functions
|
|
591
|
+
|
|
592
|
+
Epochs: 1900 and 1904 (click to show)
|
|
593
|
+
Excel supports two epochs (January 1 1900 and January 1 1904), see "1900 vs. 1904 Date System" article.
|
|
594
|
+
The workbook's epoch can be determined by examining the workbook's wb.Workbook.WBProps.date1904 property:
|
|
595
|
+
|
|
596
|
+
!!(((wb.Workbook||{}).WBProps||{}).date1904)
|
|
597
|
+
|
|
598
|
+
*/
|
|
589
599
|
return cell.v!=null?bestGlobals.date.ymd(1899,12,31).add({days: cell.v-(cell.v>60?1:0)}):null;
|
|
590
600
|
};
|
|
591
601
|
TypeStore.type.date.prototype.isValidTypedData=function isValidTypedData(typedData){
|