Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e251403

Browse files
Minor tweaks and folder rename
1 parent 2926894 commit e251403

File tree

13 files changed

+529
-538
lines changed

13 files changed

+529
-538
lines changed

‎dist/json-schema-form-core.js

Lines changed: 471 additions & 483 deletions
Large diffs are not rendered by default.

‎index.js

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
import * as schemaDefaultsImp from './lib/schemaDefaults';
2-
import * as sfPathImp from './lib/sfPath';
3-
import canonicalTitleMapImp from './lib/canonicalTitleMap';
4-
5-
export * from './lib/merge.js';
6-
export * from './lib/select.js';
7-
export * from './lib/traverse.js';
8-
export * from './lib/validate.js';
9-
10-
export const sfPath = sfPathImp;
11-
export const schemaDefaults = schemaDefaultsImp;
12-
export const canonicalTitleMap = canonicalTitleMapImp;
1+
export { schemaDefaults } from './src/schemaDefaults';
2+
export { canonicalTitleMap } from './src/canonicalTitleMap';
3+
export { sfPath } from './src/sfPath';
4+
export { merge } from './src/merge';
5+
export { select } from './src/select';
6+
export { traverse } from './src/traverse';
7+
export { validate } from './src/validate';

‎lib/sfPath.js

Lines changed: 0 additions & 24 deletions
This file was deleted.

‎package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "json-schema-form-core",
3-
"version": "1.0.0-alpha.2",
3+
"version": "1.0.0-alpha.3",
44
"description": "Core library",
55
"main": "dist/json-schema-form-core.js",
66
"scripts": {
@@ -30,12 +30,14 @@
3030
},
3131
"devDependencies": {
3232
"babel-core": "^6.6.5",
33-
"babel-loader": "^6.2.4",
33+
"babel-loader": "^6.2.8",
3434
"babel-preset-es2015": "^6.6.0",
35+
"babel-preset-es2016": "^6.16.0",
36+
"babel-preset-latest": "^6.16.0",
3537
"chai": "^3.5.0",
3638
"mocha": "^2.4.5",
3739
"tv4": "^1.2.7",
38-
"webpack": "^1.12.14"
40+
"webpack": "^1.13.3"
3941
},
4042
"licenses": [
4143
{

‎lib/canonicalTitleMap.js renamed to ‎src/canonicalTitleMap.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Takes a titleMap in either object or list format and returns one in
22
// in the list format.
3-
exportdefaultfunction(titleMap, originalEnum) {
3+
constcanonicalTitleMap=function(titleMap, originalEnum) {
44
if (!Array.isArray(titleMap)) {
55
const canonical = [];
66
if (originalEnum) {
@@ -16,3 +16,5 @@ export default function(titleMap, originalEnum) {
1616
}
1717
return titleMap;
1818
}
19+
20+
export { canonicalTitleMap };

‎lib/merge.js renamed to ‎src/merge.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import {stringify, parse} from './sfPath';
2-
import canonicalTitleMap from './canonicalTitleMap';
2+
import {canonicalTitleMap} from './canonicalTitleMap';
33

44
//export function merge(schema, form, schemaDefaultTypes, ignore, options, readonly, asyncTemplates) {
5-
exportfunction merge(lookup, form, options, readonly, asyncTemplates) {
5+
constmerge=function (lookup, form, options, readonly, asyncTemplates) {
66
form = form || [];
77
options = options || {};
88

@@ -76,3 +76,4 @@ export function merge(lookup, form, options, readonly, asyncTemplates) {
7676
return obj;
7777
});
7878
}
79+
export { merge };

‎lib/schemaDefaults.js renamed to ‎src/schemaDefaults.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import {stringify} from './sfPath';
2-
import canonicalTitleMap from './canonicalTitleMap';
1+
import {stringify} from './sfPath';
2+
import {canonicalTitleMap} from './canonicalTitleMap';
33

44
/* Utils */
55
const stripNullType = (type) => {

‎lib/select.js renamed to ‎src/select.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
import sfPath from './sfPath';
2+
import {parse} from './sfPath';
33

44
const numRe = /^\d+$/;
55

@@ -19,12 +19,12 @@ const numRe = /^\d+$/;
1919
* @returns {Any|undefined} returns the value at the end of the projection path
2020
* or undefined if there is none.
2121
*/
22-
exportfunctionselect(projection, obj, valueToSet) {
22+
constselect=(projection, obj, valueToSet)=> {
2323
if (!obj) {
2424
obj = this;
2525
}
2626
//Support [] array syntax
27-
var parts = typeof projection === 'string' ? sfPath.parse(projection) : projection;
27+
var parts = typeof projection === 'string' ? parse(projection) : projection;
2828

2929
if (typeof valueToSet !== 'undefined' && parts.length === 1) {
3030
//special case, just setting one variable
@@ -67,3 +67,5 @@ export function select(projection, obj, valueToSet) {
6767
}
6868
return value;
6969
}
70+
71+
export { select };

‎src/sfPath.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { parse, stringify, normalize } from 'objectpath';
2+
3+
const name = function(key, separator, formName, omitNumbers) {
4+
if(key) {
5+
var fieldKey = key.slice();
6+
var fieldSeparator = separator || '-';
7+
8+
if(omitNumbers){
9+
fieldKey = fieldKey.filter(function(key){
10+
return typeof key !== 'number';
11+
});
12+
};
13+
14+
return ((formName) ? formName + fieldSeparator : '') + fieldKey.join(fieldSeparator);
15+
};
16+
17+
return '';
18+
};
19+
20+
export { name, parse, stringify, normalize };

‎lib/traverse.js renamed to ‎src/traverse.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Traverse a schema, applying a function(schema,path) on every sub schema
33
* i.e. every property of an object.
44
*/
5-
exportfunction traverseSchema(schema, fn, path, ignoreArrays) {
5+
consttraverseSchema=function (schema, fn, path, ignoreArrays) {
66
ignoreArrays = ignoreArrays === undefined ? true : ignoreArrays;
77

88
path = path || [];
@@ -45,3 +45,4 @@ export function traverseForm(form, fn) {
4545
});
4646
}
4747
}
48+
export { traverseSchema };

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /