We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2926894 commit e251403Copy full SHA for e251403
dist/json-schema-form-core.js
index.js
@@ -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;
+export { schemaDefaults } from './src/schemaDefaults';
+export { canonicalTitleMap } from './src/canonicalTitleMap';
+export { sfPath } from './src/sfPath';
+export { merge } from './src/merge';
+export { select } from './src/select';
+export { traverse } from './src/traverse';
+export { validate } from './src/validate';
lib/sfPath.js
package.json
@@ -1,6 +1,6 @@
{
"name": "json-schema-form-core",
- "version": "1.0.0-alpha.2",
+ "version": "1.0.0-alpha.3",
"description": "Core library",
"main": "dist/json-schema-form-core.js",
"scripts": {
@@ -30,12 +30,14 @@
30
},
31
"devDependencies": {
32
"babel-core": "^6.6.5",
33
- "babel-loader": "^6.2.4",
+ "babel-loader": "^6.2.8",
34
"babel-preset-es2015": "^6.6.0",
35
+ "babel-preset-es2016": "^6.16.0",
36
+ "babel-preset-latest": "^6.16.0",
37
"chai": "^3.5.0",
38
"mocha": "^2.4.5",
39
"tv4": "^1.2.7",
- "webpack": "^1.12.14"
40
+ "webpack": "^1.13.3"
41
42
"licenses": [
43
lib/canonicalTitleMap.js renamed to src/canonicalTitleMap.js
// Takes a titleMap in either object or list format and returns one in
// in the list format.
-exportdefaultfunction(titleMap, originalEnum) {
+constcanonicalTitleMap=function(titleMap, originalEnum) {
if (!Array.isArray(titleMap)) {
const canonical = [];
if (originalEnum) {
@@ -16,3 +16,5 @@ export default function(titleMap, originalEnum) {
16
}
17
return titleMap;
18
19
+
20
+export { canonicalTitleMap };
lib/merge.js renamed to src/merge.js
@@ -1,8 +1,8 @@
import {stringify, parse} from './sfPath';
-import canonicalTitleMap from './canonicalTitleMap';
+import {canonicalTitleMap} from './canonicalTitleMap';
//export function merge(schema, form, schemaDefaultTypes, ignore, options, readonly, asyncTemplates) {
-exportfunction merge(lookup, form, options, readonly, asyncTemplates) {
+constmerge=function (lookup, form, options, readonly, asyncTemplates) {
form = form || [];
options = options || {};
@@ -76,3 +76,4 @@ export function merge(lookup, form, options, readonly, asyncTemplates) {
76
return obj;
77
});
78
79
+export { merge };
lib/schemaDefaults.js renamed to src/schemaDefaults.js
@@ -1,5 +1,5 @@
-import {stringify} from './sfPath';
+import {stringify} from './sfPath';
/* Utils */
const stripNullType = (type) => {
lib/select.js renamed to src/select.js
-import sfPath from './sfPath';
+import {parse} from './sfPath';
const numRe = /^\d+$/;
@@ -19,12 +19,12 @@ const numRe = /^\d+$/;
* @returns {Any|undefined} returns the value at the end of the projection path
* or undefined if there is none.
21
*/
22
-exportfunctionselect(projection, obj, valueToSet) {
+constselect=(projection, obj, valueToSet)=> {
23
if (!obj) {
24
obj = this;
25
26
//Support [] array syntax
27
- var parts = typeof projection === 'string' ? sfPath.parse(projection) : projection;
+ var parts = typeof projection === 'string' ? parse(projection) : projection;
28
29
if (typeof valueToSet !== 'undefined' && parts.length === 1) {
//special case, just setting one variable
@@ -67,3 +67,5 @@ export function select(projection, obj, valueToSet) {
67
68
return value;
69
70
71
+export { select };
src/sfPath.js
@@ -0,0 +1,20 @@
+import { parse, stringify, normalize } from 'objectpath';
+const name = function(key, separator, formName, omitNumbers) {
+ if(key) {
+ var fieldKey = key.slice();
+ var fieldSeparator = separator || '-';
+ if(omitNumbers){
+ fieldKey = fieldKey.filter(function(key){
+ return typeof key !== 'number';
+ });
+ };
13
14
+ return ((formName) ? formName + fieldSeparator : '') + fieldKey.join(fieldSeparator);
15
+ return '';
+};
+export { name, parse, stringify, normalize };
lib/traverse.js renamed to src/traverse.js
@@ -2,7 +2,7 @@
* Traverse a schema, applying a function(schema,path) on every sub schema
* i.e. every property of an object.
-exportfunction traverseSchema(schema, fn, path, ignoreArrays) {
+consttraverseSchema=function (schema, fn, path, ignoreArrays) {
ignoreArrays = ignoreArrays === undefined ? true : ignoreArrays;
path = path || [];
@@ -45,3 +45,4 @@ export function traverseForm(form, fn) {
45
46
47
48
+export { traverseSchema };
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments