Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: "warn only" schema definitions #42

Merged
merged 2 commits into from
May 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions spec/support/jasmine.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"spec_dir": "spec",
"spec_dir": "",
"spec_files": [
"**/*[sS]pec.js"
"dist/cjs/**/*[sS]pec.js"
],
"helpers": [
"helpers/**/*.js"
Expand Down
238 changes: 0 additions & 238 deletions spec/transport.spec.js

This file was deleted.

4 changes: 2 additions & 2 deletions src/acebase-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ export abstract class AceBaseBase extends SimpleEventEmitter {
get: (path: string) => {
return this.api.getSchema(path);
},
set: (path: string, schema: Record<string, unknown>|string) => {
return this.api.setSchema(path, schema);
set: (path: string, schema: Record<string, unknown>|string, warnOnly = false) => {
return this.api.setSchema(path, schema, warnOnly);
},
all: () => {
return this.api.getSchemas();
Expand Down
2 changes: 1 addition & 1 deletion src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ export abstract class Api extends SimpleEventEmitter {

deleteIndex(filePath: string): Promise<void> { throw new NotImplementedError('deleteIndex'); }

setSchema(path: string, schema: Record<string, any> | string): Promise<void> { throw new NotImplementedError('setSchema'); }
setSchema(path: string, schema: Record<string, any> | string, warnOnly?: boolean): Promise<void> { throw new NotImplementedError('setSchema'); }

getSchema(path: string): Promise<IAceBaseSchemaInfo> { throw new NotImplementedError('getSchema'); }

Expand Down
8 changes: 4 additions & 4 deletions spec/cuid.spec.js → src/cuid.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const cuid = require('../dist/cjs/cuid').default;
const hiresCuid = require('../dist/cjs/cuid/hires').default;
import cuid from './cuid';
import hiresCuid from './cuid/hires';

describe('cuid', function() {
it ('high resolution', () => {
Expand All @@ -11,15 +11,15 @@ describe('cuid', function() {

// Generate hires cuids
const n = 100000;
let cuids = new Array(n);
const cuids = new Array(n) as string[];
for (let i = 0; i < n; i++) {
cuids[i] = hiresCuid();
}

// Expect all first 11 chars (7 ms + 4 ns) to be different and lexicographically sortable (cuid[n] < cuid[n+1])
for (let i = 1; i < n; i++) {
const t1 = cuids[i-1].slice(1, 12), t2 = cuids[i].slice(1, 12);
expect(t1).toBeLessThan(t2);
expect(t1 < t2).toBeTrue();
}

// debugger;
Expand Down
2 changes: 1 addition & 1 deletion spec/path-info.spec.js → src/path-info.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { PathInfo } = require('../dist/cjs/path-info');
import { PathInfo } from './path-info';

describe('PathInfo', function() {

Expand Down
Loading