Sha256: 21f9d887165cdf3e2f00ad24575cf212b7f7d8ae80e22c00405c539e3b8fa8c7
Contents?: true
Size: 1.17 KB
Versions: 1
Compression:
Stored size: 1.17 KB
Contents
/* This is generated by ts_routes-rails */ type ScalarType = string | number | boolean; function $buildOptions(options: any, names: string[]): string { if (options) { let anchor = ""; const q = []; for (const key of Object.keys(options)) { if (names.indexOf(key) !== -1) { // the key is already consumed continue; } const value: ScalarType = options[ key ]; if (key === "anchor") { anchor = "#" + encodeURIComponent("" + value); } else if (Array.isArray(value)) { for (const v of value as ScalarType[]) { q.push(encodeURIComponent(key + "[]") + "=" + encodeURIComponent("" + v)); } } else if(value !== null && value !== undefined) { q.push(encodeURIComponent(key) + "=" + encodeURIComponent("" + value)); } } return (q.length > 0 ? "?" + q.join("&") : "") + anchor; } else { return ""; } } function $isPresent(value: any): boolean { return value !== undefined && value !== null && ("" + value).length > 0; } function $hasPresentOwnProperty(options: any, key: string): boolean { return options && options.hasOwnProperty(key) && $isPresent(options[key]); }
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
ts_routes-0.3.0 | lib/ts_routes/runtime.ts |