summaryrefslogtreecommitdiff
path: root/node_modules/yaml/browser/dist/nodes/Scalar.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/yaml/browser/dist/nodes/Scalar.js')
-rw-r--r--node_modules/yaml/browser/dist/nodes/Scalar.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/node_modules/yaml/browser/dist/nodes/Scalar.js b/node_modules/yaml/browser/dist/nodes/Scalar.js
new file mode 100644
index 0000000..e7f22a7
--- /dev/null
+++ b/node_modules/yaml/browser/dist/nodes/Scalar.js
@@ -0,0 +1,23 @@
+import { NodeBase, SCALAR } from './Node.js';
+import { toJS } from './toJS.js';
+
+const isScalarValue = (value) => !value || (typeof value !== 'function' && typeof value !== 'object');
+class Scalar extends NodeBase {
+ constructor(value) {
+ super(SCALAR);
+ this.value = value;
+ }
+ toJSON(arg, ctx) {
+ return (ctx === null || ctx === void 0 ? void 0 : ctx.keep) ? this.value : toJS(this.value, arg, ctx);
+ }
+ toString() {
+ return String(this.value);
+ }
+}
+Scalar.BLOCK_FOLDED = 'BLOCK_FOLDED';
+Scalar.BLOCK_LITERAL = 'BLOCK_LITERAL';
+Scalar.PLAIN = 'PLAIN';
+Scalar.QUOTE_DOUBLE = 'QUOTE_DOUBLE';
+Scalar.QUOTE_SINGLE = 'QUOTE_SINGLE';
+
+export { Scalar, isScalarValue };