noodl-types
Advanced tools
Comparing version 1.0.79 to 1.0.80
@@ -52,4 +52,4 @@ "use strict"; | ||
describe(label('ecosObj'), function () { | ||
describe("note", function () { | ||
it("should return true for note docs", function () { | ||
describe("note/pdf", function () { | ||
it("should return true for note/pdf docs", function () { | ||
var ecosObj = { | ||
@@ -64,5 +64,5 @@ name: { | ||
}; | ||
chai_1.expect(t.Identify.ecosObj.note(ecosObj)).to.be.true; | ||
chai_1.expect(t.Identify.ecosObj.doc(ecosObj)).to.be.true; | ||
}); | ||
it("should return false for docs that are not note docs", function () { | ||
it("should return false for docs that are not note/pdf docs", function () { | ||
var ecosObj = { | ||
@@ -77,17 +77,17 @@ name: { | ||
}; | ||
chai_1.expect(t.Identify.ecosObj.note(ecosObj)).to.be.false; | ||
chai_1.expect(t.Identify.ecosObj.doc(ecosObj)).to.be.false; | ||
ecosObj.name.type = 'application/pdf'; | ||
chai_1.expect(t.Identify.ecosObj.note(ecosObj)).to.be.false; | ||
chai_1.expect(t.Identify.ecosObj.doc(ecosObj)).to.be.false; | ||
ecosObj.name.type = 'text/html'; | ||
chai_1.expect(t.Identify.ecosObj.note(ecosObj)).to.be.false; | ||
chai_1.expect(t.Identify.ecosObj.doc(ecosObj)).to.be.false; | ||
ecosObj.name.type = 'text/markdown'; | ||
chai_1.expect(t.Identify.ecosObj.note(ecosObj)).to.be.false; | ||
chai_1.expect(t.Identify.ecosObj.doc(ecosObj)).to.be.false; | ||
ecosObj.name.type = 'text/javascript'; | ||
chai_1.expect(t.Identify.ecosObj.note(ecosObj)).to.be.false; | ||
chai_1.expect(t.Identify.ecosObj.doc(ecosObj)).to.be.false; | ||
ecosObj.name.type = 'image/png'; | ||
chai_1.expect(t.Identify.ecosObj.note(ecosObj)).to.be.false; | ||
chai_1.expect(t.Identify.ecosObj.doc(ecosObj)).to.be.false; | ||
ecosObj.name.type = 'image/jpg'; | ||
chai_1.expect(t.Identify.ecosObj.note(ecosObj)).to.be.false; | ||
chai_1.expect(t.Identify.ecosObj.doc(ecosObj)).to.be.false; | ||
ecosObj.name.type = 'video/mp4'; | ||
chai_1.expect(t.Identify.ecosObj.note(ecosObj)).to.be.false; | ||
chai_1.expect(t.Identify.ecosObj.doc(ecosObj)).to.be.false; | ||
}); | ||
@@ -94,0 +94,0 @@ }); |
@@ -30,3 +30,3 @@ export interface EcosDocument<NF extends NameField = NameField, MT extends MediaType = MediaType> { | ||
export declare namespace MimeType { | ||
type Options = Audio | Image | Json | Pdf | Video; | ||
type Options = Audio | Image | Json | Pdf | Text | Video; | ||
type Audio = `audio/${'3gp' | 'flac' | 'm4a' | 'mp3' | 'ogg' | 'wav' | 'wma' | 'webm'}`; | ||
@@ -36,2 +36,3 @@ type Image = `image/${'ai' | 'bmp' | 'eps' | 'gif' | 'jpg' | 'jpeg' | 'png' | 'psd' | 'svg' | 'tiff' | 'webp'}`; | ||
type Pdf = 'application/pdf'; | ||
type Text = `text/${'css' | 'html' | 'javascript' | 'plain'}`; | ||
type Video = `video/${'avi' | 'flv' | 'mkv' | 'mov' | 'mpg' | 'mp4' | 'ogg' | 'webm' | 'wmv'}`; | ||
@@ -38,0 +39,0 @@ } |
@@ -76,12 +76,11 @@ import { StyleObject } from './styleTypes'; | ||
audio(v: unknown): void; | ||
doc(v: unknown): void; | ||
doc(v: unknown): v is T.EcosDocument<T.NameField<"application/json" | "application/pdf">, 1>; | ||
font(v: unknown): void; | ||
image(v: unknown): void; | ||
image(v: unknown): v is T.EcosDocument<T.NameField<"image/ai" | "image/bmp" | "image/eps" | "image/gif" | "image/jpg" | "image/jpeg" | "image/png" | "image/psd" | "image/svg" | "image/tiff" | "image/webp">, 4>; | ||
message(v: unknown): void; | ||
model(v: unknown): void; | ||
multipart(v: unknown): void; | ||
note(v: unknown): v is T.EcosDocument<T.NameField<"application/json" | "application/pdf">, 1>; | ||
other(v: unknown): void; | ||
text(v: unknown): void; | ||
video(v: unknown): void; | ||
other(v: unknown): v is T.EcosDocument<T.NameField<any>, 0>; | ||
text(v: unknown): v is T.EcosDocument<T.NameField<"text/css" | "text/html" | "text/javascript" | "text/plain">, 0 | 8>; | ||
video(v: unknown): v is T.EcosDocument<T.NameField<"video/ogg" | "video/webm" | "video/avi" | "video/flv" | "video/mkv" | "video/mov" | "video/mpg" | "video/mp4" | "video/wmv">, 9>; | ||
}; | ||
@@ -88,0 +87,0 @@ emit(v: unknown): v is T.EmitObject; |
@@ -180,14 +180,35 @@ "use strict"; | ||
audio: function (v) { }, | ||
doc: function (v) { }, | ||
doc: function (v) { | ||
var _a; | ||
return (i.hasNameField(v) && | ||
(/application\//i.test(((_a = v.name) === null || _a === void 0 ? void 0 : _a.type) || '') || | ||
v.subtype.mediaType === 1)); | ||
}, | ||
font: function (v) { }, | ||
image: function (v) { }, | ||
image: function (v) { | ||
var _a; | ||
return (i.hasNameField(v) && | ||
(/image/i.test(((_a = v.name) === null || _a === void 0 ? void 0 : _a.type) || '') || v.subtype.mediaType === 4)); | ||
}, | ||
message: function (v) { }, | ||
model: function (v) { }, | ||
multipart: function (v) { }, | ||
note: function (v) { | ||
return i.hasNameField(v) && v.name.type === 'application/json'; | ||
other: function (v) { | ||
var _a; | ||
return (i.hasNameField(v) && | ||
(!/(application|audio|font|image|multipart|text|video)\//i.test(((_a = v.name) === null || _a === void 0 ? void 0 : _a.type) || '') || | ||
v.subtype.mediaType === 0)); | ||
}, | ||
other: function (v) { }, | ||
text: function (v) { }, | ||
video: function (v) { }, | ||
text: function (v) { | ||
var _a; | ||
return (i.hasNameField(v) && | ||
(/text\//i.test(((_a = v.name) === null || _a === void 0 ? void 0 : _a.type) || '') || | ||
v.subtype.mediaType === 8 || | ||
v.subtype.mediaType === 0)); | ||
}, | ||
video: function (v) { | ||
var _a; | ||
return (i.hasNameField(v) && | ||
(/video\//i.test(((_a = v.name) === null || _a === void 0 ? void 0 : _a.type) || '') || v.subtype.mediaType === 9)); | ||
}, | ||
}, | ||
@@ -194,0 +215,0 @@ emit: function (v) { |
{ | ||
"name": "noodl-types", | ||
"version": "1.0.79", | ||
"version": "1.0.80", | ||
"description": "NOODL TypeScript Definitions", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
83419
1526