trusty-cms 4.1.6 → 4.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +114 -107
- data/INSTALL.md +2 -0
- data/app/controllers/admin/pages_controller.rb +1 -1
- data/app/controllers/admin/preferences_controller.rb +1 -1
- data/app/controllers/admin/resource_controller.rb +1 -1
- data/app/controllers/admin/users_controller.rb +1 -1
- data/config/environments/development.rb +2 -0
- data/lib/generators/extension/USAGE +30 -0
- data/lib/generators/extension/extension_generator.rb +97 -0
- data/lib/generators/extension/templates/README.md +6 -0
- data/lib/generators/extension/templates/RSpecRakefile +109 -0
- data/lib/generators/extension/templates/Rakefile +25 -0
- data/lib/generators/extension/templates/cucumber.yml +1 -0
- data/lib/generators/extension/templates/cucumber_env.rb +11 -0
- data/lib/generators/extension/templates/cucumber_paths.rb +22 -0
- data/lib/generators/extension/templates/en.yml +3 -0
- data/lib/generators/extension/templates/extension.rb +21 -0
- data/lib/generators/extension/templates/functional_test.rb +15 -0
- data/lib/generators/extension/templates/gemspec.rb +29 -0
- data/lib/generators/extension/templates/lib.rb +8 -0
- data/lib/generators/extension/templates/migration.rb +9 -0
- data/lib/generators/extension/templates/radiant_config.rb +3 -0
- data/lib/generators/extension/templates/routes.rb +5 -0
- data/lib/generators/extension/templates/spec.opts +6 -0
- data/lib/generators/extension/templates/spec_helper.rb +42 -0
- data/lib/generators/extension/templates/tasks.rake +47 -0
- data/lib/generators/extension/templates/test_helper.rb +26 -0
- data/lib/generators/extension_controller/USAGE +36 -0
- data/lib/generators/extension_controller/extension_controller_generator.rb +84 -0
- data/lib/generators/extension_controller/templates/controller.rb +10 -0
- data/lib/generators/extension_controller/templates/controller_spec.rb +23 -0
- data/lib/generators/extension_controller/templates/functional_test.rb +11 -0
- data/lib/generators/extension_controller/templates/helper.rb +2 -0
- data/lib/generators/extension_controller/templates/helper_spec.rb +11 -0
- data/lib/generators/extension_controller/templates/helper_test.rb +4 -0
- data/lib/generators/extension_controller/templates/view.html.erb +2 -0
- data/lib/generators/extension_controller/templates/view_spec.rb +12 -0
- data/lib/generators/extension_mailer/USAGE +17 -0
- data/lib/generators/extension_mailer/extension_mailer_generator.rb +68 -0
- data/lib/generators/extension_mailer/templates/fixture.erb +3 -0
- data/lib/generators/extension_mailer/templates/mailer.rb +15 -0
- data/lib/generators/extension_mailer/templates/unit_test.rb +21 -0
- data/lib/generators/extension_mailer/templates/view.erb +3 -0
- data/lib/generators/extension_migration/USAGE +34 -0
- data/lib/generators/extension_migration/extension_migration_generator.rb +25 -0
- data/lib/generators/extension_migration/templates/migration.rb +11 -0
- data/lib/generators/extension_model/USAGE +35 -0
- data/lib/generators/extension_model/extension_model_generator.rb +68 -0
- data/lib/generators/extension_model/templates/fixtures.yml +19 -0
- data/lib/generators/extension_model/templates/migration.rb +16 -0
- data/lib/generators/extension_model/templates/model.rb +2 -0
- data/lib/generators/extension_model/templates/model_spec.rb +11 -0
- data/lib/generators/extension_model/templates/unit_test.rb +8 -0
- data/lib/generators/generator_base_extension.rb +18 -0
- data/lib/generators/instance/instance_generator.rb +148 -0
- data/lib/generators/instance/templates/databases/db2.yml +40 -0
- data/lib/generators/instance/templates/databases/mysql.yml +47 -0
- data/lib/generators/instance/templates/databases/postgresql.yml +44 -0
- data/lib/generators/instance/templates/databases/sqlite3.yml +16 -0
- data/lib/generators/instance/templates/databases/sqlserver.yml +21 -0
- data/lib/generators/instance/templates/instance_boot.rb +122 -0
- data/lib/generators/instance/templates/instance_config.ru +2 -0
- data/lib/generators/instance/templates/instance_environment.rb +93 -0
- data/lib/generators/instance/templates/instance_gemfile +78 -0
- data/lib/generators/instance/templates/instance_generate +6 -0
- data/lib/generators/instance/templates/instance_radiant_config.rb +16 -0
- data/lib/generators/instance/templates/instance_rakefile +3 -0
- data/lib/generators/instance/templates/instance_routes.rb +1 -0
- data/lib/generators/language_extension/USAGE +27 -0
- data/lib/generators/language_extension/language_extension_generator.rb +71 -0
- data/lib/generators/language_extension/templates/README +3 -0
- data/lib/generators/language_extension/templates/RSpecRakefile +123 -0
- data/lib/generators/language_extension/templates/Rakefile +25 -0
- data/lib/generators/language_extension/templates/available_tags.yml +553 -0
- data/lib/generators/language_extension/templates/cucumber.yml +1 -0
- data/lib/generators/language_extension/templates/cucumber_env.rb +16 -0
- data/lib/generators/language_extension/templates/cucumber_paths.rb +14 -0
- data/lib/generators/language_extension/templates/extension.rb +12 -0
- data/lib/generators/language_extension/templates/functional_test.rb +15 -0
- data/lib/generators/language_extension/templates/gemspec.rb +24 -0
- data/lib/generators/language_extension/templates/lang.yml +181 -0
- data/lib/generators/language_extension/templates/lib.rb +8 -0
- data/lib/generators/language_extension/templates/spec.opts +6 -0
- data/lib/generators/language_extension/templates/spec_helper.rb +36 -0
- data/lib/generators/language_extension/templates/tasks.rake +28 -0
- data/lib/generators/language_extension/templates/test_helper.rb +26 -0
- data/lib/generators/trusty_cms/USAGE +8 -0
- data/lib/generators/trusty_cms/templates/Rakefile.erb +7 -0
- data/lib/generators/trusty_cms/templates/application.rb.erb +149 -0
- data/lib/generators/trusty_cms/templates/boot.rb.erb +9 -0
- data/lib/generators/trusty_cms/templates/config.ru.erb +4 -0
- data/lib/generators/trusty_cms/templates/database.yml.erb +28 -0
- data/lib/generators/trusty_cms/templates/environment.rb.erb +5 -0
- data/lib/generators/trusty_cms/templates/environments/development.rb.erb +24 -0
- data/lib/generators/trusty_cms/templates/environments/production.rb.erb +26 -0
- data/lib/generators/trusty_cms/templates/environments/test.rb.erb +35 -0
- data/lib/generators/trusty_cms/templates/initializers/secret_token.rb.erb +13 -0
- data/lib/generators/trusty_cms/templates/initializers/session_store.rb.erb +8 -0
- data/lib/generators/trusty_cms/templates/initializers/trusty_cms_config.rb.erb +16 -0
- data/lib/generators/trusty_cms/templates/preinitializer.rb.erb +18 -0
- data/lib/generators/trusty_cms/templates/routes.rb.erb +0 -0
- data/lib/generators/trusty_cms/trusty_cms_generator.rb +32 -0
- data/lib/trusty_cms.rb +1 -1
- data/lib/trusty_cms/setup.rb +8 -8
- data/trusty_cms.gemspec +4 -4
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/base.rb +195 -0
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/check_box.rb +65 -0
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/checkable.rb +18 -0
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/collection_check_boxes.rb +35 -0
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/collection_helpers.rb +118 -0
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/collection_radio_buttons.rb +30 -0
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/collection_select.rb +30 -0
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/color_field.rb +26 -0
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/date_field.rb +14 -0
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/date_select.rb +73 -0
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/datetime_field.rb +31 -0
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/datetime_local_field.rb +20 -0
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/datetime_select.rb +10 -0
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/email_field.rb +10 -0
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/file_field.rb +10 -0
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/grouped_collection_select.rb +31 -0
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/hidden_field.rb +10 -0
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/label.rb +80 -0
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/month_field.rb +14 -0
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/number_field.rb +20 -0
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/password_field.rb +14 -0
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/placeholderable.rb +24 -0
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/radio_button.rb +32 -0
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/range_field.rb +10 -0
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/search_field.rb +27 -0
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/select.rb +42 -0
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/tel_field.rb +10 -0
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/text_area.rb +24 -0
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/text_field.rb +33 -0
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/time_field.rb +14 -0
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/time_select.rb +10 -0
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/time_zone_select.rb +22 -0
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/translator.rb +39 -0
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/url_field.rb +10 -0
- data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/week_field.rb +14 -0
- data/yarn.lock +3 -3
- metadata +296 -71
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/core.js +0 -126
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/failsafe/index.js +0 -4
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/failsafe/map.js +0 -56
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/failsafe/seq.js +0 -43
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/failsafe/string.js +0 -28
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/index.js +0 -36
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/json.js +0 -76
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/options.js +0 -23
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/yaml-1.1/binary.js +0 -87
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/yaml-1.1/index.js +0 -157
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/yaml-1.1/omap.js +0 -142
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/yaml-1.1/pairs.js +0 -81
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/yaml-1.1/set.js +0 -114
- data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/yaml-1.1/timestamp.js +0 -97
- data/spec/spec/dummy/node_modules/yaml/dist/tags/core.js +0 -114
- data/spec/spec/dummy/node_modules/yaml/dist/tags/failsafe/index.js +0 -17
- data/spec/spec/dummy/node_modules/yaml/dist/tags/failsafe/map.js +0 -37
- data/spec/spec/dummy/node_modules/yaml/dist/tags/failsafe/seq.js +0 -34
- data/spec/spec/dummy/node_modules/yaml/dist/tags/failsafe/string.js +0 -40
- data/spec/spec/dummy/node_modules/yaml/dist/tags/index.js +0 -62
- data/spec/spec/dummy/node_modules/yaml/dist/tags/json.js +0 -60
- data/spec/spec/dummy/node_modules/yaml/dist/tags/options.js +0 -35
- data/spec/spec/dummy/node_modules/yaml/dist/tags/yaml-1.1/binary.js +0 -97
- data/spec/spec/dummy/node_modules/yaml/dist/tags/yaml-1.1/index.js +0 -131
- data/spec/spec/dummy/node_modules/yaml/dist/tags/yaml-1.1/omap.js +0 -105
- data/spec/spec/dummy/node_modules/yaml/dist/tags/yaml-1.1/pairs.js +0 -80
- data/spec/spec/dummy/node_modules/yaml/dist/tags/yaml-1.1/set.js +0 -91
- data/spec/spec/dummy/node_modules/yaml/dist/tags/yaml-1.1/timestamp.js +0 -93
@@ -1,97 +0,0 @@
|
|
1
|
-
import { stringifyNumber } from '../../stringify';
|
2
|
-
|
3
|
-
var parseSexagesimal = function parseSexagesimal(sign, parts) {
|
4
|
-
var n = parts.split(':').reduce(function (n, p) {
|
5
|
-
return n * 60 + Number(p);
|
6
|
-
}, 0);
|
7
|
-
return sign === '-' ? -n : n;
|
8
|
-
}; // hhhh:mm:ss.sss
|
9
|
-
|
10
|
-
|
11
|
-
var stringifySexagesimal = function stringifySexagesimal(_ref) {
|
12
|
-
var value = _ref.value;
|
13
|
-
if (isNaN(value) || !isFinite(value)) return stringifyNumber(value);
|
14
|
-
var sign = '';
|
15
|
-
|
16
|
-
if (value < 0) {
|
17
|
-
sign = '-';
|
18
|
-
value = Math.abs(value);
|
19
|
-
}
|
20
|
-
|
21
|
-
var parts = [value % 60]; // seconds, including ms
|
22
|
-
|
23
|
-
if (value < 60) {
|
24
|
-
parts.unshift(0); // at least one : is required
|
25
|
-
} else {
|
26
|
-
value = Math.round((value - parts[0]) / 60);
|
27
|
-
parts.unshift(value % 60); // minutes
|
28
|
-
|
29
|
-
if (value >= 60) {
|
30
|
-
value = Math.round((value - parts[0]) / 60);
|
31
|
-
parts.unshift(value); // hours
|
32
|
-
}
|
33
|
-
}
|
34
|
-
|
35
|
-
return sign + parts.map(function (n) {
|
36
|
-
return n < 10 ? '0' + String(n) : String(n);
|
37
|
-
}).join(':').replace(/000000\d*$/, '') // % 60 may introduce error
|
38
|
-
;
|
39
|
-
};
|
40
|
-
|
41
|
-
export var intTime = {
|
42
|
-
identify: function identify(value) {
|
43
|
-
return typeof value === 'number';
|
44
|
-
},
|
45
|
-
default: true,
|
46
|
-
tag: 'tag:yaml.org,2002:int',
|
47
|
-
format: 'TIME',
|
48
|
-
test: /^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+)$/,
|
49
|
-
resolve: function resolve(str, sign, parts) {
|
50
|
-
return parseSexagesimal(sign, parts.replace(/_/g, ''));
|
51
|
-
},
|
52
|
-
stringify: stringifySexagesimal
|
53
|
-
};
|
54
|
-
export var floatTime = {
|
55
|
-
identify: function identify(value) {
|
56
|
-
return typeof value === 'number';
|
57
|
-
},
|
58
|
-
default: true,
|
59
|
-
tag: 'tag:yaml.org,2002:float',
|
60
|
-
format: 'TIME',
|
61
|
-
test: /^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*)$/,
|
62
|
-
resolve: function resolve(str, sign, parts) {
|
63
|
-
return parseSexagesimal(sign, parts.replace(/_/g, ''));
|
64
|
-
},
|
65
|
-
stringify: stringifySexagesimal
|
66
|
-
};
|
67
|
-
export var timestamp = {
|
68
|
-
identify: function identify(value) {
|
69
|
-
return value instanceof Date;
|
70
|
-
},
|
71
|
-
default: true,
|
72
|
-
tag: 'tag:yaml.org,2002:timestamp',
|
73
|
-
// If the time zone is omitted, the timestamp is assumed to be specified in UTC. The time part
|
74
|
-
// may be omitted altogether, resulting in a date format. In such a case, the time part is
|
75
|
-
// assumed to be 00:00:00Z (start of day, UTC).
|
76
|
-
test: RegExp('^(?:' + '([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})' + // YYYY-Mm-Dd
|
77
|
-
'(?:(?:t|T|[ \\t]+)' + // t | T | whitespace
|
78
|
-
'([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)' + // Hh:Mm:Ss(.ss)?
|
79
|
-
'(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?' + // Z | +5 | -03:30
|
80
|
-
')?' + ')$'),
|
81
|
-
resolve: function resolve(str, year, month, day, hour, minute, second, millisec, tz) {
|
82
|
-
if (millisec) millisec = (millisec + '00').substr(1, 3);
|
83
|
-
var date = Date.UTC(year, month - 1, day, hour || 0, minute || 0, second || 0, millisec || 0);
|
84
|
-
|
85
|
-
if (tz && tz !== 'Z') {
|
86
|
-
var d = parseSexagesimal(tz[0], tz.slice(1));
|
87
|
-
if (Math.abs(d) < 30) d *= 60;
|
88
|
-
date -= 60000 * d;
|
89
|
-
}
|
90
|
-
|
91
|
-
return new Date(date);
|
92
|
-
},
|
93
|
-
stringify: function stringify(_ref2) {
|
94
|
-
var value = _ref2.value;
|
95
|
-
return value.toISOString().replace(/((T00:00)?:00)?\.000Z$/, '');
|
96
|
-
}
|
97
|
-
};
|
@@ -1,114 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.default = exports.floatObj = exports.expObj = exports.nanObj = exports.hexObj = exports.intObj = exports.octObj = exports.boolObj = exports.nullObj = void 0;
|
7
|
-
|
8
|
-
var _Scalar = _interopRequireDefault(require("../schema/Scalar"));
|
9
|
-
|
10
|
-
var _stringify = require("../stringify");
|
11
|
-
|
12
|
-
var _failsafe = _interopRequireDefault(require("./failsafe"));
|
13
|
-
|
14
|
-
var _options = require("./options");
|
15
|
-
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
17
|
-
|
18
|
-
const nullObj = {
|
19
|
-
identify: value => value == null,
|
20
|
-
createNode: (schema, value, ctx) => ctx.wrapScalars ? new _Scalar.default(null) : null,
|
21
|
-
default: true,
|
22
|
-
tag: 'tag:yaml.org,2002:null',
|
23
|
-
test: /^(?:~|[Nn]ull|NULL)?$/,
|
24
|
-
resolve: () => null,
|
25
|
-
options: _options.nullOptions,
|
26
|
-
stringify: () => _options.nullOptions.nullStr
|
27
|
-
};
|
28
|
-
exports.nullObj = nullObj;
|
29
|
-
const boolObj = {
|
30
|
-
identify: value => typeof value === 'boolean',
|
31
|
-
default: true,
|
32
|
-
tag: 'tag:yaml.org,2002:bool',
|
33
|
-
test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,
|
34
|
-
resolve: str => str[0] === 't' || str[0] === 'T',
|
35
|
-
options: _options.boolOptions,
|
36
|
-
stringify: ({
|
37
|
-
value
|
38
|
-
}) => value ? _options.boolOptions.trueStr : _options.boolOptions.falseStr
|
39
|
-
};
|
40
|
-
exports.boolObj = boolObj;
|
41
|
-
const octObj = {
|
42
|
-
identify: value => typeof value === 'number',
|
43
|
-
default: true,
|
44
|
-
tag: 'tag:yaml.org,2002:int',
|
45
|
-
format: 'OCT',
|
46
|
-
test: /^0o([0-7]+)$/,
|
47
|
-
resolve: (str, oct) => parseInt(oct, 8),
|
48
|
-
stringify: ({
|
49
|
-
value
|
50
|
-
}) => '0o' + value.toString(8)
|
51
|
-
};
|
52
|
-
exports.octObj = octObj;
|
53
|
-
const intObj = {
|
54
|
-
identify: value => typeof value === 'number',
|
55
|
-
default: true,
|
56
|
-
tag: 'tag:yaml.org,2002:int',
|
57
|
-
test: /^[-+]?[0-9]+$/,
|
58
|
-
resolve: str => parseInt(str, 10),
|
59
|
-
stringify: _stringify.stringifyNumber
|
60
|
-
};
|
61
|
-
exports.intObj = intObj;
|
62
|
-
const hexObj = {
|
63
|
-
identify: value => typeof value === 'number',
|
64
|
-
default: true,
|
65
|
-
tag: 'tag:yaml.org,2002:int',
|
66
|
-
format: 'HEX',
|
67
|
-
test: /^0x([0-9a-fA-F]+)$/,
|
68
|
-
resolve: (str, hex) => parseInt(hex, 16),
|
69
|
-
stringify: ({
|
70
|
-
value
|
71
|
-
}) => '0x' + value.toString(16)
|
72
|
-
};
|
73
|
-
exports.hexObj = hexObj;
|
74
|
-
const nanObj = {
|
75
|
-
identify: value => typeof value === 'number',
|
76
|
-
default: true,
|
77
|
-
tag: 'tag:yaml.org,2002:float',
|
78
|
-
test: /^(?:[-+]?\.inf|(\.nan))$/i,
|
79
|
-
resolve: (str, nan) => nan ? NaN : str[0] === '-' ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
|
80
|
-
stringify: _stringify.stringifyNumber
|
81
|
-
};
|
82
|
-
exports.nanObj = nanObj;
|
83
|
-
const expObj = {
|
84
|
-
identify: value => typeof value === 'number',
|
85
|
-
default: true,
|
86
|
-
tag: 'tag:yaml.org,2002:float',
|
87
|
-
format: 'EXP',
|
88
|
-
test: /^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,
|
89
|
-
resolve: str => parseFloat(str),
|
90
|
-
stringify: ({
|
91
|
-
value
|
92
|
-
}) => Number(value).toExponential()
|
93
|
-
};
|
94
|
-
exports.expObj = expObj;
|
95
|
-
const floatObj = {
|
96
|
-
identify: value => typeof value === 'number',
|
97
|
-
default: true,
|
98
|
-
tag: 'tag:yaml.org,2002:float',
|
99
|
-
test: /^[-+]?(?:\.([0-9]+)|[0-9]+\.([0-9]*))$/,
|
100
|
-
|
101
|
-
resolve(str, frac1, frac2) {
|
102
|
-
const frac = frac1 || frac2;
|
103
|
-
const node = new _Scalar.default(parseFloat(str));
|
104
|
-
if (frac && frac[frac.length - 1] === '0') node.minFractionDigits = frac.length;
|
105
|
-
return node;
|
106
|
-
},
|
107
|
-
|
108
|
-
stringify: _stringify.stringifyNumber
|
109
|
-
};
|
110
|
-
exports.floatObj = floatObj;
|
111
|
-
|
112
|
-
var _default = _failsafe.default.concat([nullObj, boolObj, octObj, intObj, hexObj, nanObj, expObj, floatObj]);
|
113
|
-
|
114
|
-
exports.default = _default;
|
@@ -1,17 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.default = void 0;
|
7
|
-
|
8
|
-
var _map = _interopRequireDefault(require("./map"));
|
9
|
-
|
10
|
-
var _seq = _interopRequireDefault(require("./seq"));
|
11
|
-
|
12
|
-
var _string = _interopRequireDefault(require("./string"));
|
13
|
-
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
15
|
-
|
16
|
-
var _default = [_map.default, _seq.default, _string.default];
|
17
|
-
exports.default = _default;
|
@@ -1,37 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.default = void 0;
|
7
|
-
|
8
|
-
var _Map = _interopRequireDefault(require("../../schema/Map"));
|
9
|
-
|
10
|
-
var _parseMap = _interopRequireDefault(require("../../schema/parseMap"));
|
11
|
-
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
|
-
|
14
|
-
function createMap(schema, obj, ctx) {
|
15
|
-
const map = new _Map.default(schema);
|
16
|
-
|
17
|
-
if (obj instanceof Map) {
|
18
|
-
for (const [key, value] of obj) map.items.push(schema.createPair(key, value, ctx));
|
19
|
-
} else if (obj && typeof obj === 'object') {
|
20
|
-
for (const key of Object.keys(obj)) map.items.push(schema.createPair(key, obj[key], ctx));
|
21
|
-
}
|
22
|
-
|
23
|
-
if (typeof schema.sortMapEntries === 'function') {
|
24
|
-
map.items.sort(schema.sortMapEntries);
|
25
|
-
}
|
26
|
-
|
27
|
-
return map;
|
28
|
-
}
|
29
|
-
|
30
|
-
var _default = {
|
31
|
-
createNode: createMap,
|
32
|
-
default: true,
|
33
|
-
nodeClass: _Map.default,
|
34
|
-
tag: 'tag:yaml.org,2002:map',
|
35
|
-
resolve: _parseMap.default
|
36
|
-
};
|
37
|
-
exports.default = _default;
|
@@ -1,34 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.default = void 0;
|
7
|
-
|
8
|
-
var _parseSeq = _interopRequireDefault(require("../../schema/parseSeq"));
|
9
|
-
|
10
|
-
var _Seq = _interopRequireDefault(require("../../schema/Seq"));
|
11
|
-
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
|
-
|
14
|
-
function createSeq(schema, obj, ctx) {
|
15
|
-
const seq = new _Seq.default(schema);
|
16
|
-
|
17
|
-
if (obj && obj[Symbol.iterator]) {
|
18
|
-
for (const it of obj) {
|
19
|
-
const v = schema.createNode(it, ctx.wrapScalars, null, ctx);
|
20
|
-
seq.items.push(v);
|
21
|
-
}
|
22
|
-
}
|
23
|
-
|
24
|
-
return seq;
|
25
|
-
}
|
26
|
-
|
27
|
-
var _default = {
|
28
|
-
createNode: createSeq,
|
29
|
-
default: true,
|
30
|
-
nodeClass: _Seq.default,
|
31
|
-
tag: 'tag:yaml.org,2002:seq',
|
32
|
-
resolve: _parseSeq.default
|
33
|
-
};
|
34
|
-
exports.default = _default;
|
@@ -1,40 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.default = exports.resolveString = void 0;
|
7
|
-
|
8
|
-
var _stringify = require("../../stringify");
|
9
|
-
|
10
|
-
var _options = require("../options");
|
11
|
-
|
12
|
-
const resolveString = (doc, node) => {
|
13
|
-
// on error, will return { str: string, errors: Error[] }
|
14
|
-
const res = node.strValue;
|
15
|
-
if (!res) return '';
|
16
|
-
if (typeof res === 'string') return res;
|
17
|
-
res.errors.forEach(error => {
|
18
|
-
if (!error.source) error.source = node;
|
19
|
-
doc.errors.push(error);
|
20
|
-
});
|
21
|
-
return res.str;
|
22
|
-
};
|
23
|
-
|
24
|
-
exports.resolveString = resolveString;
|
25
|
-
var _default = {
|
26
|
-
identify: value => typeof value === 'string',
|
27
|
-
default: true,
|
28
|
-
tag: 'tag:yaml.org,2002:str',
|
29
|
-
resolve: resolveString,
|
30
|
-
|
31
|
-
stringify(item, ctx, onComment, onChompKeep) {
|
32
|
-
ctx = Object.assign({
|
33
|
-
actualString: true
|
34
|
-
}, ctx);
|
35
|
-
return (0, _stringify.stringifyString)(item, ctx, onComment, onChompKeep);
|
36
|
-
},
|
37
|
-
|
38
|
-
options: _options.strOptions
|
39
|
-
};
|
40
|
-
exports.default = _default;
|
@@ -1,62 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.tags = exports.schemas = void 0;
|
7
|
-
|
8
|
-
var _core = _interopRequireWildcard(require("./core"));
|
9
|
-
|
10
|
-
var _failsafe = _interopRequireDefault(require("./failsafe"));
|
11
|
-
|
12
|
-
var _json = _interopRequireDefault(require("./json"));
|
13
|
-
|
14
|
-
var _yaml = _interopRequireDefault(require("./yaml-1.1"));
|
15
|
-
|
16
|
-
var _map = _interopRequireDefault(require("./failsafe/map"));
|
17
|
-
|
18
|
-
var _seq = _interopRequireDefault(require("./failsafe/seq"));
|
19
|
-
|
20
|
-
var _binary = _interopRequireDefault(require("./yaml-1.1/binary"));
|
21
|
-
|
22
|
-
var _omap = _interopRequireDefault(require("./yaml-1.1/omap"));
|
23
|
-
|
24
|
-
var _pairs = _interopRequireDefault(require("./yaml-1.1/pairs"));
|
25
|
-
|
26
|
-
var _set = _interopRequireDefault(require("./yaml-1.1/set"));
|
27
|
-
|
28
|
-
var _timestamp = require("./yaml-1.1/timestamp");
|
29
|
-
|
30
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
31
|
-
|
32
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
33
|
-
|
34
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
35
|
-
|
36
|
-
const schemas = {
|
37
|
-
core: _core.default,
|
38
|
-
failsafe: _failsafe.default,
|
39
|
-
json: _json.default,
|
40
|
-
yaml11: _yaml.default
|
41
|
-
};
|
42
|
-
exports.schemas = schemas;
|
43
|
-
const tags = {
|
44
|
-
binary: _binary.default,
|
45
|
-
bool: _core.boolObj,
|
46
|
-
float: _core.floatObj,
|
47
|
-
floatExp: _core.expObj,
|
48
|
-
floatNaN: _core.nanObj,
|
49
|
-
floatTime: _timestamp.floatTime,
|
50
|
-
int: _core.intObj,
|
51
|
-
intHex: _core.hexObj,
|
52
|
-
intOct: _core.octObj,
|
53
|
-
intTime: _timestamp.intTime,
|
54
|
-
map: _map.default,
|
55
|
-
null: _core.nullObj,
|
56
|
-
omap: _omap.default,
|
57
|
-
pairs: _pairs.default,
|
58
|
-
seq: _seq.default,
|
59
|
-
set: _set.default,
|
60
|
-
timestamp: _timestamp.timestamp
|
61
|
-
};
|
62
|
-
exports.tags = tags;
|
@@ -1,60 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.default = void 0;
|
7
|
-
|
8
|
-
var _map = _interopRequireDefault(require("./failsafe/map"));
|
9
|
-
|
10
|
-
var _seq = _interopRequireDefault(require("./failsafe/seq"));
|
11
|
-
|
12
|
-
var _Scalar = _interopRequireDefault(require("../schema/Scalar"));
|
13
|
-
|
14
|
-
var _string = require("./failsafe/string");
|
15
|
-
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
17
|
-
|
18
|
-
const schema = [_map.default, _seq.default, {
|
19
|
-
identify: value => typeof value === 'string',
|
20
|
-
default: true,
|
21
|
-
tag: 'tag:yaml.org,2002:str',
|
22
|
-
resolve: _string.resolveString,
|
23
|
-
stringify: value => JSON.stringify(value)
|
24
|
-
}, {
|
25
|
-
identify: value => value == null,
|
26
|
-
createNode: (schema, value, ctx) => ctx.wrapScalars ? new _Scalar.default(null) : null,
|
27
|
-
default: true,
|
28
|
-
tag: 'tag:yaml.org,2002:null',
|
29
|
-
test: /^null$/,
|
30
|
-
resolve: () => null,
|
31
|
-
stringify: value => JSON.stringify(value)
|
32
|
-
}, {
|
33
|
-
identify: value => typeof value === 'boolean',
|
34
|
-
default: true,
|
35
|
-
tag: 'tag:yaml.org,2002:bool',
|
36
|
-
test: /^true|false$/,
|
37
|
-
resolve: str => str === 'true',
|
38
|
-
stringify: value => JSON.stringify(value)
|
39
|
-
}, {
|
40
|
-
identify: value => typeof value === 'number',
|
41
|
-
default: true,
|
42
|
-
tag: 'tag:yaml.org,2002:int',
|
43
|
-
test: /^-?(?:0|[1-9][0-9]*)$/,
|
44
|
-
resolve: str => parseInt(str, 10),
|
45
|
-
stringify: value => JSON.stringify(value)
|
46
|
-
}, {
|
47
|
-
identify: value => typeof value === 'number',
|
48
|
-
default: true,
|
49
|
-
tag: 'tag:yaml.org,2002:float',
|
50
|
-
test: /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,
|
51
|
-
resolve: str => parseFloat(str),
|
52
|
-
stringify: value => JSON.stringify(value)
|
53
|
-
}];
|
54
|
-
|
55
|
-
schema.scalarFallback = str => {
|
56
|
-
throw new SyntaxError(`Unresolved plain scalar ${JSON.stringify(str)}`);
|
57
|
-
};
|
58
|
-
|
59
|
-
var _default = schema;
|
60
|
-
exports.default = _default;
|