-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- typescript definitions - fixed vulnerable regexes (h/t @davisjam)
- Loading branch information
1 parent
71f827c
commit f6de179
Showing
20 changed files
with
194 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# ssf.js (C) 2013-present SheetJS -- http://sheetjs.com | ||
SheetJS | ||
ssf | ||
|
||
ECMA-376 | ||
xls | ||
xlsb | ||
|
||
npm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
SSF.version = '0.10.1'; | ||
SSF.version = '0.10.2'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Makefile | ||
*ssf*.ts | ||
doc.ts | ||
write.ts | ||
tslint.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* ssf.js (C) 2013-present SheetJS -- http://sheetjs.com */ | ||
/* eslint-env node */ | ||
/* eslint no-console:0 */ | ||
/*jshint node:true */ | ||
/// <reference types="../node_modules/@types/node/" /> | ||
import X = require('ssf'); | ||
const argv = process.argv.slice(2); | ||
if(argv.length < 2 || argv[0] === "-h" || argv[0] === "--help") { | ||
console.error("usage: ssf <format> <value>"); | ||
console.error("output: format_as_string|format_as_number|"); | ||
process.exit(0); | ||
} | ||
console.log(X.format(argv[0],argv[1]) + "|" + X.format(argv[0],+(argv[1])) + "|"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* ssf.js (C) 2013-present SheetJS -- http://sheetjs.com */ | ||
// TypeScript Version: 2.2 | ||
|
||
/** Version string */ | ||
export const version: string; | ||
|
||
/** Render value using format string or code */ | ||
export function format(fmt: string|number, val: any, opts?: any): string; | ||
|
||
/** Load format string */ | ||
export function load(fmt: string, idx?: number): number; | ||
|
||
/** Test if the format is a Date format */ | ||
export function is_date(fmt: string): boolean; | ||
|
||
|
||
/** Format Table */ | ||
export interface SSF$Table { | ||
[key: number]: string; | ||
[key: string]: string; | ||
} | ||
|
||
/** Get format table */ | ||
export function get_table(): SSF$Table; | ||
|
||
/** Set format table */ | ||
export function load_table(tbl: SSF$Table): void; | ||
|
||
|
||
/** Parsed date */ | ||
export interface SSF$Date { | ||
/** number of whole days since relevant epoch, 0 <= D */ | ||
D: number; | ||
/** integral year portion, epoch_year <= y */ | ||
y: number; | ||
/** integral month portion, 1 <= m <= 12 */ | ||
m: number; | ||
/** integral day portion, subject to gregorian YMD constraints */ | ||
d: number; | ||
/** integral day of week (0=Sunday .. 6=Saturday) 0 <= q <= 6 */ | ||
q: number; | ||
|
||
/** number of seconds since midnight, 0 <= T < 86400 */ | ||
T: number; | ||
/** integral number of hours since midnight, 0 <= H < 24 */ | ||
H: number; | ||
/** integral number of minutes since the last hour, 0 <= M < 60 */ | ||
M: number; | ||
/** integral number of seconds since the last minute, 0 <= S < 60 */ | ||
S: number; | ||
/** sub-second part of time, 0 <= u < 1 */ | ||
u: number; | ||
} | ||
|
||
/** Parse numeric date code */ | ||
export function parse_date_code(v: number, opts?: any): SSF$Date; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { format, load, get_table, load_table, parse_date_code, is_date, SSF$Table, SSF$Date } from 'ssf'; | ||
|
||
const t1: string = format("General", 123.456); | ||
const t2: string = format(0, 234.567); | ||
const t3: string = format("@", "1234.567"); | ||
|
||
load('"This is "0.00', 70); | ||
load('"This is "0'); | ||
|
||
const tbl: SSF$Table = get_table(); | ||
load_table(tbl); | ||
|
||
const date: SSF$Date = parse_date_code(43150); | ||
const sum: number = date.D + date.T + date.y + date.m + date.d + date.H + date.M + date.S + date.q + date.u; | ||
|
||
const isdate: boolean = is_date("YYYY-MM-DD"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"lib": [ "es5" ], | ||
"noImplicitAny": true, | ||
"noImplicitThis": true, | ||
"strictNullChecks": false, | ||
"baseUrl": ".", | ||
"paths": { "ssf": ["."] }, | ||
"types": [], | ||
"noEmit": true, | ||
"forceConsistentCasingInFileNames": true | ||
} | ||
} |
Oops, something went wrong.